RotationalSpring Class
A rotational spring, connecting two bodies rotation. This spring explicitly adds angularForce (torque) to the bodies.
The spring can be combined with a RevoluteConstraint to make, for example, a mouse trap.
Constructor
RotationalSpring
(
-
bodyA -
bodyB -
[options]
Parameters:
-
bodyABody -
bodyBBody -
[options]Object optional-
[restAngle]Number optionalThe relative angle of bodies at which the spring is at rest. If not given, it's set to the current relative angle between the bodies.
-
[stiffness=100]Number optionalSpring constant (see Hookes Law). A number >= 0.
-
[damping=1]Number optionalA number >= 0.
-
Methods
applyForce
()
Apply the spring force to the connected bodies.
