The bad news is that the performance seems to be a lot lower, as seen in this video:
https://www.youtube.com/watch?v=PiMK5A2 ... e=youtu.be
When I use
Code: Select all
btDispatcherInfo.m_enableSatConvex = true
Even 20 or so convex shapes brings my 240Hz sim to 2fps. This is on Debug build of Bullet3.
When not using SAT, I also see a slow down, but not as dramatic as the SAT case.
I read in the docs that the single contact was faster, but is a large spike like this expected?
Is there an O(N**2) or O(N**3) in there somewhere, maybe?
Linux perf shows that the cycles are burnt in PolyhedralContactClipping::findSeparatingAxis()
This is how I set up the world:
Code: Select all
// Build the broadphase
btBroadphaseInterface* broadphase = new btDbvtBroadphase();
// Set up the collision configuration and dispatcher
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
btCollisionDispatcher* dispatcher = new btCollisionDispatcher(collisionConfiguration);
// The actual physics solver
btSequentialImpulseConstraintSolver* solver = new btSequentialImpulseConstraintSolver;
//btSolveProjectedGaussSeidel* mlcp = new btSolveProjectedGaussSeidel;
//btMLCPSolver* solver = new btMLCPSolver( mlcp );
// The world.
world = new btDiscreteDynamicsWorld( dispatcher, broadphase, solver, collisionConfiguration );
world->setGravity( btVector3( 0,0,-9.8f ) );
#if 1
// Set this to have multiple contact points per convex shape.
btDispatcherInfo& di = world->getDispatchInfo();
di.m_enableSatConvex = true;
#endif
btContactSolverInfo& si = world->getSolverInfo();
si.m_numIterations = 20;
si.m_erp = 0.7f;
si.m_erp2 = si.m_erp / 2;
si.m_globalCfm = 0.05f;
//si.m_minimumSolverBatchSize = 1;
si.m_solverMode =
SOLVER_USE_WARMSTARTING |
SOLVER_SIMD |
SOLVER_RANDMIZE_ORDER;