Back to index

supertuxkart  0.5+dfsg1
Public Member Functions | Protected Member Functions | Protected Attributes
btAxisSweep3 Class Reference

btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats. For large worlds and many objects, use bt32BitAxisSweep3 instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance. More...

#include <btAxisSweep3.h>

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

List of all members.

Public Member Functions

 btAxisSweep3 (const btPoint3 &worldAabbMin, const btPoint3 &worldAabbMax, unsigned short int maxHandles=16384, btOverlappingPairCache *pairCache=0)
 ATTRIBUTE_ALIGNED16 (class) Handle
unsigned short int getNumHandles () const
virtual void calculateOverlappingPairs (btDispatcher *dispatcher)
 calculateOverlappingPairs is optional: incremental algorithms (sweep and prune) might do it during the set aabb
unsigned short int addHandle (const btPoint3 &aabbMin, const btPoint3 &aabbMax, void *pOwner, short int collisionFilterGroup, short int collisionFilterMask, btDispatcher *dispatcher, void *multiSapProxy)
void removeHandle (unsigned short inthandle, btDispatcher *dispatcher)
void updateHandle (unsigned short inthandle, const btPoint3 &aabbMin, const btPoint3 &aabbMax, btDispatcher *dispatcher)
SIMD_FORCE_INLINE Handle * getHandle (unsigned short intindex) const
void processAllOverlappingPairs (btOverlapCallback *callback)
virtual btBroadphaseProxy * createProxy (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)
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
virtual void printStats ()

Protected Member Functions

unsigned short int allocHandle ()
void freeHandle (unsigned short inthandle)
bool testOverlap (int ignoreAxis, const Handle *pHandleA, const Handle *pHandleB)
void quantize (unsigned short int *out, const btPoint3 &point, int isMax) const
void sortMinDown (int axis, unsigned short intedge, btDispatcher *dispatcher, bool updateOverlaps)
void sortMinUp (int axis, unsigned short intedge, btDispatcher *dispatcher, bool updateOverlaps)
void sortMaxDown (int axis, unsigned short intedge, btDispatcher *dispatcher, bool updateOverlaps)
void sortMaxUp (int axis, unsigned short intedge, btDispatcher *dispatcher, bool updateOverlaps)

Protected Attributes

unsigned short int m_bpHandleMask
unsigned short int m_handleSentinel
btPoint3 m_worldAabbMin
btPoint3 m_worldAabbMax
btVector3 m_quantize
unsigned short int m_numHandles
unsigned short int m_maxHandles
Handle * m_pHandles
unsigned short int m_firstFreeHandle
Edge * m_pEdges [3]
btOverlappingPairCachem_pairCache
btOverlappingPairCallbackm_userPairCallback
 btOverlappingPairCallback is an additional optional user callback for adding/removing overlapping pairs, similar interface to btOverlappingPairCache.
bool m_ownsPairCache
int m_invalidPair

Detailed Description

btAxisSweep3 is an efficient implementation of the 3d axis sweep and prune broadphase. It uses arrays rather then lists for storage of the 3 axis. Also it operates using 16 bit integer coordinates instead of floats. For large worlds and many objects, use bt32BitAxisSweep3 instead. bt32BitAxisSweep3 has higher precision and allows more then 16384 objects at the cost of more memory and bit of performance.

Definition at line 887 of file btAxisSweep3.h.


Constructor & Destructor Documentation

btAxisSweep3::btAxisSweep3 ( const btPoint3 worldAabbMin,
const btPoint3 worldAabbMax,
unsigned short int  maxHandles = 16384,
btOverlappingPairCache pairCache = 0 
)

Definition at line 24 of file btAxisSweep3.cpp.

:btAxisSweep3Internal<unsigned short int>(worldAabbMin,worldAabbMax,0xfffe,0xffff,maxHandles,pairCache)
{
       // 1 handle is reserved as sentinel
       btAssert(maxHandles > 1 && maxHandles < 32767);

}

Member Function Documentation

unsigned short int btAxisSweep3Internal< unsigned short int >::addHandle ( const btPoint3 aabbMin,
const btPoint3 aabbMax,
void *  pOwner,
short int  collisionFilterGroup,
short int  collisionFilterMask,
btDispatcher dispatcher,
void *  multiSapProxy 
) [inherited]
unsigned short int btAxisSweep3Internal< unsigned short int >::allocHandle ( ) [protected, inherited]
btAxisSweep3Internal< unsigned short int >::ATTRIBUTE_ALIGNED16 ( class  ) [inline, inherited]

Definition at line 54 of file btAxisSweep3.h.

                                         : public btBroadphaseProxy
       {
       public:
       BT_DECLARE_ALIGNED_ALLOCATOR();
       
              // indexes into the edge arrays
              BP_FP_INT_TYPE m_minEdges[3], m_maxEdges[3];            // 6 * 2 = 12
//            BP_FP_INT_TYPE m_uniqueId;
              BP_FP_INT_TYPE m_pad;
              
              //void* m_pOwner; this is now in btBroadphaseProxy.m_clientObject
       
              SIMD_FORCE_INLINE void SetNextFree(BP_FP_INT_TYPE next) {m_minEdges[0] = next;}
              SIMD_FORCE_INLINE BP_FP_INT_TYPE GetNextFree() const {return m_minEdges[0];}
       };            // 24 bytes + 24 for Edge structures = 44 bytes total per entry
virtual void btAxisSweep3Internal< unsigned short int >::calculateOverlappingPairs ( btDispatcher dispatcher) [virtual, inherited]

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

Implements btBroadphaseInterface.

virtual btBroadphaseProxy* btAxisSweep3Internal< unsigned short int >::createProxy ( const btVector3 aabbMin,
const btVector3 aabbMax,
int  shapeType,
void *  userPtr,
short int  collisionFilterGroup,
short int  collisionFilterMask,
btDispatcher dispatcher,
void *  multiSapProxy 
) [virtual, inherited]

Implements btBroadphaseInterface.

virtual void btAxisSweep3Internal< unsigned short int >::destroyProxy ( btBroadphaseProxy *  proxy,
btDispatcher dispatcher 
) [virtual, inherited]

Implements btBroadphaseInterface.

void btAxisSweep3Internal< unsigned short int >::freeHandle ( unsigned short int  handle) [protected, inherited]
virtual void btAxisSweep3Internal< unsigned short int >::getBroadphaseAabb ( btVector3 aabbMin,
btVector3 aabbMax 
) const [inline, virtual, inherited]

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

Implements btBroadphaseInterface.

Definition at line 161 of file btAxisSweep3.h.

       {
              aabbMin = m_worldAabbMin;
              aabbMax = m_worldAabbMax;
       }
SIMD_FORCE_INLINE Handle* btAxisSweep3Internal< unsigned short int >::getHandle ( unsigned short int  index) const [inline, inherited]

Definition at line 130 of file btAxisSweep3.h.

{return m_pHandles + index;}
unsigned short int btAxisSweep3Internal< unsigned short int >::getNumHandles ( ) const [inline, inherited]

Definition at line 120 of file btAxisSweep3.h.

       {
              return m_numHandles;
       }
btOverlappingPairCache* btAxisSweep3Internal< unsigned short int >::getOverlappingPairCache ( ) [inline, virtual, inherited]

Implements btBroadphaseInterface.

Definition at line 141 of file btAxisSweep3.h.

       {
              return m_pairCache;
       }
const btOverlappingPairCache* btAxisSweep3Internal< unsigned short int >::getOverlappingPairCache ( ) const [inline, virtual, inherited]

Implements btBroadphaseInterface.

Definition at line 145 of file btAxisSweep3.h.

       {
              return m_pairCache;
       }
const btOverlappingPairCallback* btAxisSweep3Internal< unsigned short int >::getOverlappingPairUserCallback ( ) const [inline, inherited]

Definition at line 154 of file btAxisSweep3.h.

       {
              return m_userPairCallback;
       }
virtual void btAxisSweep3Internal< unsigned short int >::printStats ( ) [inline, virtual, inherited]

Implements btBroadphaseInterface.

Definition at line 167 of file btAxisSweep3.h.

       {
/*            printf("btAxisSweep3.h\n");
              printf("numHandles = %d, maxHandles = %d\n",m_numHandles,m_maxHandles);
              printf("aabbMin=%f,%f,%f,aabbMax=%f,%f,%f\n",m_worldAabbMin.getX(),m_worldAabbMin.getY(),m_worldAabbMin.getZ(),
                     m_worldAabbMax.getX(),m_worldAabbMax.getY(),m_worldAabbMax.getZ());
                     */

       }
void btAxisSweep3Internal< unsigned short int >::processAllOverlappingPairs ( btOverlapCallback callback) [inherited]
void btAxisSweep3Internal< unsigned short int >::quantize ( unsigned short int *  out,
const btPoint3 point,
int  isMax 
) const [protected, inherited]
void btAxisSweep3Internal< unsigned short int >::removeHandle ( unsigned short int  handle,
btDispatcher dispatcher 
) [inherited]
virtual void btAxisSweep3Internal< unsigned short int >::setAabb ( btBroadphaseProxy *  proxy,
const btVector3 aabbMin,
const btVector3 aabbMax,
btDispatcher dispatcher 
) [virtual, inherited]

Implements btBroadphaseInterface.

void btAxisSweep3Internal< unsigned short int >::setOverlappingPairUserCallback ( btOverlappingPairCallback pairCallback) [inline, inherited]

Definition at line 150 of file btAxisSweep3.h.

       {
              m_userPairCallback = pairCallback;
       }
void btAxisSweep3Internal< unsigned short int >::sortMaxDown ( int  axis,
unsigned short int  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
) [protected, inherited]
void btAxisSweep3Internal< unsigned short int >::sortMaxUp ( int  axis,
unsigned short int  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
) [protected, inherited]
void btAxisSweep3Internal< unsigned short int >::sortMinDown ( int  axis,
unsigned short int  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
) [protected, inherited]
void btAxisSweep3Internal< unsigned short int >::sortMinUp ( int  axis,
unsigned short int  edge,
btDispatcher dispatcher,
bool  updateOverlaps 
) [protected, inherited]
bool btAxisSweep3Internal< unsigned short int >::testAabbOverlap ( btBroadphaseProxy *  proxy0,
btBroadphaseProxy *  proxy1 
) [inherited]
bool btAxisSweep3Internal< unsigned short int >::testOverlap ( int  ignoreAxis,
const Handle *  pHandleA,
const Handle *  pHandleB 
) [protected, inherited]
void btAxisSweep3Internal< unsigned short int >::updateHandle ( unsigned short int  handle,
const btPoint3 aabbMin,
const btPoint3 aabbMax,
btDispatcher dispatcher 
) [inherited]

Member Data Documentation

unsigned short int btAxisSweep3Internal< unsigned short int >::m_bpHandleMask [protected, inherited]

Definition at line 38 of file btAxisSweep3.h.

unsigned short int btAxisSweep3Internal< unsigned short int >::m_firstFreeHandle [protected, inherited]

Definition at line 80 of file btAxisSweep3.h.

unsigned short int btAxisSweep3Internal< unsigned short int >::m_handleSentinel [protected, inherited]

Definition at line 39 of file btAxisSweep3.h.

int btAxisSweep3Internal< unsigned short int >::m_invalidPair [protected, inherited]

Definition at line 91 of file btAxisSweep3.h.

unsigned short int btAxisSweep3Internal< unsigned short int >::m_maxHandles [protected, inherited]

Definition at line 78 of file btAxisSweep3.h.

unsigned short int btAxisSweep3Internal< unsigned short int >::m_numHandles [protected, inherited]

Definition at line 77 of file btAxisSweep3.h.

bool btAxisSweep3Internal< unsigned short int >::m_ownsPairCache [protected, inherited]

Definition at line 89 of file btAxisSweep3.h.

btOverlappingPairCache* btAxisSweep3Internal< unsigned short int >::m_pairCache [protected, inherited]

Definition at line 84 of file btAxisSweep3.h.

Edge* btAxisSweep3Internal< unsigned short int >::m_pEdges[3] [protected, inherited]

Definition at line 82 of file btAxisSweep3.h.

Handle* btAxisSweep3Internal< unsigned short int >::m_pHandles [protected, inherited]

Definition at line 79 of file btAxisSweep3.h.

btVector3 btAxisSweep3Internal< unsigned short int >::m_quantize [protected, inherited]

Definition at line 75 of file btAxisSweep3.h.

btOverlappingPairCallback* btAxisSweep3Internal< unsigned short int >::m_userPairCallback [protected, inherited]

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

Definition at line 87 of file btAxisSweep3.h.

btPoint3 btAxisSweep3Internal< unsigned short int >::m_worldAabbMax [protected, inherited]

Definition at line 73 of file btAxisSweep3.h.

btPoint3 btAxisSweep3Internal< unsigned short int >::m_worldAabbMin [protected, inherited]

Definition at line 68 of file btAxisSweep3.h.


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