Blender V2.61 - r43446
Classes | Defines | Typedefs | Functions

btQuantizedBvh.h File Reference

#include "LinearMath/btVector3.h"
#include "LinearMath/btAlignedAllocator.h"
#include "LinearMath/btAlignedObjectArray.h"

Go to the source code of this file.

Classes

class  btNodeOverlapCallback
struct  btBvhSubtreeInfoData
struct  btOptimizedBvhNodeFloatData
struct  btOptimizedBvhNodeDoubleData
struct  btQuantizedBvhNodeData
struct  btQuantizedBvhFloatData
struct  btQuantizedBvhDoubleData

Defines

#define btQuantizedBvhData   btQuantizedBvhFloatData
#define btOptimizedBvhNodeData   btOptimizedBvhNodeFloatData
#define btQuantizedBvhDataName   "btQuantizedBvhFloatData"
#define MAX_SUBTREE_SIZE_IN_BYTES   2048
#define MAX_NUM_PARTS_IN_BITS   10

Typedefs

typedef btAlignedObjectArray
< btOptimizedBvhNode > 
NodeArray
 for code readability:
typedef btAlignedObjectArray
< btQuantizedBvhNode > 
QuantizedNodeArray
typedef btAlignedObjectArray
< btBvhSubtreeInfo > 
BvhSubtreeInfoArray

Functions

 ATTRIBUTE_ALIGNED16 (struct) btQuantizedBvhNode
 ATTRIBUTE_ALIGNED16 (class) btBvhSubtreeInfo
 btBvhSubtreeInfo provides info to gather a subtree of limited size

Define Documentation

#define btOptimizedBvhNodeData   btOptimizedBvhNodeFloatData

Definition at line 40 of file btQuantizedBvh.h.

#define btQuantizedBvhData   btQuantizedBvhFloatData

Definition at line 39 of file btQuantizedBvh.h.

#define btQuantizedBvhDataName   "btQuantizedBvhFloatData"

Definition at line 41 of file btQuantizedBvh.h.

#define MAX_NUM_PARTS_IN_BITS   10
#define MAX_SUBTREE_SIZE_IN_BYTES   2048

Definition at line 50 of file btQuantizedBvh.h.


Typedef Documentation

typedef btAlignedObjectArray<btBvhSubtreeInfo> BvhSubtreeInfoArray

Definition at line 166 of file btQuantizedBvh.h.

typedef btAlignedObjectArray<btOptimizedBvhNode> NodeArray

for code readability:

Definition at line 164 of file btQuantizedBvh.h.

typedef btAlignedObjectArray<btQuantizedBvhNode> QuantizedNodeArray

Definition at line 165 of file btQuantizedBvh.h.


Function Documentation

ATTRIBUTE_ALIGNED16 ( struct  )

btQuantizedBvhNode is a compressed aabb node, 16 bytes. Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).

btOptimizedBvhNode contains both internal and leaf node information. Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.

Definition at line 58 of file btQuantizedBvh.h.

References BT_DECLARE_ALIGNED_ALLOCATOR, btAssert, and MAX_NUM_PARTS_IN_BITS.

ATTRIBUTE_ALIGNED16 ( class  )

btBvhSubtreeInfo provides info to gather a subtree of limited size

Axis aligned box.

The btQuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU. It is used by the btBvhTriangleMeshShape as midphase, and by the btMultiSapBroadphase. It is recommended to use quantization for better performance and lower memory requirements.

two versions, one for quantized and normal nodes. This allows code-reuse while maintaining readability (no template/macro!) this might be refactored into a virtual, it is usually not calculated at run-time

tree traversal designed for small-memory processors like PS3 SPU

use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

use the 16-byte stackless 'skipindex' node tree to do a recursive traversal

***************************************** expert/internal use only *************************

buildInternal is expert use only: assumes that setQuantizationValues and LeafNodeArray are initialized

***************************************** expert/internal use only *************************

Make sure rounding is done in a way that unQuantize(quantizeWithClamp(...)) is conservative end-points always set the first bit, so that they are sorted properly (so that neighbouring AABBs overlap properly)

Todo:
: double-check this

setTraversalMode let's you choose between stackless, recursive or stackless cache friendly tree traversal. Note this is only implemented for quantized trees.

Data buffer MUST be 16 byte aligned

deSerializeInPlace loads and initializes a BVH from a buffer in memory 'in place'

fills the dataBuffer and returns the struct name (and 0 on failure)

Definition at line 117 of file btQuantizedBvh.h.

References BT_DECLARE_ALIGNED_ALLOCATOR.