Inequality Constraints

Overview

Complete 2D derivation for colliding contacts

two bodies colliding
Two examples of how collisions are resolved by computing appropriate constraint impulses that change the linear and angular velocity of the involved bodies. First row: a body falls onto a ramp. An impulse vector (red), standing orthogonally on the penetrated surface, is applied to the cube's velocity (weighted by its mass). This leads to a change in its linear (\mathbf{v}) and angular (\omega) velocity. The second impulse (blue; same magnitude, opposite direction) is applied to the ramp but assuming the ramp has infinite mass, it has no effect. In the second row, the same scenario with a different ramp is depicted. Here, the computed constraint impulse again counteracts penetration, but due to the angle of penetration, the cube now rotates into the opposite direction. This behavior is counter-intuitive, and can be avoided by adding friction constraints. However, without friction, it makes sense: think of both the ramp and the cube as blocks of slippery ice, then the simulated response makes more sense.

Relationship to LCP

Examples

mass:
x0:
y0:
theta0:
vx0:
vy0:
vAng0:
tStop:

t=0s

domino spacing:
vAng0:
tStop:

t=0s

tStop:

t=0s

Notes on the Demos

The demos may look a bit unnatural because I did not include friction. More about this in the next section.