Archived

This topic is now archived and is closed to further replies.

Repeated collisions at deltaTime=0, with gravity

This topic is 5592 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites