16 #ifndef BT_OVERLAPPING_PAIR_CACHE_H
17 #define BT_OVERLAPPING_PAIR_CACHE_H
219 int key =
static_cast<int>(((
unsigned int)proxyId1) | (((
unsigned int)proxyId2) <<16));
228 return static_cast<unsigned int>(key);
237 int proxyId1 = proxy0->
getUid();
238 int proxyId2 = proxy1->
getUid();
239 #if 0 // wrong, 'equalsPair' use unsorted uids, copy-past devil striked again. Nat.
240 if (proxyId1 > proxyId2)
241 btSwap(proxyId1, proxyId2);
468 #endif //BT_OVERLAPPING_PAIR_CACHE_H
virtual bool hasDeferredRemoval()
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *dispatcher)
const btBroadphasePair * getOverlappingPairArrayPtr() const
virtual void cleanOverlappingPair(btBroadphasePair &pair, btDispatcher *dispatcher)=0
btOverlapFilterCallback * getOverlapFilterCallback()
bool needsBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
btOverlapFilterCallback * m_overlapFilterCallback
virtual bool hasDeferredRemoval()=0
btNullPairCache skips add/removal of overlapping pairs. Userful for benchmarking and unit testing...
short int m_collisionFilterGroup
btBroadphasePair * internalFindPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1, int hash)
virtual void sortOverlappingPairs(btDispatcher *dispatcher)=0
int getNumOverlappingPairs() const
btAlignedObjectArray< int > m_hashTable
virtual bool hasDeferredRemoval()
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *ghostPairCallback)=0
btBroadphasePairArray & getOverlappingPairArray()
btOverlappingPairCallback * m_ghostPairCallback
virtual void setOverlapFilterCallback(btOverlapFilterCallback *callback)=0
#define SIMD_FORCE_INLINE
btBroadphasePairArray m_overlappingPairArray
bool equalsPair(const btBroadphasePair &pair, int proxyId1, int proxyId2)
bool needsBroadphaseCollision(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1) const
btOverlappingPairCallback * m_ghostPairCallback
btOverlapFilterCallback * m_overlapFilterCallback
void cleanProxyFromPairs(btBroadphaseProxy *proxy, btDispatcher *dispatcher)
virtual void cleanProxyFromPairs(btBroadphaseProxy *, btDispatcher *)
const btBroadphasePair * getOverlappingPairArrayPtr() const
virtual btBroadphasePair * getOverlappingPairArrayPtr()
void setOverlapFilterCallback(btOverlapFilterCallback *callback)
virtual btBroadphasePair * getOverlappingPairArrayPtr()
const btBroadphasePairArray & getOverlappingPairArray() const
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *)
The btOverlappingPairCache provides an interface for overlapping pair management (add, remove, storage), used by the btBroadphaseInterface broadphases.
virtual void sortOverlappingPairs(btDispatcher *dispatcher)
virtual bool hasDeferredRemoval()
unsigned int getHash(unsigned int proxyId1, unsigned int proxyId2)
virtual int getNumOverlappingPairs() const
int size() const
return the number of elements in the array
virtual ~btOverlapCallback()
btHashedOverlappingPairCache()
btBroadphasePairArray & getOverlappingPairArray()
btBroadphasePair * internalAddPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
virtual btBroadphasePairArray & getOverlappingPairArray()=0
virtual ~btOverlapFilterCallback()
virtual btBroadphasePair * findPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)=0
btOverlapFilterCallback * getOverlapFilterCallback()
void cleanOverlappingPair(btBroadphasePair &pair, btDispatcher *dispatcher)
virtual void cleanProxyFromPairs(btBroadphaseProxy *proxy, btDispatcher *dispatcher)=0
int getNumOverlappingPairs() const
btBroadphasePair * addOverlappingPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
btBroadphasePair * findPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
virtual void removeOverlappingPairsContainingProxy(btBroadphaseProxy *, btDispatcher *)
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
void * removeOverlappingPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1, btDispatcher *dispatcher)
btAlignedObjectArray< int > m_next
virtual int getNumOverlappingPairs() const =0
btSortedOverlappingPairCache()
virtual ~btOverlappingPairCache()
The btBroadphaseProxy is the main class that can be used with the Bullet broadphases.
btBroadphaseProxy * m_pProxy1
virtual void * removeOverlappingPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1, btDispatcher *dispatcher)
btBroadphasePairArray m_overlappingPairArray
btBroadphaseProxy * m_pProxy0
virtual void sortOverlappingPairs(btDispatcher *dispatcher)
virtual void cleanOverlappingPair(btBroadphasePair &, btDispatcher *)
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *ghostPairCallback)
btAlignedObjectArray< btBroadphasePair > btBroadphasePairArray
const btBroadphasePairArray & getOverlappingPairArray() const
void removeOverlappingPairsContainingProxy(btBroadphaseProxy *proxy, btDispatcher *dispatcher)
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *)
virtual void setOverlapFilterCallback(btOverlapFilterCallback *)
virtual void setInternalGhostPairCallback(btOverlappingPairCallback *ghostPairCallback)
btBroadphasePairArray m_overlappingPairArray
bool m_hasDeferredRemoval
by default, do the removal during the pair traversal
short int m_collisionFilterMask
const btBroadphasePair * getOverlappingPairArrayPtr() const
virtual void sortOverlappingPairs(btDispatcher *dispatcher)
virtual btBroadphasePair * addOverlappingPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *dispatcher)
virtual ~btSortedOverlappingPairCache()
void cleanProxyFromPairs(btBroadphaseProxy *proxy, btDispatcher *dispatcher)
virtual btBroadphasePair * findPair(btBroadphaseProxy *, btBroadphaseProxy *)
btBroadphasePairArray & getOverlappingPairArray()
virtual btBroadphasePair * getOverlappingPairArrayPtr()=0
The btDispatcher interface class can be used in combination with broadphase to dispatch calculations ...
virtual void processAllOverlappingPairs(btOverlapCallback *, btDispatcher *dispatcher)=0
btBroadphasePair * findPair(btBroadphaseProxy *proxy0, btBroadphaseProxy *proxy1)
this findPair becomes really slow.
void removeOverlappingPairsContainingProxy(btBroadphaseProxy *proxy, btDispatcher *dispatcher)
void cleanOverlappingPair(btBroadphasePair &pair, btDispatcher *dispatcher)
Hash-space based Pair Cache, thanks to Erin Catto, Box2D, http://www.box2d.org, and Pierre Terdiman...
virtual void * removeOverlappingPair(btBroadphaseProxy *, btBroadphaseProxy *, btDispatcher *)
virtual ~btHashedOverlappingPairCache()
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()