Optional options: { Optional damping?: numberDamping of the spring. A number >= 0.
1
Optional localAnchor for bodyA in local bodyA coordinates. Where to hook the spring to body A, in local body coordinates.
new Vec3()
Optional localAnchor for bodyB in local bodyB coordinates. Where to hook the spring to body B, in local body coordinates.
new Vec3()
Optional restRest length of the spring. A number > 0.
1
Optional stiffness?: numberStiffness of the spring. A number >= 0.
100
Optional worldWhere to hook the spring to body A, in world coordinates.
Optional worldWhere to hook the spring to body B, in world coordinates.
First connected body.
Second connected body.
Damping of the spring. A number >= 0.
1
Anchor for bodyA in local bodyA coordinates. Where to hook the spring to body A, in local body coordinates.
new Vec3()
Anchor for bodyB in local bodyB coordinates. Where to hook the spring to body B, in local body coordinates.
new Vec3()
Rest length of the spring. A number > 0.
1
Stiffness of the spring. A number >= 0.
100
Get the anchor point on body A, in world coordinates.
The vector to store the result in.
Get the anchor point on body B, in world coordinates.
The vector to store the result in.
Set the anchor point on body A, using world coordinates.
Set the anchor point on body B, using world coordinates.
A spring, connecting two bodies.
Example