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 <btAxisSweep3Internal.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, int collisionFilterGroup, int collisionFilterMask, btDispatcher *dispatcher)
 
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, 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 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 ()
 
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
 

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 btAxisSweep3Internal.h.

Constructor & Destructor Documentation

◆ btAxisSweep3Internal()

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 331 of file btAxisSweep3Internal.h.

◆ ~btAxisSweep3Internal()

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

Definition at line 412 of file btAxisSweep3Internal.h.

Member Function Documentation

◆ aabbTest()

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 275 of file btAxisSweep3Internal.h.

◆ addHandle()

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

Definition at line 480 of file btAxisSweep3Internal.h.

◆ allocHandle()

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

Definition at line 457 of file btAxisSweep3Internal.h.

◆ BT_DECLARE_ALIGNED_ALLOCATOR()

template<typename BP_FP_INT_TYPE >
btAxisSweep3Internal< BP_FP_INT_TYPE >::BT_DECLARE_ALIGNED_ALLOCATOR ( )

◆ calculateOverlappingPairs()

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 595 of file btAxisSweep3Internal.h.

◆ createProxy()

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

Implements btBroadphaseInterface.

Definition at line 217 of file btAxisSweep3Internal.h.

◆ destroyProxy()

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

Implements btBroadphaseInterface.

Definition at line 233 of file btAxisSweep3Internal.h.

◆ freeHandle()

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

Definition at line 469 of file btAxisSweep3Internal.h.

◆ getAabb()

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 301 of file btAxisSweep3Internal.h.

◆ getBroadphaseAabb()

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 173 of file btAxisSweep3Internal.h.

◆ getHandle()

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

Definition at line 132 of file btAxisSweep3Internal.h.

◆ getNumHandles()

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

Definition at line 122 of file btAxisSweep3Internal.h.

◆ getOverlappingPairCache() [1/2]

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

Implements btBroadphaseInterface.

Definition at line 153 of file btAxisSweep3Internal.h.

◆ getOverlappingPairCache() [2/2]

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

Implements btBroadphaseInterface.

Definition at line 157 of file btAxisSweep3Internal.h.

◆ getOverlappingPairUserCallback()

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

Definition at line 166 of file btAxisSweep3Internal.h.

◆ printStats()

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

Implements btBroadphaseInterface.

Definition at line 179 of file btAxisSweep3Internal.h.

◆ processAllOverlappingPairs()

template<typename BP_FP_INT_TYPE >
void btAxisSweep3Internal< BP_FP_INT_TYPE >::processAllOverlappingPairs ( btOverlapCallback callback)

◆ quantize()

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 436 of file btAxisSweep3Internal.h.

◆ rayTest()

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 253 of file btAxisSweep3Internal.h.

◆ removeHandle()

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

Definition at line 530 of file btAxisSweep3Internal.h.

◆ resetPool()

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 579 of file btAxisSweep3Internal.h.

◆ setAabb()

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 242 of file btAxisSweep3Internal.h.

◆ setOverlappingPairUserCallback()

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

Definition at line 162 of file btAxisSweep3Internal.h.

◆ sortMaxDown()

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 853 of file btAxisSweep3Internal.h.

◆ sortMaxUp()

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 910 of file btAxisSweep3Internal.h.

◆ sortMinDown()

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 754 of file btAxisSweep3Internal.h.

◆ sortMinUp()

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 803 of file btAxisSweep3Internal.h.

◆ testAabbOverlap()

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

Definition at line 674 of file btAxisSweep3Internal.h.

◆ testOverlap2D()

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 693 of file btAxisSweep3Internal.h.

◆ unQuantize()

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 309 of file btAxisSweep3Internal.h.

◆ updateHandle()

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 708 of file btAxisSweep3Internal.h.

Member Data Documentation

◆ m_bpHandleMask

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

Definition at line 39 of file btAxisSweep3Internal.h.

◆ m_firstFreeHandle

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

Definition at line 80 of file btAxisSweep3Internal.h.

◆ m_handleSentinel

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

Definition at line 40 of file btAxisSweep3Internal.h.

◆ m_invalidPair

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

Definition at line 92 of file btAxisSweep3Internal.h.

◆ m_maxHandles

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

Definition at line 77 of file btAxisSweep3Internal.h.

◆ m_nullPairCache

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

Definition at line 97 of file btAxisSweep3Internal.h.

◆ m_numHandles

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

Definition at line 76 of file btAxisSweep3Internal.h.

◆ m_ownsPairCache

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

Definition at line 90 of file btAxisSweep3Internal.h.

◆ m_pairCache

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

Definition at line 85 of file btAxisSweep3Internal.h.

◆ m_pEdges

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

Definition at line 82 of file btAxisSweep3Internal.h.

◆ m_pEdgesRawPtr

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

Definition at line 83 of file btAxisSweep3Internal.h.

◆ m_pHandles

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

Definition at line 78 of file btAxisSweep3Internal.h.

◆ m_quantize

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

Definition at line 74 of file btAxisSweep3Internal.h.

◆ m_raycastAccelerator

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 96 of file btAxisSweep3Internal.h.

◆ m_userPairCallback

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 88 of file btAxisSweep3Internal.h.

◆ m_worldAabbMax

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

Definition at line 72 of file btAxisSweep3Internal.h.

◆ m_worldAabbMin

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

Definition at line 71 of file btAxisSweep3Internal.h.


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