Class RotationalSpring

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

var spring = new RotationalSpring(bodyA, bodyB, {
stiffness: 100,
damping: 1
});
world.addSpring(spring);

Hierarchy

Constructors

Properties

Methods

Constructors

Properties

bodyA: Body

First connected body.

bodyB: Body

Second connected body.

damping: number

Damping of the spring.

restAngle: number

Rest angle of the spring.

stiffness: number

Stiffness of the spring.

Methods

  • Apply the spring force to the connected bodies.

    Returns void