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

@@ -27,6 +27,8 @@ subject to the following restrictions:
#include "ConstraintSolver/SequentialImpulseConstraintSolver.h"
#include "CollisionDispatch/CollisionDispatcher.h"
#include "BroadphaseCollision/SimpleBroadphase.h"
#include "BroadphaseCollision/AxisSweep3.h"
#include "CollisionShapes/TriangleMeshShape.h"
#include "CollisionShapes/TriangleIndexVertexArray.h"
#include "CollisionShapes/BvhTriangleMeshShape.h"
@@ -39,7 +41,7 @@ subject to the following restrictions:
#include "GlutStuff.h"
//The user defined collision algorithm
#include "SphereSphereCollisionAlgorithm.h"
#include "CollisionDispatch/SphereSphereCollisionAlgorithm.h"
GLDebugDrawer debugDrawer;
@@ -139,7 +141,8 @@ void UserCollisionAlgorithm::initPhysics()
CollisionDispatcher* dispatcher = new CollisionDispatcher();
OverlappingPairCache* broadphase = new SimpleBroadphase();
SimdVector3 maxAabb(10000,10000,10000);
OverlappingPairCache* broadphase = new AxisSweep3(-maxAabb,maxAabb);//SimpleBroadphase();
dispatcher->RegisterCollisionCreateFunc(SPHERE_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,new SphereSphereCollisionAlgorithm::CreateFunc);