oh Blackbird, I apologize, there is still a bug in the modification I made to the joint.
this is the expression to calculate the acceleration one time step ahead of a spring damper.
f = [- k * (x2 - x1) - c * (v2 - v1) - dt * k * (v2 - v1)] / [m + dt * c + dt * dt * k]
this is the expression for calculating the force of one constrain row.
*jm^1jt + b(jm^1j)) f = aext + extforce * jm^1 + somePenatry
if we make jm^1j = invM
the equation become
(invM * b * invM) f = aext + extforce * jm^1 + somePenatry
now those two equations are linear equations on f. I will highlight both
1) f = [- k * (x2 - x1) - c * (v2 - v1) - dt * k * (v2 - v1)] / [m + dt * c + dt * dt * k]
(2) (invM + b * invM) f = aext + extforce * jm^1 + somePenatry
We I can adjust the coefficients so that they produce the same result we can get equation two to calculate a spring force.
The method that is in 3.14 now works as follows.
I set the penalty term in equation 2 to the entire value of on the right side of expression 1.
and I have the user passing an arbitrary regularizer b on the left size of equation 2.
this generates a mass independent spring damper force because the value on the right does not depend of the masses of the bodies, as long as k, c and t dominate m. and b is an arbitration regularizer if teh diagonal of teh mass matrix.
to get a mass dependent spring damper we can do this
let b = m + dt * c + dt * dt * k
and the penalty on the right be a = - k * (x2 - x1) - c * (v2 - v1) - dt * k * (v2 - v1)
we can factor m from b to get
1 + (dt * c + dt * dt * k)/m
now when we replace b with his in equation 2. k, c and t modify the diagonal of the mass matrix according. The bug was that after I made the fix, I did not divided the regularizer dt * c + dt * dt * k by m. so it produced some effect but not enough to see without ambiguity.
I just discovered the mistake when trying to add the springs functionality to newton 4.0.
notice that if (dt *c + dt * dt * k)/m is larger or comparable 1.0
the effect is stable but not longer accurate.
this is a behavior that is typical of implicitly integration because by definition, implicit integration method use the derivative of the function either one step ahead or one step behind. so they are accurate only as long as the time step is small enough to reduce the stiffness of the system.
so if k, c, or dt combine to make (dt * c + dt * dt * k)/m close to 1.0 the result diverge from accurate.
I will make the correction later.