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

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

## 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 on other sites
Have a look at Erin Catto's demo/info.

Two 3D implementations are:

Bullet and my Jiglib.

Both are pretty easy to understand if you step through with a debugger.

##### 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 on other sites
"Impulse based Stacking for Non-convex Rigid Bodies" (search google)

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

##### 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.

1. 1
2. 2
Rutin
30
3. 3
4. 4
5. 5
khawk
14

• 11
• 11
• 23
• 10
• 9
• ### Forum Statistics

• Total Topics
633647
• Total Posts
3013108
×