First off, I'm more-or-less completely new to Bullet, so bear with me if I'm making stupid mistakes
My physics setup is pretty simple; I'm constructing a btBvhTriangleMeshShape from a poly-model for my terrain, and am adding this to the physics world with zero mass, at the origin. I'm the spawning primitive cubes (btBoxShape) a small distance above the terrain, expecting them to fall onto it. I can also fire btSphereShapes at the terrain, from an elevated position. Nothing too complex, the poly counts are ridiculously low at present (well under a dozen for the terrain).
The problem I've got is that in *some* cases, I'm finding that objects pass straight through portions of my terrain. To be clear; all the primitives in the world are smaller than the individual polys of the terrain, yet there are some portions of some polys in the terrain that are consistently failing to collide. So it's not every poly that fails, and it's often only a part of the poly that fails to collide.
I've tried cranking up the simulation resolution, to no avail (well, it improved matters slightly, but not enough!). I'm presently running the sim with:
Code: Select all
double dt = clock.getTimeMilliseconds();
clock.reset();
dynamicsWorld->stepSimulation( dt * 0.001f, 100000000, btScalar(1.)/btScalar(600.) );
I've tried enabling CCD for the boxes, too, but that didn't seem to help at all...
Code: Select all
boxBody->setCcdMotionThreshold( boxSize );
boxBody->setCcdSweptSphereRadius( 0.2f * boxSize );
Anyway, I'd be hugely grateful if you can point me in the direction of my stupidity