Advertisement

Repeated collisions at deltaTime=0, with gravity

Started by August 26, 2002 01:42 AM
0 comments, last by Orbusii 22 years, 5 months ago
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.
I think a common solution is to store a list of persisting contacts. You can then use impulses for collisions, but forces for contacts. This also saves you from re-detecting the collision every time.


"Math is hard" -Barbie
"Math is hard" -Barbie

This topic is closed to new replies.

Advertisement