#include <btDbvt.h>
Classes | |
struct | IClone |
struct | ICollide |
struct | IWriter |
struct | sStkCLN |
struct | sStkNN |
struct | sStkNP |
struct | sStkNPS |
Public Types | |
enum | { SIMPLE_STACKSIZE = 64, DOUBLE_STACKSIZE = SIMPLE_STACKSIZE*2 } |
Public Member Functions | |
btDbvt () | |
void | clear () |
void | clone (btDbvt &dest, IClone *iclone=0) const |
DBVT_PREFIX void | collideTT (const btDbvtNode *root0, const btDbvtNode *root1, DBVT_IPOLICY) |
DBVT_PREFIX void | collideTTpersistentStack (const btDbvtNode *root0, const btDbvtNode *root1, DBVT_IPOLICY) |
DBVT_PREFIX void | collideTV (const btDbvtNode *root, const btDbvtVolume &volume, DBVT_IPOLICY) |
bool | empty () const |
btDbvtNode * | insert (const btDbvtVolume &box, void *data) |
void | optimizeBottomUp () |
void | optimizeIncremental (int passes) |
void | optimizeTopDown (int bu_treshold=128) |
DBVT_PREFIX void | rayTestInternal (const btDbvtNode *root, const btVector3 &rayFrom, const btVector3 &rayTo, const btVector3 &rayDirectionInverse, unsigned int signs[3], btScalar lambda_max, const btVector3 &aabbMin, const btVector3 &aabbMax, DBVT_IPOLICY) const |
void | remove (btDbvtNode *leaf) |
bool | update (btDbvtNode *leaf, btDbvtVolume &volume, btScalar margin) |
bool | update (btDbvtNode *leaf, btDbvtVolume &volume, const btVector3 &velocity) |
bool | update (btDbvtNode *leaf, btDbvtVolume &volume, const btVector3 &velocity, btScalar margin) |
void | update (btDbvtNode *leaf, btDbvtVolume &volume) |
void | update (btDbvtNode *leaf, int lookahead=-1) |
void | write (IWriter *iwriter) const |
~btDbvt () | |
Static Public Member Functions | |
static DBVT_INLINE int | allocate (btAlignedObjectArray< int > &ifree, btAlignedObjectArray< sStkNPS > &stock, const sStkNPS &value) |
static void | benchmark () |
static DBVT_PREFIX void | collideKDOP (const btDbvtNode *root, const btVector3 *normals, const btScalar *offsets, int count, DBVT_IPOLICY) |
static DBVT_PREFIX void | collideOCL (const btDbvtNode *root, const btVector3 *normals, const btScalar *offsets, const btVector3 &sortaxis, int count, DBVT_IPOLICY, bool fullsort=true) |
static DBVT_PREFIX void | collideTU (const btDbvtNode *root, DBVT_IPOLICY) |
static int | countLeaves (const btDbvtNode *node) |
static DBVT_PREFIX void | enumLeaves (const btDbvtNode *root, DBVT_IPOLICY) |
static DBVT_PREFIX void | enumNodes (const btDbvtNode *root, DBVT_IPOLICY) |
static void | extractLeaves (const btDbvtNode *node, btAlignedObjectArray< const btDbvtNode * > &leaves) |
static int | maxdepth (const btDbvtNode *node) |
static DBVT_INLINE int | nearest (const int *i, const btDbvt::sStkNPS *a, btScalar v, int l, int h) |
static DBVT_PREFIX void | rayTest (const btDbvtNode *root, const btVector3 &rayFrom, const btVector3 &rayTo, DBVT_IPOLICY) |
Public Attributes | |
btDbvtNode * | m_free |
int | m_leaves |
int | m_lkhd |
unsigned | m_opath |
btDbvtNode * | m_root |
btAlignedObjectArray< sStkNN > | m_stkStack |
Private Member Functions | |
btDbvt (const btDbvt &) |
The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree). This btDbvt is used for soft body collision detection and for the btDbvtBroadphase. It has a fast insert, remove and update of nodes. Unlike the btQuantizedBvh, nodes can be dynamically moved around, which allows for change in topology of the underlying data structure.
Definition at line 190 of file btDbvt.h.
anonymous enum |
btDbvt::btDbvt | ( | ) |
btDbvt::~btDbvt | ( | ) |
static DBVT_INLINE int btDbvt::allocate | ( | btAlignedObjectArray< int > & | ifree, | |
btAlignedObjectArray< sStkNPS > & | stock, | |||
const sStkNPS & | value | |||
) | [inline, static] |
void btDbvt::clear | ( | ) |
DBVT_PREFIX void btDbvt::collideKDOP | ( | const btDbvtNode * | root, | |
const btVector3 * | normals, | |||
const btScalar * | offsets, | |||
int | count, | |||
DBVT_IPOLICY | ||||
) | [inline, static] |
DBVT_PREFIX void btDbvt::collideOCL | ( | const btDbvtNode * | root, | |
const btVector3 * | normals, | |||
const btScalar * | offsets, | |||
const btVector3 & | sortaxis, | |||
int | count, | |||
DBVT_IPOLICY | , | |||
bool | fullsort = true | |||
) | [inline, static] |
DBVT_PREFIX void btDbvt::collideTT | ( | const btDbvtNode * | root0, | |
const btDbvtNode * | root1, | |||
DBVT_IPOLICY | ||||
) | [inline] |
DBVT_PREFIX void btDbvt::collideTTpersistentStack | ( | const btDbvtNode * | root0, | |
const btDbvtNode * | root1, | |||
DBVT_IPOLICY | ||||
) | [inline] |
DBVT_PREFIX void btDbvt::collideTU | ( | const btDbvtNode * | root, | |
DBVT_IPOLICY | ||||
) | [inline, static] |
DBVT_PREFIX void btDbvt::collideTV | ( | const btDbvtNode * | root, | |
const btDbvtVolume & | volume, | |||
DBVT_IPOLICY | ||||
) | [inline] |
static int btDbvt::countLeaves | ( | const btDbvtNode * | node | ) | [static] |
DBVT_PREFIX void btDbvt::enumLeaves | ( | const btDbvtNode * | root, | |
DBVT_IPOLICY | ||||
) | [inline, static] |
DBVT_PREFIX void btDbvt::enumNodes | ( | const btDbvtNode * | root, | |
DBVT_IPOLICY | ||||
) | [inline, static] |
static void btDbvt::extractLeaves | ( | const btDbvtNode * | node, | |
btAlignedObjectArray< const btDbvtNode * > & | leaves | |||
) | [static] |
btDbvtNode* btDbvt::insert | ( | const btDbvtVolume & | box, | |
void * | data | |||
) |
static int btDbvt::maxdepth | ( | const btDbvtNode * | node | ) | [static] |
static DBVT_INLINE int btDbvt::nearest | ( | const int * | i, | |
const btDbvt::sStkNPS * | a, | |||
btScalar | v, | |||
int | l, | |||
int | h | |||
) | [inline, static] |
void btDbvt::optimizeBottomUp | ( | ) |
void btDbvt::optimizeIncremental | ( | int | passes | ) |
void btDbvt::optimizeTopDown | ( | int | bu_treshold = 128 |
) |
DBVT_PREFIX void btDbvt::rayTest | ( | const btDbvtNode * | root, | |
const btVector3 & | rayFrom, | |||
const btVector3 & | rayTo, | |||
DBVT_IPOLICY | ||||
) | [inline, static] |
rayTest is a re-entrant ray test, and can be called in parallel as long as the btAlignedAlloc is thread-safe (uses locking etc) rayTest is slower than rayTestInternal, because it builds a local stack, using memory allocations, and it recomputes signs/rayDirectionInverses each time
what about division by zero? --> just set rayDirection[i] to INF/BT_LARGE_FLOAT
DBVT_PREFIX void btDbvt::rayTestInternal | ( | const btDbvtNode * | root, | |
const btVector3 & | rayFrom, | |||
const btVector3 & | rayTo, | |||
const btVector3 & | rayDirectionInverse, | |||
unsigned int | signs[3], | |||
btScalar | lambda_max, | |||
const btVector3 & | aabbMin, | |||
const btVector3 & | aabbMax, | |||
DBVT_IPOLICY | ||||
) | const [inline] |
rayTestInternal is faster than rayTest, because it uses a persistent stack (to reduce dynamic memory allocations to a minimum) and it uses precomputed signs/rayInverseDirections rayTestInternal is used by btDbvtBroadphase to accelerate world ray casts
void btDbvt::remove | ( | btDbvtNode * | leaf | ) |
bool btDbvt::update | ( | btDbvtNode * | leaf, | |
btDbvtVolume & | volume, | |||
btScalar | margin | |||
) |
bool btDbvt::update | ( | btDbvtNode * | leaf, | |
btDbvtVolume & | volume, | |||
const btVector3 & | velocity | |||
) |
bool btDbvt::update | ( | btDbvtNode * | leaf, | |
btDbvtVolume & | volume, | |||
const btVector3 & | velocity, | |||
btScalar | margin | |||
) |
void btDbvt::update | ( | btDbvtNode * | leaf, | |
btDbvtVolume & | volume | |||
) |
void btDbvt::update | ( | btDbvtNode * | leaf, | |
int | lookahead = -1 | |||
) |
void btDbvt::write | ( | IWriter * | iwriter | ) | const |
int btDbvt::m_leaves |
int btDbvt::m_lkhd |
unsigned btDbvt::m_opath |