b2DistanceJoint constraint math

Hi,

I was browsing through the math for the distance joint (in conjunction with Erin's excellent GDC 2011 presentation) and velocity constraint calculation makes perfect sense to me. The one thing that I don't understand is the impulse application, and the mass calculation in particular.

The variable m_mass is calculated by inverting the effective mass plus 'gamma' (which is gamma from the presentation divided by h).

i.e. m_mass = (1/(invMass + gamma))

I assume that this is some kind of optimisation rather than reflecting the actual mass, but I can't figure out why we need that extra gamma. Can anyone enlighten me?

Thanks,

Rory
The soft constraint formulas decrease the effective mass of the constraint, so that the constraint impulse is lowered. This makes the constraint soft!
Ah yes, my fault. I hand't fully expanded out the expression Jv1 + beta/t*x0 + gamma * lambda. You end up with:

(JWJT * h + gamma) * lambda = (-J * v0 - beta / h * x0)

Thanks,

Rory

Original thread: https://box2d.org/forum/viewtopic.php?t=8423