diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2006-12-04 18:48:32 +0300 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2006-12-04 18:48:32 +0300 |
commit | 1cef024780e7f810ced1492bc3f57c7cd41ee8d6 (patch) | |
tree | 2e93cd4e0c7a9b5e536dfe714a5306d6aa60f947 /extern/bullet2/src/BulletCollision/BroadphaseCollision | |
parent | d6e926589547ce2c5fadce92f0881a01fa4d882e (diff) |
update to latest Bullet 2.x sources. prepare to make near sensors much faster
Diffstat (limited to 'extern/bullet2/src/BulletCollision/BroadphaseCollision')
3 files changed, 12 insertions, 34 deletions
diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h index 3ad2467886b..b279022c802 100644 --- a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h +++ b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btBroadphaseProxy.h @@ -70,7 +70,8 @@ struct btBroadphaseProxy StaticFilter = 2, KinematicFilter = 4, DebrisFilter = 8, - AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter, + SensorTrigger = 16, + AllFilter = DefaultFilter | StaticFilter | KinematicFilter | DebrisFilter | SensorTrigger, }; //Usually the client btCollisionObject or Rigidbody class @@ -118,8 +119,7 @@ class btCollisionAlgorithm; struct btBroadphaseProxy; -//Increase SIMPLE_MAX_ALGORITHMS to allow multiple btDispatchers caching their own algorithms -#define SIMPLE_MAX_ALGORITHMS 1 + /// contains a pair of aabb-overlapping objects struct btBroadphasePair @@ -127,22 +127,16 @@ struct btBroadphasePair btBroadphasePair () : m_pProxy0(0), - m_pProxy1(0) + m_pProxy1(0), + m_algorithm(0) { - for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++) - { - m_algorithms[i] = 0; - } } btBroadphasePair(const btBroadphasePair& other) : m_pProxy0(other.m_pProxy0), - m_pProxy1(other.m_pProxy1) + m_pProxy1(other.m_pProxy1), + m_algorithm(other.m_algorithm) { - for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++) - { - m_algorithms[i] = other.m_algorithms[i]; - } } btBroadphasePair(btBroadphaseProxy& proxy0,btBroadphaseProxy& proxy1) { @@ -159,17 +153,14 @@ struct btBroadphasePair m_pProxy1 = &proxy0; } - for (int i=0;i<SIMPLE_MAX_ALGORITHMS;i++) - { - m_algorithms[i] = 0; - } + m_algorithm = 0; } btBroadphaseProxy* m_pProxy0; btBroadphaseProxy* m_pProxy1; - mutable btCollisionAlgorithm* m_algorithms[SIMPLE_MAX_ALGORITHMS]; + mutable btCollisionAlgorithm* m_algorithm; }; diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDispatcher.h b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDispatcher.h index 1a471398638..c7714f592c4 100644 --- a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDispatcher.h +++ b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btDispatcher.h @@ -22,11 +22,6 @@ class btRigidBody; class btCollisionObject; class btOverlappingPairCache; -enum btCollisionDispatcherId -{ - RIGIDBODY_DISPATCHER = 0, - USERCALLBACK_DISPATCHER -}; class btPersistentManifold; class btStackAlloc; @@ -74,11 +69,6 @@ public: virtual btCollisionAlgorithm* findAlgorithm(btCollisionObject* body0,btCollisionObject* body1,btPersistentManifold* sharedManifold=0) = 0; - // - // asume dispatchers to have unique id's in the range [0..max dispacher] - // - virtual int getUniqueId() = 0; - virtual btPersistentManifold* getNewManifold(void* body0,void* body1)=0; virtual void releaseManifold(btPersistentManifold* manifold)=0; diff --git a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp index 8950d20f22e..5e3fa633589 100644 --- a/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp +++ b/extern/bullet2/src/BulletCollision/BroadphaseCollision/btOverlappingPairCache.cpp @@ -54,14 +54,11 @@ void btOverlappingPairCache::removeOverlappingPair(btBroadphasePair& findPair) void btOverlappingPairCache::cleanOverlappingPair(btBroadphasePair& pair) { - for (int dispatcherId=0;dispatcherId<SIMPLE_MAX_ALGORITHMS;dispatcherId++) + if (pair.m_algorithm) { - if (pair.m_algorithms[dispatcherId]) { - { - delete pair.m_algorithms[dispatcherId]; - pair.m_algorithms[dispatcherId]=0; - } + delete pair.m_algorithm;; + pair.m_algorithm=0; } } } |