Mouse Constraint Derivation

You can read here how to compute the mouse constraint Jacobian, which I think is the simplest constraint along with a distance constraint. It can be helpfull when you’re selecting geometries in the scene using the mouse world space position (as a joint anchor point), since there is lack of controlability by directly applying forces at a particular point of a rigid body shape.

Errata: There is a minus sign before the stabilization term. It should be:

Lambda = (J * M * J^T)-1 * (-J * V – Beta / TimeStep * C)

Note: You can bound excessive impulses to avoid excessive velocity changes.

Thanks to Dirk Gregorius of Valve for pointing those things out via e-mail.

Continue reading