SpringJointConfig
Defined in: physics/src/types.ts:72
Elastic connection between two bodies. Pulls together when stretched past restLength, pushes apart when compressed below it.
Properties
Section titled “Properties”anchorA?
Section titled “anchorA?”
optionalanchorA?:Vec2Like
Defined in: physics/src/types.ts:86
Attachment point on body A in pixels, local to the body. Default: body origin.
anchorB?
Section titled “anchorB?”
optionalanchorB?:Vec2Like
Defined in: physics/src/types.ts:88
Attachment point on body B in pixels, local to the body. Default: body origin.
damping
Section titled “damping”damping:
number
Defined in: physics/src/types.ts:84
Resists relative motion along the spring axis. Same mass-relative units as stiffness.
restLength
Section titled “restLength”restLength:
number
Defined in: physics/src/types.ts:75
Distance the spring tries to hold, in pixels.
stiffness
Section titled “stiffness”stiffness:
number
Defined in: physics/src/types.ts:82
Spring strength, mass-relative: a body of mass m stretched by d pixels accelerates at stiffness * d / m px/s². Passed to the solver unconverted, and collider mass depends on pixelsPerMeter (density × area in meters) — retune after changing the scale.
type:
"spring"
Defined in: physics/src/types.ts:73