Bullet Collision Detection & Physics Library
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
btDbvtBroadphase Struct Reference

The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt). More...

#include <btDbvtBroadphase.h>

Inheritance diagram for btDbvtBroadphase:
Inheritance graph
[legend]
Collaboration diagram for btDbvtBroadphase:
Collaboration graph
[legend]

Public Types

enum  {
  DYNAMIC_SET = 0 ,
  FIXED_SET = 1 ,
  STAGECOUNT = 2
}
 

Public Member Functions

 btDbvtBroadphase (btOverlappingPairCache *paircache=0)
 
 ~btDbvtBroadphase ()
 
void collide (btDispatcher *dispatcher)
 
void optimize ()
 
btBroadphaseProxycreateProxy (const btVector3 &aabbMin, const btVector3 &aabbMax, int shapeType, void *userPtr, int collisionFilterGroup, int collisionFilterMask, btDispatcher *dispatcher)
 
virtual void destroyProxy (btBroadphaseProxy *proxy, btDispatcher *dispatcher)
 
virtual void setAabb (btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)
 
virtual void rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btBroadphaseRayCallback &rayCallback, const btVector3 &aabbMin=btVector3(0, 0, 0), const btVector3 &aabbMax=btVector3(0, 0, 0))
 
virtual void aabbTest (const btVector3 &aabbMin, const btVector3 &aabbMax, btBroadphaseAabbCallback &callback)
 
virtual void getAabb (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const
 
virtual void calculateOverlappingPairs (btDispatcher *dispatcher)
 calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb More...
 
virtual btOverlappingPairCachegetOverlappingPairCache ()
 
virtual const btOverlappingPairCachegetOverlappingPairCache () const
 
virtual void getBroadphaseAabb (btVector3 &aabbMin, btVector3 &aabbMax) const
 getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later More...
 
virtual void printStats ()
 
virtual void resetPool (btDispatcher *dispatcher)
 reset broadphase internal structures, to ensure determinism/reproducability More...
 
void performDeferredRemoval (btDispatcher *dispatcher)
 
void setVelocityPrediction (btScalar prediction)
 
btScalar getVelocityPrediction () const
 
void setAabbForceUpdate (btBroadphaseProxy *absproxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *)
 this setAabbForceUpdate is similar to setAabb but always forces the aabb update. More...
 
- Public Member Functions inherited from btBroadphaseInterface
virtual ~btBroadphaseInterface ()
 
virtual btBroadphaseProxycreateProxy (const btVector3 &aabbMin, const btVector3 &aabbMax, int shapeType, void *userPtr, int collisionFilterGroup, int collisionFilterMask, btDispatcher *dispatcher)=0
 
virtual void destroyProxy (btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
 
virtual void setAabb (btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)=0
 
virtual void getAabb (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const =0
 
virtual void rayTest (const btVector3 &rayFrom, const btVector3 &rayTo, btBroadphaseRayCallback &rayCallback, const btVector3 &aabbMin=btVector3(0, 0, 0), const btVector3 &aabbMax=btVector3(0, 0, 0))=0
 
virtual void aabbTest (const btVector3 &aabbMin, const btVector3 &aabbMax, btBroadphaseAabbCallback &callback)=0
 
virtual void calculateOverlappingPairs (btDispatcher *dispatcher)=0
 calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb More...
 
virtual btOverlappingPairCachegetOverlappingPairCache ()=0
 
virtual const btOverlappingPairCachegetOverlappingPairCache () const =0
 
virtual void getBroadphaseAabb (btVector3 &aabbMin, btVector3 &aabbMax) const =0
 getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later More...
 
virtual void resetPool (btDispatcher *dispatcher)
 reset broadphase internal structures, to ensure determinism/reproducability More...
 
virtual void printStats ()=0
 

Static Public Member Functions

static void benchmark (btBroadphaseInterface *)
 

Public Attributes

btDbvt m_sets [2]
 
btDbvtProxym_stageRoots [STAGECOUNT+1]
 
btOverlappingPairCachem_paircache
 
btScalar m_prediction
 
int m_stageCurrent
 
int m_fupdates
 
int m_dupdates
 
int m_cupdates
 
int m_newpairs
 
int m_fixedleft
 
unsigned m_updates_call
 
unsigned m_updates_done
 
btScalar m_updates_ratio
 
int m_pid
 
int m_cid
 
int m_gid
 
bool m_releasepaircache
 
bool m_deferedcollide
 
bool m_needcleanup
 
btAlignedObjectArray< btAlignedObjectArray< const btDbvtNode * > > m_rayTestStacks
 

Detailed Description

The btDbvtBroadphase implements a broadphase using two dynamic AABB bounding volume hierarchies/trees (see btDbvt).

One tree is used for static/non-moving objects, and another tree is used for dynamic objects. Objects can move from one tree to the other. This is a very fast broadphase, especially for very dynamic worlds where many objects are moving. Its insert/add and remove of objects is generally faster than the sweep and prune broadphases btAxisSweep3 and bt32BitAxisSweep3.

Definition at line 62 of file btDbvtBroadphase.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DYNAMIC_SET 
FIXED_SET 
STAGECOUNT 

Definition at line 65 of file btDbvtBroadphase.h.

Constructor & Destructor Documentation

◆ btDbvtBroadphase()

btDbvtBroadphase::btDbvtBroadphase ( btOverlappingPairCache paircache = 0)

Definition at line 131 of file btDbvtBroadphase.cpp.

◆ ~btDbvtBroadphase()

btDbvtBroadphase::~btDbvtBroadphase ( )

Definition at line 165 of file btDbvtBroadphase.cpp.

Member Function Documentation

◆ aabbTest()

void btDbvtBroadphase::aabbTest ( const btVector3 aabbMin,
const btVector3 aabbMax,
btBroadphaseAabbCallback callback 
)
virtual

Implements btBroadphaseInterface.

Definition at line 300 of file btDbvtBroadphase.cpp.

◆ benchmark()

void btDbvtBroadphase::benchmark ( btBroadphaseInterface )
static

Definition at line 821 of file btDbvtBroadphase.cpp.

◆ calculateOverlappingPairs()

void btDbvtBroadphase::calculateOverlappingPairs ( btDispatcher dispatcher)
virtual

calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb

Implements btBroadphaseInterface.

Definition at line 417 of file btDbvtBroadphase.cpp.

◆ collide()

void btDbvtBroadphase::collide ( btDispatcher dispatcher)

Definition at line 512 of file btDbvtBroadphase.cpp.

◆ createProxy()

btBroadphaseProxy * btDbvtBroadphase::createProxy ( const btVector3 aabbMin,
const btVector3 aabbMax,
int  shapeType,
void *  userPtr,
int  collisionFilterGroup,
int  collisionFilterMask,
btDispatcher dispatcher 
)
virtual

Implements btBroadphaseInterface.

Definition at line 175 of file btDbvtBroadphase.cpp.

◆ destroyProxy()

void btDbvtBroadphase::destroyProxy ( btBroadphaseProxy proxy,
btDispatcher dispatcher 
)
virtual

Implements btBroadphaseInterface.

Definition at line 205 of file btDbvtBroadphase.cpp.

◆ getAabb()

void btDbvtBroadphase::getAabb ( btBroadphaseProxy proxy,
btVector3 aabbMin,
btVector3 aabbMax 
) const
virtual

Implements btBroadphaseInterface.

Definition at line 219 of file btDbvtBroadphase.cpp.

◆ getBroadphaseAabb()

void btDbvtBroadphase::getBroadphaseAabb ( btVector3 aabbMin,
btVector3 aabbMax 
) const
virtual

getAabb returns the axis aligned bounding box in the 'global' coordinate frame will add some transform later

Implements btBroadphaseInterface.

Definition at line 646 of file btDbvtBroadphase.cpp.

◆ getOverlappingPairCache() [1/2]

btOverlappingPairCache * btDbvtBroadphase::getOverlappingPairCache ( )
virtual

Implements btBroadphaseInterface.

Definition at line 634 of file btDbvtBroadphase.cpp.

◆ getOverlappingPairCache() [2/2]

const btOverlappingPairCache * btDbvtBroadphase::getOverlappingPairCache ( ) const
virtual

Implements btBroadphaseInterface.

Definition at line 640 of file btDbvtBroadphase.cpp.

◆ getVelocityPrediction()

btScalar btDbvtBroadphase::getVelocityPrediction ( ) const
inline

Definition at line 132 of file btDbvtBroadphase.h.

◆ optimize()

void btDbvtBroadphase::optimize ( )

Definition at line 627 of file btDbvtBroadphase.cpp.

◆ performDeferredRemoval()

void btDbvtBroadphase::performDeferredRemoval ( btDispatcher dispatcher)

Definition at line 443 of file btDbvtBroadphase.cpp.

◆ printStats()

void btDbvtBroadphase::printStats ( )
virtual

Implements btBroadphaseInterface.

Definition at line 697 of file btDbvtBroadphase.cpp.

◆ rayTest()

void btDbvtBroadphase::rayTest ( const btVector3 rayFrom,
const btVector3 rayTo,
btBroadphaseRayCallback rayCallback,
const btVector3 aabbMin = btVector3(0, 0, 0),
const btVector3 aabbMax = btVector3(0, 0, 0) 
)
virtual

Implements btBroadphaseInterface.

Definition at line 240 of file btDbvtBroadphase.cpp.

◆ resetPool()

void btDbvtBroadphase::resetPool ( btDispatcher dispatcher)
virtual

reset broadphase internal structures, to ensure determinism/reproducability

Reimplemented from btBroadphaseInterface.

Definition at line 665 of file btDbvtBroadphase.cpp.

◆ setAabb()

void btDbvtBroadphase::setAabb ( btBroadphaseProxy proxy,
const btVector3 aabbMin,
const btVector3 aabbMax,
btDispatcher dispatcher 
)
virtual

Implements btBroadphaseInterface.

Definition at line 311 of file btDbvtBroadphase.cpp.

◆ setAabbForceUpdate()

void btDbvtBroadphase::setAabbForceUpdate ( btBroadphaseProxy absproxy,
const btVector3 aabbMin,
const btVector3 aabbMax,
btDispatcher  
)

this setAabbForceUpdate is similar to setAabb but always forces the aabb update.

it is not part of the btBroadphaseInterface but specific to btDbvtBroadphase. it bypasses certain optimizations that prevent aabb updates (when the aabb shrinks), see http://code.google.com/p/bullet/issues/detail?id=223

Definition at line 376 of file btDbvtBroadphase.cpp.

◆ setVelocityPrediction()

void btDbvtBroadphase::setVelocityPrediction ( btScalar  prediction)
inline

Definition at line 128 of file btDbvtBroadphase.h.

Member Data Documentation

◆ m_cid

int btDbvtBroadphase::m_cid

Definition at line 86 of file btDbvtBroadphase.h.

◆ m_cupdates

int btDbvtBroadphase::m_cupdates

Definition at line 79 of file btDbvtBroadphase.h.

◆ m_deferedcollide

bool btDbvtBroadphase::m_deferedcollide

Definition at line 89 of file btDbvtBroadphase.h.

◆ m_dupdates

int btDbvtBroadphase::m_dupdates

Definition at line 78 of file btDbvtBroadphase.h.

◆ m_fixedleft

int btDbvtBroadphase::m_fixedleft

Definition at line 81 of file btDbvtBroadphase.h.

◆ m_fupdates

int btDbvtBroadphase::m_fupdates

Definition at line 77 of file btDbvtBroadphase.h.

◆ m_gid

int btDbvtBroadphase::m_gid

Definition at line 87 of file btDbvtBroadphase.h.

◆ m_needcleanup

bool btDbvtBroadphase::m_needcleanup

Definition at line 90 of file btDbvtBroadphase.h.

◆ m_newpairs

int btDbvtBroadphase::m_newpairs

Definition at line 80 of file btDbvtBroadphase.h.

◆ m_paircache

btOverlappingPairCache* btDbvtBroadphase::m_paircache

Definition at line 74 of file btDbvtBroadphase.h.

◆ m_pid

int btDbvtBroadphase::m_pid

Definition at line 85 of file btDbvtBroadphase.h.

◆ m_prediction

btScalar btDbvtBroadphase::m_prediction

Definition at line 75 of file btDbvtBroadphase.h.

◆ m_rayTestStacks

btAlignedObjectArray<btAlignedObjectArray<const btDbvtNode*> > btDbvtBroadphase::m_rayTestStacks

Definition at line 91 of file btDbvtBroadphase.h.

◆ m_releasepaircache

bool btDbvtBroadphase::m_releasepaircache

Definition at line 88 of file btDbvtBroadphase.h.

◆ m_sets

btDbvt btDbvtBroadphase::m_sets[2]

Definition at line 72 of file btDbvtBroadphase.h.

◆ m_stageCurrent

int btDbvtBroadphase::m_stageCurrent

Definition at line 76 of file btDbvtBroadphase.h.

◆ m_stageRoots

btDbvtProxy* btDbvtBroadphase::m_stageRoots[STAGECOUNT+1]

Definition at line 73 of file btDbvtBroadphase.h.

◆ m_updates_call

unsigned btDbvtBroadphase::m_updates_call

Definition at line 82 of file btDbvtBroadphase.h.

◆ m_updates_done

unsigned btDbvtBroadphase::m_updates_done

Definition at line 83 of file btDbvtBroadphase.h.

◆ m_updates_ratio

btScalar btDbvtBroadphase::m_updates_ratio

Definition at line 84 of file btDbvtBroadphase.h.


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