Total impulse of cpDampedRotarySpring is wrong, it adds the damping instead of subtracting it.
viblo opened this issue · 0 comments
viblo commented
In the DampedRotarySpring the total impulse is collected in jAcc.
The logic is:
- In preStep:
impulse = springTorqueFunc(...)*dt
- In applyImpulse:
impulse += damping torque
However, in the applyImpulse function the damping torque is subtracted from body a's angular velocity, while the impulse in preStep were added. Therefor I believe it should be impulse -= damping torque
instead in applyImpulse.
I will make a PR when Im more confident of this finding.
(I noticed this while trying to implement maxForce for the springs: #245 )