fairly large refactoring of dispatcher/simulation island management, to allow for parallel simulation.
This commit is contained in:
@@ -18,7 +18,7 @@ subject to the following restrictions:
|
||||
|
||||
#include "BroadphaseCollision/Dispatcher.h"
|
||||
#include "NarrowPhaseCollision/PersistentManifold.h"
|
||||
#include "CollisionDispatch/UnionFind.h"
|
||||
|
||||
#include "CollisionDispatch/ManifoldResult.h"
|
||||
|
||||
#include "BroadphaseCollision/BroadphaseProxy.h"
|
||||
@@ -40,7 +40,7 @@ class CollisionDispatcher : public Dispatcher
|
||||
|
||||
std::vector<PersistentManifold*> m_manifoldsPtr;
|
||||
|
||||
UnionFind m_unionFind;
|
||||
|
||||
|
||||
bool m_useIslands;
|
||||
|
||||
@@ -50,14 +50,9 @@ class CollisionDispatcher : public Dispatcher
|
||||
|
||||
public:
|
||||
|
||||
UnionFind& GetUnionFind() { return m_unionFind;}
|
||||
|
||||
|
||||
struct IslandCallback
|
||||
{
|
||||
virtual ~IslandCallback() {};
|
||||
|
||||
virtual void ProcessIsland(PersistentManifold** manifolds,int numManifolds) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
||||
int GetNumManifolds() const
|
||||
@@ -75,14 +70,6 @@ public:
|
||||
return m_manifoldsPtr[index];
|
||||
}
|
||||
|
||||
void InitUnionFind(int n)
|
||||
{
|
||||
if (m_useIslands)
|
||||
m_unionFind.reset(n);
|
||||
}
|
||||
|
||||
void FindUnions();
|
||||
|
||||
int m_count;
|
||||
|
||||
CollisionDispatcher ();
|
||||
@@ -93,8 +80,6 @@ public:
|
||||
virtual void ReleaseManifold(PersistentManifold* manifold);
|
||||
|
||||
|
||||
virtual void BuildAndProcessIslands(CollisionObjectArray& collisionObjects, IslandCallback* callback);
|
||||
|
||||
///allows the user to get contact point callbacks
|
||||
virtual ManifoldResult* GetNewManifoldResult(CollisionObject* obj0,CollisionObject* obj1,PersistentManifold* manifold);
|
||||
|
||||
@@ -120,6 +105,8 @@ public:
|
||||
|
||||
virtual void DispatchAllCollisionPairs(OverlappingPairCache* pairCache,DispatcherInfo& dispatchInfo);
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
#endif //COLLISION__DISPATCHER_H
|
||||
|
||||
Reference in New Issue
Block a user