# Inequality constraints

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

## Recommended Posts

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.

##### Share on other sites
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

##### Share on other sites
Thanks, but why does that mean that the constraint equation has to be an equality?

##### Share on other sites
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

##### Share on other sites
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.

##### Share on other sites
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.

##### Share on other sites
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...

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 12
• 10
• 12
• 10
• 13
• ### Forum Statistics

• Total Topics
632991
• Total Posts
3009749
• ### Who's Online (See full list)

There are no registered users currently online

×