Friction impulse. Need formula.

Started by
12 comments, last by Volgogradetzzz 13 years ago

Ok. I think I got it. Thank you.


Are you working in 3d, or 2d? 3d is slight more complex than 2d, but still doable :)

Cheers, Paul.
Advertisement
@ wildbunny: 2D.
Volgo, what formula did you end up using and how is it working out ? I'm thinking about adding friction to my 2D simulator as well.

Thanks.
According to Erin Catto presentation GDC2006 and as Bow_vernon said, for 2D friction can be count like this:
1. Get normal impulse - see post #8.
2. Get tangent impulse:
var jTnum:Number = -vab.dot(t);
var jTdenom:Number = bodyA.invMass + bodyB.invMass + rap.cross(t) * rap.cross(t) * bodyA.invInertia + rbp.cross(t) * rbp.cross(t) * bodyB.invInertia;
jT = jTnum / jTdenom;


3. You need to clamp friction impulse:

if(jT < -jN * cof || jT > jN * cof)
{
jT = jN * cof;
}


4. Get total impulse as:

j = n * jN + t * jT

This topic is closed to new replies.

Advertisement