started working on some serious performance improvements. now the union find is optimized, the broadphase add/remove overlapping pair was too slow. added a stl::set to keep track of overlapping pairs. this speeds up the set find/remove. work in progress.the SimpleBroadphase is broken. will be fixed tomorrow.

Did some tests with 3000 rigidbodies, works much smoother now :)
This commit is contained in:
ejcoumans
2006-09-19 02:59:30 +00:00
parent d47d23ea74
commit 8c023e764c
21 changed files with 242 additions and 130 deletions

View File

@@ -48,7 +48,7 @@ subject to the following restrictions:
#include "IDebugDraw.h"
#include "GLDebugDrawer.h"
#include "CollisionDispatch/SphereSphereCollisionAlgorithm.h"
@@ -72,13 +72,13 @@ const int maxProxies = 32766;
const int maxOverlap = 65535;
bool createConstraint = true;//false;
bool useCompound = true;//false;
bool useCompound = false;//true;//false;
#ifdef _DEBUG
const int numObjects = 50;
const int numObjects = 250;
#else
const int numObjects = 120;
const int numObjects = 3250;
#endif
const int maxNumObjects = 32760;
@@ -255,6 +255,8 @@ void CcdPhysicsDemo::initPhysics()
SimdVector3 worldAabbMax(30000,30000,30000);
OverlappingPairCache* broadphase = new AxisSweep3(worldAabbMin,worldAabbMax,maxProxies,maxOverlap);
dispatcher->RegisterCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new SphereSphereCollisionAlgorithm::CreateFunc);
//OverlappingPairCache* broadphase = new SimpleBroadphase(maxProxies,maxOverlap);
#ifdef USE_PARALLEL_DISPATCHER