Small World Engine API Reference - v0.78.00
    Preparing search index...

    Class SpringJoint

    Damped elastic spring constraint connecting two bodies or a body and a static anchor.

    Hierarchy (View Summary)

    Index
    anchorA: Vector3D

    Local anchor offset on bodyA.

    anchorB: Vector3D

    Local anchor offset on bodyB, or world-space anchor if bodyB is null.

    bodyA: Object3D

    The primary Object3D entity constrained by this joint.

    bodyB: Object3D | null

    The secondary Object3D entity, or null to anchor bodyA to static world space.

    breakForce: number

    Maximum force or impulse threshold before joint rupture.

    collideConnected: boolean

    Whether collision response between bodyA and bodyB is enabled.

    damping: number

    Damping coefficient c (N*s/m).

    enabled: boolean = true

    Whether the joint is actively evaluated during physics simulation ticks.

    isBroken: boolean = false

    Whether the joint has exceeded breakForce and ruptured.

    restLength: number

    Equilibrium rest length L0.

    stiffness: number

    Spring stiffness coefficient k (N/m).

    • get isFullyAsleep(): boolean

      True when every dynamic body connected by this joint is currently asleep (static bodies do not count). A fully-asleep joint has nothing to solve: both endpoints are frozen, so the solve can be skipped without waking them. This mirrors the collision solver, which only applies impulses to approaching contacts and therefore never re-wakes settled bodies.

      Returns boolean

    • Optional pre-solve hook to accumulate continuous forces (e.g. Hookean spring tension).

      Parameters

      • _dt: number

        Fixed substep delta time in seconds.

      Returns void