Bullet Collision Detection & Physics Library
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
btAxisSweep3Internal< BP_FP_INT_TYPE > Class Template Reference

The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase. More...

#include <btAxisSweep3.h>

Inheritance diagram for btAxisSweep3Internal< BP_FP_INT_TYPE >:
Inheritance graph
[legend]
Collaboration diagram for btAxisSweep3Internal< BP_FP_INT_TYPE >:
Collaboration graph
[legend]

Classes

class  Edge
 
class  Handle
 

Public Member Functions

 BT_DECLARE_ALIGNED_ALLOCATOR ()
 
 btAxisSweep3Internal (const btVector3 &worldAabbMin, const btVector3 &worldAabbMax, BP_FP_INT_TYPE handleMask, BP_FP_INT_TYPE handleSentinel, BP_FP_INT_TYPE maxHandles=16384, btOverlappingPairCache *pairCache=0, bool disableRaycastAccelerator=false)
 
virtual ~btAxisSweep3Internal ()
 
BP_FP_INT_TYPE getNumHandles () const
 
virtual void calculateOverlappingPairs (btDispatcher *dispatcher)
 calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb More...
 
BP_FP_INT_TYPE addHandle (const btVector3 &aabbMin, const btVector3 &aabbMax, void *pOwner, short int collisionFilterGroup, short int collisionFilterMask, btDispatcher *dispatcher, void *multiSapProxy)
 
void removeHandle (BP_FP_INT_TYPE handle, btDispatcher *dispatcher)
 
void updateHandle (BP_FP_INT_TYPE handle, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)
 
HandlegetHandle (BP_FP_INT_TYPE index) const
 
virtual void resetPool (btDispatcher *dispatcher)
 reset broadphase internal structures, to ensure determinism/reproducability More...
 
void processAllOverlappingPairs (btOverlapCallback *callback)
 
virtual btBroadphaseProxycreateProxy (const btVector3 &aabbMin, const btVector3 &aabbMax, int shapeType, void *userPtr, short int collisionFilterGroup, short int collisionFilterMask, btDispatcher *dispatcher, void *multiSapProxy)
 
virtual void destroyProxy (btBroadphaseProxy *proxy, btDispatcher *dispatcher)
 
virtual void setAabb (btBroadphaseProxy *proxy, const btVector3 &aabbMin, const btVector3 &aabbMax, btDispatcher *dispatcher)
 
virtual void getAabb (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const
 
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)
 
void quantize (BP_FP_INT_TYPE *out, const btVector3 &point, int isMax) const
 
void unQuantize (btBroadphaseProxy *proxy, btVector3 &aabbMin, btVector3 &aabbMax) const
 unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result More...
 
bool testAabbOverlap (btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
 
btOverlappingPairCachegetOverlappingPairCache ()
 
const btOverlappingPairCachegetOverlappingPairCache () const
 
void setOverlappingPairUserCallback (btOverlappingPairCallback *pairCallback)
 
const btOverlappingPairCallbackgetOverlappingPairUserCallback () 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 ()
 
- Public Member Functions inherited from btBroadphaseInterface
virtual ~btBroadphaseInterface ()
 

Protected Member Functions

BP_FP_INT_TYPE allocHandle ()
 
void freeHandle (BP_FP_INT_TYPE handle)
 
bool testOverlap2D (const Handle *pHandleA, const Handle *pHandleB, int axis0, int axis1)
 
void sortMinDown (int axis, BP_FP_INT_TYPE edge, btDispatcher *dispatcher, bool updateOverlaps)
 
void sortMinUp (int axis, BP_FP_INT_TYPE edge, btDispatcher *dispatcher, bool updateOverlaps)
 
void sortMaxDown (int axis, BP_FP_INT_TYPE edge, btDispatcher *dispatcher, bool updateOverlaps)
 
void sortMaxUp (int axis, BP_FP_INT_TYPE edge, btDispatcher *dispatcher, bool updateOverlaps)
 

Protected Attributes

BP_FP_INT_TYPE m_bpHandleMask
 
BP_FP_INT_TYPE m_handleSentinel
 
btVector3 m_worldAabbMin
 
btVector3 m_worldAabbMax
 
btVector3 m_quantize
 
BP_FP_INT_TYPE m_numHandles
 
BP_FP_INT_TYPE m_maxHandles
 
Handlem_pHandles
 
BP_FP_INT_TYPE m_firstFreeHandle
 
Edgem_pEdges [3]
 
void * m_pEdgesRawPtr [3]
 
btOverlappingPairCachem_pairCache
 
btOverlappingPairCallbackm_userPairCallback
 btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache. More...
 
bool m_ownsPairCache
 
int m_invalidPair
 
btDbvtBroadphasem_raycastAccelerator
 additional dynamic aabb structure, used to accelerate ray cast queries. More...
 
btOverlappingPairCachem_nullPairCache
 

Detailed Description

template<typename BP_FP_INT_TYPE>
class btAxisSweep3Internal< BP_FP_INT_TYPE >

The internal templace class btAxisSweep3Internal implements the sweep and prune broadphase.

It uses quantized integers to represent the begin and end points for each of the 3 axis. Dont use this class directly, use btAxisSweep3 or bt32BitAxisSweep3 instead.

Definition at line 36 of file btAxisSweep3.h.

Constructor & Destructor Documentation

template<typename BP_FP_INT_TYPE>
btAxisSweep3Internal< BP_FP_INT_TYPE >::btAxisSweep3Internal ( const btVector3 worldAabbMin,
const btVector3 worldAabbMax,
BP_FP_INT_TYPE  handleMask,
BP_FP_INT_TYPE  handleSentinel,
BP_FP_INT_TYPE  maxHandles = 16384,
btOverlappingPairCache pairCache = 0,
bool  disableRaycastAccelerator = false 
)

Definition at line 352 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
btAxisSweep3Internal< BP_FP_INT_TYPE >::~btAxisSweep3Internal ( )
virtual

Definition at line 435 of file btAxisSweep3.h.

Member Function Documentation

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::aabbTest ( const btVector3 aabbMin,
const btVector3 aabbMax,
btBroadphaseAabbCallback callback 
)
virtual

Implements btBroadphaseInterface.

Definition at line 291 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::addHandle ( const btVector3 aabbMin,
const btVector3 aabbMax,
void *  pOwner,
short int  collisionFilterGroup,
short int  collisionFilterMask,
btDispatcher dispatcher,
void *  multiSapProxy 
)

Definition at line 505 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::allocHandle ( )
protected

Definition at line 481 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btAxisSweep3Internal< BP_FP_INT_TYPE >::BT_DECLARE_ALIGNED_ALLOCATOR ( )
template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::calculateOverlappingPairs ( btDispatcher dispatcher)
virtual

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

important to use an AABB test that is consistent with the broadphase

if you don't like to skip the invalid pairs in the array, execute following code:

Implements btBroadphaseInterface.

Definition at line 636 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
btBroadphaseProxy * btAxisSweep3Internal< BP_FP_INT_TYPE >::createProxy ( const btVector3 aabbMin,
const btVector3 aabbMax,
int  shapeType,
void *  userPtr,
short int  collisionFilterGroup,
short int  collisionFilterMask,
btDispatcher dispatcher,
void *  multiSapProxy 
)
virtual

Implements btBroadphaseInterface.

Definition at line 231 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::destroyProxy ( btBroadphaseProxy proxy,
btDispatcher dispatcher 
)
virtual

Implements btBroadphaseInterface.

Definition at line 249 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::freeHandle ( BP_FP_INT_TYPE  handle)
protected

Definition at line 493 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::getAabb ( btBroadphaseProxy proxy,
btVector3 aabbMin,
btVector3 aabbMax 
) const
virtual

Implements btBroadphaseInterface.

Definition at line 318 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
virtual void btAxisSweep3Internal< BP_FP_INT_TYPE >::getBroadphaseAabb ( btVector3 aabbMin,
btVector3 aabbMax 
) const
inlinevirtual

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

Implements btBroadphaseInterface.

Definition at line 182 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
Handle* btAxisSweep3Internal< BP_FP_INT_TYPE >::getHandle ( BP_FP_INT_TYPE  index) const
inline

Definition at line 140 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::getNumHandles ( ) const
inline

Definition at line 130 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btOverlappingPairCache* btAxisSweep3Internal< BP_FP_INT_TYPE >::getOverlappingPairCache ( )
inlinevirtual

Implements btBroadphaseInterface.

Definition at line 162 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
const btOverlappingPairCache* btAxisSweep3Internal< BP_FP_INT_TYPE >::getOverlappingPairCache ( ) const
inlinevirtual

Implements btBroadphaseInterface.

Definition at line 166 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
const btOverlappingPairCallback* btAxisSweep3Internal< BP_FP_INT_TYPE >::getOverlappingPairUserCallback ( ) const
inline

Definition at line 175 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
virtual void btAxisSweep3Internal< BP_FP_INT_TYPE >::printStats ( )
inlinevirtual

Implements btBroadphaseInterface.

Definition at line 188 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::processAllOverlappingPairs ( btOverlapCallback callback)
template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::quantize ( BP_FP_INT_TYPE *  out,
const btVector3 point,
int  isMax 
) const

Definition at line 459 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::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 270 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::removeHandle ( BP_FP_INT_TYPE  handle,
btDispatcher dispatcher 
)

Definition at line 561 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::resetPool ( btDispatcher dispatcher)
virtual

reset broadphase internal structures, to ensure determinism/reproducability

Reimplemented from btBroadphaseInterface.

Definition at line 618 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::setAabb ( btBroadphaseProxy proxy,
const btVector3 aabbMin,
const btVector3 aabbMax,
btDispatcher dispatcher 
)
virtual

Implements btBroadphaseInterface.

Definition at line 258 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::setOverlappingPairUserCallback ( btOverlappingPairCallback pairCallback)
inline

Definition at line 171 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::sortMaxDown ( int  axis,
BP_FP_INT_TYPE  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
)
protected

Definition at line 915 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::sortMaxUp ( int  axis,
BP_FP_INT_TYPE  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
)
protected

Definition at line 978 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::sortMinDown ( int  axis,
BP_FP_INT_TYPE  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
)
protected

Definition at line 807 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::sortMinUp ( int  axis,
BP_FP_INT_TYPE  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
)
protected

Definition at line 859 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
bool btAxisSweep3Internal< BP_FP_INT_TYPE >::testAabbOverlap ( btBroadphaseProxy proxy0,
btBroadphaseProxy proxy1 
)

Definition at line 722 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
bool btAxisSweep3Internal< BP_FP_INT_TYPE >::testOverlap2D ( const Handle pHandleA,
const Handle pHandleB,
int  axis0,
int  axis1 
)
protected

Definition at line 741 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::unQuantize ( btBroadphaseProxy proxy,
btVector3 aabbMin,
btVector3 aabbMax 
) const

unQuantize should be conservative: aabbMin/aabbMax should be larger then 'getAabb' result

Definition at line 327 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void btAxisSweep3Internal< BP_FP_INT_TYPE >::updateHandle ( BP_FP_INT_TYPE  handle,
const btVector3 aabbMin,
const btVector3 aabbMax,
btDispatcher dispatcher 
)

Definition at line 756 of file btAxisSweep3.h.

Member Data Documentation

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::m_bpHandleMask
protected

Definition at line 40 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::m_firstFreeHandle
protected

Definition at line 83 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::m_handleSentinel
protected

Definition at line 41 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
int btAxisSweep3Internal< BP_FP_INT_TYPE >::m_invalidPair
protected

Definition at line 95 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::m_maxHandles
protected

Definition at line 80 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btOverlappingPairCache* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_nullPairCache
protected

Definition at line 100 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
BP_FP_INT_TYPE btAxisSweep3Internal< BP_FP_INT_TYPE >::m_numHandles
protected

Definition at line 79 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
bool btAxisSweep3Internal< BP_FP_INT_TYPE >::m_ownsPairCache
protected

Definition at line 93 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btOverlappingPairCache* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_pairCache
protected

Definition at line 88 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
Edge* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_pEdges[3]
protected

Definition at line 85 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
void* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_pEdgesRawPtr[3]
protected

Definition at line 86 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
Handle* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_pHandles
protected

Definition at line 81 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btVector3 btAxisSweep3Internal< BP_FP_INT_TYPE >::m_quantize
protected

Definition at line 77 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btDbvtBroadphase* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_raycastAccelerator
protected

additional dynamic aabb structure, used to accelerate ray cast queries.

can be disabled using a optional argument in the constructor

Definition at line 99 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btOverlappingPairCallback* btAxisSweep3Internal< BP_FP_INT_TYPE >::m_userPairCallback
protected

btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.

Definition at line 91 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btVector3 btAxisSweep3Internal< BP_FP_INT_TYPE >::m_worldAabbMax
protected

Definition at line 75 of file btAxisSweep3.h.

template<typename BP_FP_INT_TYPE>
btVector3 btAxisSweep3Internal< BP_FP_INT_TYPE >::m_worldAabbMin
protected

Definition at line 74 of file btAxisSweep3.h.


The documentation for this class was generated from the following file: