Jump to content
  • Advertisement
Sign in to follow this  
xissburg

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

This topic is 4144 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
Advertisement
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
"Impulse based Stacking for Non-convex Rigid Bodies" (search google)

http://www.ngaloppo.org/courses/comp259/pulsk/

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!