Inequality constraints

Started by
5 comments, last by Dirk Gregorius 16 years, 10 months ago
In many tutorials that I've read, such as the slideshow here: http://www.gphysics.com/downloads/ The collision resolution constraints are modeled as inequalities rather than equalities. But I don't understand, why cant the euqations be written exactly using the impulse equation (the one on chris heckers sight for example) and then solve the system of equations using conventional methods (guass...) instead of LCP? Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Advertisement
This is the impulse equation, but when the relative velocity is not penetrating the impulse will vanish. A contact force can never pull bodies together.

What impulse equation do you mean? The formula is:

// We apply and impulse P...
v' = v + P / m

// ...such that the post velocity v' satisfies the velocity (kinematic) constraint
J * v' = 0

// We actually also know the impulse direction
P = JT * lambda

So the desired impulse is
lambda = - J * v / J * W * JT

and in the presents of Baumgarte
lambda = - ( J * v + beta * C / dt ) / J * W * JT


The Jacobian J for the non-penetration constraint is

J = ( -n | -r1 x n | n | r2 x n )


If you multiply this out you end up with the same formula as in Baraff or the one Catto uses. Also note that when you apply sequential impulses you actually compute delta impulses.

If you mean that this could also be formolized using conservation of momentum (like e.g. Mirtich iirc) instead of the principal of virtual work I think it can be shown that this also equalivalent, though I haven't tried to proove it.

Note that in the Mirtich case his collision matrix K = J * W * JT where J = ( -I3 | skew(r1) | I3 | -skew(r2) )

where I3 is the 3D identity matrix and skew is skew symmetric "cross-product" matrix such that cross( r, x ) = skew(r1) * x


HTH,
-Dirk
Thanks, but why does that mean that the constraint equation has to be an equality?
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
Because (as Erin pointed out on the Bullet forum) there will only be contact force when there is a relative approaching velocity/acceleration at the contact point. If the relative velocity is seperating, the force is not present. The inequality is the mathematical way to express this. An equality would mean that (using Erin's example) that a box on the table could never take off from the table since there would be force dragging the box down. But what actually happens - you can try it at home :) - is that there is no force on the box in this case...

The question is very good. Since you try to understand how to express natural phenomena using mathematics which are mostly tought both in high school and universtity in a much more abstract way...


HTH,
-Dirk
Then why cant you just check the direction of the relative velocity before applying the impulse and then only apply the impulse if the collision points are moving towards each other (along the collision normal)?
Thanks.
"We've all heard that a million monkeys banging on a million typewriters will eventually reproduce the entire works of Shakespeare. Now, thanks to the internet, we know this is not true." -- Professor Robert Silensky
please _read_ his presentation .ppt -- it shows exactly why this sort of naive clamping doesn't behave well, and how accumulated clamping fixes this problem.
You can do this. And actually a lot of popular papers do this, e.g. Guendelman or Mirtich. But the results are not very good and you get jitter artifacts.

It is not quite simple to understand all the reasons for this, so I strongly suggest that you accept this for the time being and save you a lot of time. The understanding will come later...

This topic is closed to new replies.

Advertisement