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.
var spring = new RotationalSpring(bodyA, bodyB, { stiffness: 100, damping: 1 }); world.addSpring(spring); Copy
var spring = new RotationalSpring(bodyA, bodyB, { stiffness: 100, damping: 1 }); world.addSpring(spring);
First connected body.
Second connected body.
Damping of the spring.
Rest angle of the spring.
Stiffness of the spring.
Apply the spring force to the connected bodies.
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.
Example