float Spring::getLength(){ return cpDampedSpringGetRestLength(constraint); }
static cpFloat springForce(cpConstraint *spring, cpFloat dist) { cpFloat clamp = 20.0f; return cpfclamp(cpDampedSpringGetRestLength(spring) - dist, -clamp, clamp)*cpDampedSpringGetStiffness(spring); }
float PhysicsJointSpring::getRestLength() const { return PhysicsHelper::cpfloat2float(cpDampedSpringGetRestLength(_cpConstraints.front())); }