I made a GFYCAT to demonstrate the issue: https://gfycat.com/GrandBetterCuscus - Hopefully you can see what I'm talking about, the ball will occasionally 'fly up' in to the air even though there is nothing (visible or invisible) to warrant that.
So of course here are some details about my simulation:
Ball
Shape type: btSphereShape
Radius: 4.0f
Mass: 1.0f
Restitution: 0.1f
CCD enabled (0.5f min speed, 0.04f radius)
Floors
Shape type: Mixed, but usually btBoxShape
Collision Flags: result->getCollisionFlags() | btCollisionObject::CF_KINEMATIC_OBJECT
Restitution: 1.0f
Mass: 1000.0f
World / Simulation
Gravity: [0.0f, -490.50f, 0.0f]
Internal tickrate: 1000.0f
I also tried messing with the "split impulse" options:
Code: Select all
btContactSolverInfo& contactSolver = dynamicsWorld->getSolverInfo();
contactSolver.m_numIterations = 750;
contactSolver.m_splitImpulse = 1;
contactSolver.m_splitImpulsePenetrationThreshold = -0.02f;
I *think* that making the difference in masses (1000.0f vs 1.0f) less huge makes a difference, but then the ball easily flies *through* some geometry, even with CCD enabled?
Really open to any and all ideas here, thank you all in advance. I will of course provide any extra information that you feel might be relevant.