Refactoring to enable multi SAP broadphase.

This was already planned, and Pierre Terdiman recent thread motivated me to decouple the paircache from the sweep and prune.
http://continuousphysics.com/Bullet/phpBB2/viewtopic.php?t=1329
This commit is contained in:
ejcoumans
2007-08-02 23:48:46 +00:00
parent 5279f9e129
commit 1f7646f72a
29 changed files with 212 additions and 85 deletions

View File

@@ -38,7 +38,7 @@ struct btSimpleBroadphaseProxy : public btBroadphaseProxy
};
///SimpleBroadphase is a brute force aabb culling broadphase based on O(n^2) aabb checks
class btSimpleBroadphase : public btOverlappingPairCache
class btSimpleBroadphase : public btBroadphaseInterface
{
protected:
@@ -50,7 +50,9 @@ protected:
btSimpleBroadphaseProxy** m_pProxies;
int m_numProxies;
btOverlappingPairCache* m_pairCache;
int m_invalidPair;
int m_maxProxies;
@@ -67,7 +69,8 @@ protected:
protected:
virtual void refreshOverlappingPairs();
virtual void calculateOverlappingPairs();
public:
btSimpleBroadphase(int maxProxies=16384);
virtual ~btSimpleBroadphase();
@@ -82,9 +85,16 @@ public:
virtual void destroyProxy(btBroadphaseProxy* proxy);
virtual void setAabb(btBroadphaseProxy* proxy,const btVector3& aabbMin,const btVector3& aabbMax);
btOverlappingPairCache* getOverlappingPairCache()
{
return m_pairCache;
}
const btOverlappingPairCache* getOverlappingPairCache() const
{
return m_pairCache;
}
bool testAabbOverlap(btBroadphaseProxy* proxy0,btBroadphaseProxy* proxy1);
};