
Repeated collisions at deltaTime=0, with gravity
This one''s really throwing me. In my collision detection and response loop I''m handling spheres bonking into planes. This is done by solving for the earliest collision time and running the simulation up to that point, before recursing to finish the time step. When there is contact, the sphere''s velocity is updated to slide along the plane. Gravity is added in this direction as well.
The problem is that since the sphere is now in contact and sliding along the plane, it collides on the next time through the loop at deltaTime=0. If I ignore collisions at dt=0, then gravity will be added on this iteration and the sphere will wind up falling through the plane. Or if I handle the collision by dropping the perpendicular component of gravity, then it just recurses again with no time passed, and loops forever with dt=0.
Any solution at all would be great. Maybe I should just add gravity on the first call to my function? But, then, there might be contact at t=0 the first time through, so I don''t know how to handle that. Going batty over this.

This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement