support diamondsubdivision (thanks Jay for contribution)

support user-defined broadphase collision filtering (thanks Marten)
make sure btSimpeDynamicsWorld doesn't use cache friendly optimization in the solver (added an assert, and updated BasicDemo)
This commit is contained in:
ejcoumans
2007-06-29 22:13:15 +00:00
parent e33f5390dd
commit 5f8873c339
7 changed files with 72 additions and 32 deletions

View File

@@ -19,6 +19,7 @@ subject to the following restrictions:
//#define CHECK_MEMORY_LEAKS 1
//#define USE_PARALLEL_DISPATCHER 1
//#define USE_SIMPLE_DYNAMICS_WORLD 1
int gNumObjects = 120;
#define HALF_EXTENTS btScalar(1.)
@@ -150,11 +151,17 @@ void BasicDemo::initPhysics()
m_dispatcher->registerCollisionCreateFunc(BOX_SHAPE_PROXYTYPE,SPHERE_SHAPE_PROXYTYPE,m_boxSphereCF);
#endif //USE_PARALLEL_DISPATCHER
m_solver = new btSequentialImpulseConstraintSolver;
btSequentialImpulseConstraintSolver* sol = new btSequentialImpulseConstraintSolver;
m_solver = sol;
//m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
#ifdef USE_SIMPLE_DYNAMICS_WORLD
//btSimpleDynamicsWorld doesn't support 'cache friendly' optimization, so disable this
sol->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_RANDMIZE_ORDER);
m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
#else
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
#endif //USE_SIMPLE_DYNAMICS_WORLD
m_dynamicsWorld->getDispatchInfo().m_enableSPU = true;
m_dynamicsWorld->setGravity(btVector3(0,-10,0));