16 #ifndef BT_OVERLAPPING_PAIR_CACHE_H    17 #define BT_OVERLAPPING_PAIR_CACHE_H    73         virtual int getNumOverlappingPairs() 
const = 0;
    83         virtual bool    hasDeferredRemoval() = 0;
    87         virtual void    sortOverlappingPairs(
btDispatcher* dispatcher) = 0;
   119                 if (m_overlapFilterCallback)
   134                 if (!needsBroadphaseCollision(proxy0,proxy1))
   137                 return internalAddPair(proxy0,proxy1);
   149                 return &m_overlappingPairArray[0];
   154                 return &m_overlappingPairArray[0];
   159                 return m_overlappingPairArray;
   164                 return m_overlappingPairArray;
   178                 return m_overlapFilterCallback;
   183                 m_overlapFilterCallback = callback;
   188                 return m_overlappingPairArray.
size();
   221                 int key = 
static_cast<int>(((
unsigned int)proxyId1) | (((
unsigned int)proxyId2) <<16));
   230                 return static_cast<unsigned int>(key);
   239                 int proxyId1 = proxy0->
getUid();
   240                 int proxyId2 = proxy1->
getUid();
   241                 #if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.   242                 if (proxyId1 > proxyId2) 
   243                         btSwap(proxyId1, proxyId2);
   246                 int index = m_hashTable[hash];
   248                 while( index != 
BT_NULL_PAIR && equalsPair(m_overlappingPairArray[index], proxyId1, proxyId2) == 
false)
   250                         index = m_next[index];
   260                 return &m_overlappingPairArray[index];
   270                 m_ghostPairCallback = ghostPairCallback;
   273         virtual void    sortOverlappingPairs(
btDispatcher* dispatcher);
   324                         if (m_overlapFilterCallback)
   335                         return m_overlappingPairArray;
   340                         return m_overlappingPairArray;
   348                         return &m_overlappingPairArray[0];
   353                         return &m_overlappingPairArray[0];
   358                         return m_overlappingPairArray.
size();
   363                         return m_overlapFilterCallback;
   368                         m_overlapFilterCallback = callback;
   373                         return m_hasDeferredRemoval;
   378                         m_ghostPairCallback = ghostPairCallback;
   381                 virtual void    sortOverlappingPairs(
btDispatcher* dispatcher);
   398                 return &m_overlappingPairArray[0];
   402                 return &m_overlappingPairArray[0];
   406                 return m_overlappingPairArray;
   470 #endif //BT_OVERLAPPING_PAIR_CACHE_H virtual bool hasDeferredRemoval()
btOverlapFilterCallback * getOverlapFilterCallback()
int getNumOverlappingPairs() const
int getNumOverlappingPairs() const
btOverlapFilterCallback * m_overlapFilterCallback
btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing...
btBroadphasePair * internalFindPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1, int hash)
virtual int getNumOverlappingPairs() const
btAlignedObjectArray< int > m_hashTable
virtual bool hasDeferredRemoval()
btBroadphasePairArray & getOverlappingPairArray()
btOverlappingPairCallback * m_ghostPairCallback
#define SIMD_FORCE_INLINE
btBroadphasePairArray m_overlappingPairArray
bool equalsPair(const btBroadphasePair &pair, int proxyId1, int proxyId2)
const btBroadphasePair * getOverlappingPairArrayPtr() const
const btBroadphasePairArray & getOverlappingPairArray() const
btOverlappingPairCallback * m_ghostPairCallback
btOverlapFilterCallback * m_overlapFilterCallback
bool needsBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
virtual void cleanProxyFromPairs(btBroadphaseProxy *, btDispatcher *)
virtual btBroadphasePair * getOverlappingPairArrayPtr()
void setOverlapFilterCallback(btOverlapFilterCallback *callback)
virtual btBroadphasePair * getOverlappingPairArrayPtr()
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *)
The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases. 
virtual bool hasDeferredRemoval()
int m_collisionFilterMask
unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
virtual ~btOverlapCallback()
const btBroadphasePair * getOverlappingPairArrayPtr() const
btBroadphasePairArray & getOverlappingPairArray()
virtual ~btOverlapFilterCallback()
btOverlapFilterCallback * getOverlapFilterCallback()
bool needsBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
virtual void removeOverlappingPairsContainingProxy(btBroadphaseProxy *, btDispatcher *)
const btBroadphasePairArray & getOverlappingPairArray() const
int m_collisionFilterGroup
btSortedOverlappingPairCache maintains the objects with overlapping AABB Typically managed by the Bro...
void setOverlapFilterCallback(btOverlapFilterCallback *callback)
virtual bool needBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const =0
virtual bool processOverlap(btBroadphasePair &pair)=0
btAlignedObjectArray< int > m_next
virtual ~btOverlappingPairCache()
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases. 
btBroadphaseProxy * m_pProxy1
#define ATTRIBUTE_ALIGNED16(a)
const btBroadphasePair * getOverlappingPairArrayPtr() const
int size() const
return the number of elements in the array 
btBroadphasePairArray m_overlappingPairArray
btBroadphaseProxy * m_pProxy0
virtual void cleanOverlappingPair(btBroadphasePair &, btDispatcher *)
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *ghostPairCallback)
btAlignedObjectArray< btBroadphasePair > btBroadphasePairArray
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *)
#define BT_DECLARE_ALIGNED_ALLOCATOR()
virtual void setOverlapFilterCallback(btOverlapFilterCallback *)
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *ghostPairCallback)
btBroadphasePairArray m_overlappingPairArray
bool m_hasDeferredRemoval
by default, do the removal during the pair traversal 
virtual void sortOverlappingPairs(btDispatcher *dispatcher)
virtual btBroadphasePair * addOverlappingPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
virtual btBroadphasePair * findPair(btBroadphaseProxy *, btBroadphaseProxy *)
btBroadphasePairArray & getOverlappingPairArray()
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman...
virtual void * removeOverlappingPair(btBroadphaseProxy *, btBroadphaseProxy *, btDispatcher *)
The btOverlappingPairCallback class is an additional optional broadphase user callback for adding/rem...
virtual btBroadphasePair * addOverlappingPair(btBroadphaseProxy *, btBroadphaseProxy *)
The btBroadphasePair class contains a pair of aabb-overlapping objects. 
btBroadphasePair * getOverlappingPairArrayPtr()