Fixing "Hopping" - Rolling Sphere Collision
Posted: Wed Feb 08, 2017 8:45 am
Hey guys, I'm having an issue where occasionally while rolling a ball along a surface, the ball "hops"/skips in to the air as though it's 'caught' on something invisible- even though the underlying surface is often a straight flat one.
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:
But it hasn't made any difference.
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.
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.