btDbvt Struct Reference

The btDbvt class implements a fast dynamic bounding volume tree based on axis aligned bounding boxes (aabb tree). More...

#include <btDbvt.h>

Collaboration diagram for btDbvt:
Collaboration graph
[legend]

List of all members.

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 ()
 ~btDbvt ()
void clear ()
bool empty () const
void optimizeBottomUp ()
void optimizeTopDown (int bu_treshold=128)
void optimizeIncremental (int passes)
btDbvtNodeinsert (const btDbvtVolume &box, void *data)
void update (btDbvtNode *leaf, int lookahead=-1)
void update (btDbvtNode *leaf, btDbvtVolume &volume)
bool update (btDbvtNode *leaf, btDbvtVolume &volume, const btVector3 &velocity, btScalar margin)
bool update (btDbvtNode *leaf, btDbvtVolume &volume, const btVector3 &velocity)
bool update (btDbvtNode *leaf, btDbvtVolume &volume, btScalar margin)
void remove (btDbvtNode *leaf)
void write (IWriter *iwriter) const
void clone (btDbvt &dest, IClone *iclone=0) const
void collideTT (const btDbvtNode *root0, const btDbvtNode *root1, ICollide &policy)
void collideTTpersistentStack (const btDbvtNode *root0, const btDbvtNode *root1, ICollide &policy)
void collideTV (const btDbvtNode *root, const btDbvtVolume &volume, ICollide &policy)
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, ICollide &policy) const
 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

Static Public Member Functions

static int maxdepth (const btDbvtNode *node)
static int countLeaves (const btDbvtNode *node)
static void extractLeaves (const btDbvtNode *node, btAlignedObjectArray< const btDbvtNode * > &leaves)
static void benchmark ()
static void enumNodes (const btDbvtNode *root, ICollide &policy)
static void enumLeaves (const btDbvtNode *root, ICollide &policy)
static void rayTest (const btDbvtNode *root, const btVector3 &rayFrom, const btVector3 &rayTo, ICollide &policy)
 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
static void collideKDOP (const btDbvtNode *root, const btVector3 *normals, const btScalar *offsets, int count, ICollide &policy)
static void collideOCL (const btDbvtNode *root, const btVector3 *normals, const btScalar *offsets, const btVector3 &sortaxis, int count, ICollide &policy, bool fullsort=true)
static void collideTU (const btDbvtNode *root, ICollide &policy)
static SIMD_FORCE_INLINE int nearest (const int *i, const btDbvt::sStkNPS *a, btScalar v, int l, int h)
static SIMD_FORCE_INLINE int allocate (btAlignedObjectArray< int > &ifree, btAlignedObjectArray< sStkNPS > &stock, const sStkNPS &value)

Public Attributes

btDbvtNodem_root
btDbvtNodem_free
int m_lkhd
int m_leaves
unsigned m_opath
btAlignedObjectArray< sStkNNm_stkStack

Private Member Functions

 btDbvt (const btDbvt &)

Detailed Description

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.


Member Enumeration Documentation

anonymous enum
Enumerator:
SIMPLE_STACKSIZE 
DOUBLE_STACKSIZE 

Definition at line 248 of file btDbvt.h.


Constructor & Destructor Documentation

btDbvt::btDbvt (  ) 

Definition at line 409 of file btDbvt.cpp.

btDbvt::~btDbvt (  ) 

Definition at line 419 of file btDbvt.cpp.

btDbvt::btDbvt ( const btDbvt  )  [inline, private]

Definition at line 384 of file btDbvt.h.


Member Function Documentation

static SIMD_FORCE_INLINE int btDbvt::allocate ( btAlignedObjectArray< int > &  ifree,
btAlignedObjectArray< sStkNPS > &  stock,
const sStkNPS value 
) [inline, static]

Definition at line 371 of file btDbvt.h.

static void btDbvt::benchmark (  )  [inline, static]

Definition at line 287 of file btDbvt.h.

void btDbvt::clear (  ) 

Definition at line 425 of file btDbvt.cpp.

void btDbvt::clone ( btDbvt dest,
IClone iclone = 0 
) const

Definition at line 588 of file btDbvt.cpp.

void btDbvt::collideKDOP ( const btDbvtNode root,
const btVector3 normals,
const btScalar offsets,
int  count,
ICollide policy 
) [inline, static]

Definition at line 1062 of file btDbvt.h.

void btDbvt::collideOCL ( const btDbvtNode root,
const btVector3 normals,
const btScalar offsets,
const btVector3 sortaxis,
int  count,
ICollide policy,
bool  fullsort = true 
) [inline, static]

Definition at line 1117 of file btDbvt.h.

void btDbvt::collideTT ( const btDbvtNode root0,
const btDbvtNode root1,
ICollide policy 
) [inline]

Definition at line 710 of file btDbvt.h.

void btDbvt::collideTTpersistentStack ( const btDbvtNode root0,
const btDbvtNode root1,
ICollide policy 
) [inline]

Definition at line 775 of file btDbvt.h.

void btDbvt::collideTU ( const btDbvtNode root,
ICollide policy 
) [inline, static]

Definition at line 1215 of file btDbvt.h.

void btDbvt::collideTV ( const btDbvtNode root,
const btDbvtVolume volume,
ICollide policy 
) [inline]

Definition at line 908 of file btDbvt.h.

int btDbvt::countLeaves ( const btDbvtNode node  )  [static]

Definition at line 627 of file btDbvt.cpp.

bool btDbvt::empty (  )  const [inline]

Definition at line 268 of file btDbvt.h.

void btDbvt::enumLeaves ( const btDbvtNode root,
ICollide policy 
) [inline, static]

Definition at line 693 of file btDbvt.h.

void btDbvt::enumNodes ( const btDbvtNode root,
ICollide policy 
) [inline, static]

Definition at line 679 of file btDbvt.h.

void btDbvt::extractLeaves ( const btDbvtNode node,
btAlignedObjectArray< const btDbvtNode * > &  leaves 
) [static]

Definition at line 636 of file btDbvt.cpp.

btDbvtNode * btDbvt::insert ( const btDbvtVolume box,
void *  data 
)

Definition at line 483 of file btDbvt.cpp.

int btDbvt::maxdepth ( const btDbvtNode node  )  [static]

Definition at line 619 of file btDbvt.cpp.

static SIMD_FORCE_INLINE int btDbvt::nearest ( const int *  i,
const btDbvt::sStkNPS a,
btScalar  v,
int  l,
int  h 
) [inline, static]

Definition at line 361 of file btDbvt.h.

void btDbvt::optimizeBottomUp (  ) 

Definition at line 438 of file btDbvt.cpp.

void btDbvt::optimizeIncremental ( int  passes  ) 

Definition at line 463 of file btDbvt.cpp.

void btDbvt::optimizeTopDown ( int  bu_treshold = 128  ) 

Definition at line 451 of file btDbvt.cpp.

void btDbvt::rayTest ( const btDbvtNode root,
const btVector3 rayFrom,
const btVector3 rayTo,
ICollide policy 
) [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

Definition at line 993 of file btDbvt.h.

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,
ICollide policy 
) 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

Definition at line 940 of file btDbvt.h.

void btDbvt::remove ( btDbvtNode leaf  ) 

Definition at line 555 of file btDbvt.cpp.

bool btDbvt::update ( btDbvtNode leaf,
btDbvtVolume volume,
btScalar  margin 
)

Definition at line 546 of file btDbvt.cpp.

bool btDbvt::update ( btDbvtNode leaf,
btDbvtVolume volume,
const btVector3 velocity 
)

Definition at line 537 of file btDbvt.cpp.

bool btDbvt::update ( btDbvtNode leaf,
btDbvtVolume volume,
const btVector3 velocity,
btScalar  margin 
)

Definition at line 527 of file btDbvt.cpp.

void btDbvt::update ( btDbvtNode leaf,
btDbvtVolume volume 
)

Definition at line 509 of file btDbvt.cpp.

void btDbvt::update ( btDbvtNode leaf,
int  lookahead = -1 
)

Definition at line 492 of file btDbvt.cpp.

void btDbvt::write ( IWriter iwriter  )  const

Definition at line 563 of file btDbvt.cpp.


Member Data Documentation

Definition at line 255 of file btDbvt.h.

Definition at line 257 of file btDbvt.h.

Definition at line 256 of file btDbvt.h.

unsigned btDbvt::m_opath

Definition at line 258 of file btDbvt.h.

Definition at line 254 of file btDbvt.h.

Definition at line 261 of file btDbvt.h.


The documentation for this struct was generated from the following files:

Generated on Mon Feb 15 22:22:33 2010 for Bullet Collision Detection & Physics Library by  doxygen 1.6.1