Advertisement

Question about normal and tangent collision impulses

Started by July 16, 2015 05:11 PM
7 comments, last by Irlan Robson 9 years, 6 months ago

So I have separate equations that reliably give the normal collision impulse and the tangent friction impulse.

But one affects the other. Say I apply the normal impulse first, the separating velocity is now correct. Now I apply a tangential friction impulse. Now the separating velocity is more or less than the 'target' separating velocity. Maybe that's not a problem, but what if it becomes negative again? Do you loop around and re-calculate a new normal and tangent impulse, or leave it as is?

It's a problem. You're solving linearly complementary equations in isolation, which can easily interrupt one another. A solution is to form a system of linearly complementary equations and solve them all. It can be fairly easy to get going in terms of implementation, given a working naive solution.

 

If you want to read more about modern techniques see Erin Catto's 2006ish paper called "Iterative Dynamics with Temporal Coherence".

Advertisement

I have been heading the way of systems of linear equations for multiple simultaneous collisions/contacts, usually though in the sources I've looked at they don't mention doing so for a single collision point (or I'm not reading closely enough). Thanks for the pointer.

#1 You're solving linear equations subject to complementarity conditions (a MLCP). After all equations are set up, you need a MLCP solver.

#2 For a iterative solver yes. For a global one this is less needed. The link Randy posted uses the Projected-Gauss-Seidel (iterative) solver.

In practice this is not so much of a problem. Only when dealing with continuous collision detection you need to be careful. If you solve the friction constraint after the non-penetration (normal) constraint you can end up with a penetrating velocity at the contact point which can potentially lead to tunneling.

If you want to solve the non-penetration and friction constraint together this paper describes a nice friction model:

https://graphics.stanford.edu/papers/rigid_bodies-sig03/rigid_bodies.pdf

Note that you need to adjust it to work with projected Gauss-Seidel / Sequential impulse and use the accumulated (not incremental!) impulse when potentially clamping the friction.

@Irlan and Randy:

Note that for friction constraints your are technically not solving a linear system nor an MLCP since the friction complementary conditions dependent on the normal constraint lambda. (E.g.: -mu * lambda_n <= lambda_t <= mu * lambda_n ). In a 'real' LCP you don't have such a dependency and in theory this makes all proves about convergence treating the problem as a MLCP at least questionable. In practice I never found this to be an issue though for games.

Advertisement

Dirk, honestly, I have not understand the second part you said. Can you clarify? All papers I've read, Erleben thesis, Baraff, etc. treat (generally) the friction constraints as a MLCP I think. Florian and Potra also models using the LCP I think. Do you agree?

I know that there are infinite solutions for a non-linearized friction model that will be globally solved (as in Baraff), but haven't come to this conclusion yet. Thanks for sharing.

If yes, then how do you separate friction constraints from the normal in your physics engine? Do you have any paper recommendation that can be put into practice without too much effort (i.e. an iterative solution)? This would be nice. Adding > 2 tangential Jacobians would be good as well (tough 2 gives plausible results).

A boxed MLCP:

w = A * x + b and lo <= x <= hi and a_i * x_i = 0

Usually lo and hi are *constant*. But for friction (they way we usually describe it) they dependent on the associated normal impulse (eg. friction_lo = f(x_normal)). Hence in every iteration, for each contact you recalculate the lower and upper limit based on the current accumulated impulse. This is technically not a LCP and very difficult to solve. I am not saying you cannot solve the problem as we do. Just the convergence proof, assuming this is a boxed MLCP, are at least questionable. In practice, for games at least, it seems to work well.

This paper talks about it a bit and uses a reformulated friction:
https://cloud.gsc.ce.tu-darmstadt.de/public.php?service=files&t=f41766c2c643b384e40cc8ab384e2e40&path=/papers&files=STAR.pdf&download

According.

This topic is closed to new replies.

Advertisement