Hi guys,
A question about springs. Given the following (all in 2d space)
Vec2 anchor;
Vec2 point;
float k(spring constant)
float l(rest len)
float d(drag coefficient)
we are able to generate a force something like this using Hook's Law
Vec2 rel_pos=point-anchor
float dist=rel_pos.len()
Vec2 force=-k(abs(dist)-l)*rel_pos.normal()
every update method call, the velocity is dragged a bit.
The end result is an oscilating spring which is dampened. However, the issue appears when the spring starts to settle. It keeps vibrating around the anchor.
Does anyone know how to "shut down" that is stop a spring from vibrating around an anchor after it has reached some minimum distance or force? I don't want to hack a solution together so I thought I would ask.
Thanks,
Mike