Skip to content

Documentation / scene / SpringConstraint

Interface: SpringConstraint

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:6

Represents a spring constraint between two particles

Properties

particleA

particleA: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:8

Index of the first particle


particleB

particleB: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:10

Index of the second particle


restLength

restLength: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:12

Rest length of the spring


stiffness

stiffness: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:14

Stiffness coefficient [0-1] used by Verlet solver (0 = no constraint, 1 = rigid)


compliance

compliance: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:21

XPBD compliance (inverse stiffness) in m/N. 0 = perfectly rigid, larger values = softer spring. Typical ranges: 0 (rigid) ~ 1e-7 (very stiff) ~ 1e-3 (soft cloth) ~ 1e-1 (rubber band). Only used when solver is 'xpbd'.


lambda

lambda: number

Defined in: libs/scene/src/animation/spring/spring_constraint.ts:26

XPBD Lagrange multiplier accumulator, reset to 0 at the start of each time step. Managed internally by the solver — do not set manually.

Released under the MIT License.