more solver optimizations, can be disabled using solver->setSolverMode(SOLVER_RANDMIZE_ORDER)

This commit is contained in:
ejcoumans
2007-03-17 07:59:27 +00:00
parent 151cd4b9da
commit 2b87104184
9 changed files with 159 additions and 70 deletions

View File

@@ -252,6 +252,11 @@ void btAxisSweep3::removeHandle(BP_FP_INT_TYPE handle)
extern int gOverlappingPairs;
void btAxisSweep3::refreshOverlappingPairs()
{
}
void btAxisSweep3::processAllOverlappingPairs(btOverlapCallback* callback)
{
@@ -269,6 +274,8 @@ void btAxisSweep3::processAllOverlappingPairs(btOverlapCallback* callback)
m_overlappingPairArray.resize(m_overlappingPairArray.size() - m_invalidPair);
m_invalidPair = 0;
#endif
int i;
btBroadphasePair previousPair;

View File

@@ -112,10 +112,7 @@ public:
btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAabbMax, int maxHandles = 16384);
virtual ~btAxisSweep3();
virtual void refreshOverlappingPairs()
{
//this is performed incrementally by sweep and prune (add pair), and during pair traversal (remove pair)
}
virtual void refreshOverlappingPairs();
BP_FP_INT_TYPE addHandle(const btPoint3& aabbMin,const btPoint3& aabbMax, void* pOwner,short int collisionFilterGroup,short int collisionFilterMask);
void removeHandle(BP_FP_INT_TYPE handle);

View File

@@ -119,7 +119,7 @@ void btCollisionWorld::performDiscreteCollisionDetection()
{
btDispatcherInfo& dispatchInfo = getDispatchInfo();
BEGIN_PROFILE("performDiscreteCollisionDetection");
BEGIN_PROFILE("perform Broadphase Collision Detection");
//update aabb (of all moved objects)
@@ -133,6 +133,11 @@ void btCollisionWorld::performDiscreteCollisionDetection()
m_broadphasePairCache->refreshOverlappingPairs();
END_PROFILE("perform Broadphase Collision Detection");
BEGIN_PROFILE("performDiscreteCollisionDetection");
btDispatcher* dispatcher = getDispatcher();
if (dispatcher)
dispatcher->dispatchAllCollisionPairs(m_broadphasePairCache,dispatchInfo);