Sign in to follow this  

How do you/would you implement a resting contact solving system

This topic is 3858 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

Thats the question. How do you/would you implement a resting contact system in your rigid bodies simulator?! Do you use any workaround? What is it? Does it work properly? I'm trying to implement it but I dont know what to do on situations like a stack of bricks. Any tutorial/paper suggestions are very appreciated :) thanks . . .

Share this post


Link to post
Share on other sites
Hey thank you MrRowl. I'll take a look at these engines and papers. And also thank you for the idea about the debug! Hey YOU thread reader, do you have 2 cents to give me?! Thanks

Share this post


Link to post
Share on other sites
I assume that when you say "resting" you also mean "sliding". I use a separation buffer with two terms, known as EPSILON and HALF_EPSILON. If two object boundaries are less than EPSILON apart, they are touching. If two objects collide, the returned time of collision is when they are HALF_EPSILON apart.

During the dynamic phase I use explicit solutions to solve for the time of collision. I scale the colliding object's motions back by the collision time and try again. I assume that within the span of a single frame, an object's motion is linear. If the nonlinearity of the object's motion is less than HALF_EPSILON away from the assumption that the object's motion is linear, then no problems will occur.

Then in the static phase, I check to see which object boundaries are separated by less than EPSILON, and I return the normal and position of the collision.


Now, for collision response, that's a tricky part that I've partially figured out at this point. Accumulate collision response impulses, apply, and then use forward position correction to ensure that objects don't interpenetrate. My collision detection routines completely break down if there is any interpenetration at all, so that's the disadvantage. The advantage is that I can track that objects are in sustained contact over time, and an object can rest on another object without any shaking. The intermediate "touching" separation distance is the useful concept here, since otherwise all you have is "not interpenetrating" and "interpenetrating", which is not enough information for good resting contact solutions.

Share this post


Link to post
Share on other sites

This topic is 3858 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this