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

    Class SquashStretchBehavior

    Applies a brief, volume-preserving-ish squash-and-stretch impulse to an object's scale, driven by a damped spring so it overshoots and settles back to the base scale — the classic "game feel" cue for landings, launches, and impacts.

    Hierarchy (View Summary)

    Index
    damping: number
    isActive: boolean = true
    stiffness: number
    target: CameraInterfaceData | Object3D | undefined = undefined

    The object this behavior is attached to. Set automatically.

    uuid: string = ...
    inspector?: Record<string, InspectorField>
    • Returns an independent copy of this behavior (own uuid, target cleared -- the caller is expected to attachBehavior() it onto the new host, which sets target correctly via onAttach()). Used by Object3D.clone() (Maker's Duplicate command).

      Returns Behavior

    • Triggers a squash-and-stretch impulse.

      Parameters

      • intensity: number = 0.35

        Squash amount along Y (0 = none, 1 = fully flattened). The object stretches outward on X/Z by roughly half of that to read as volume-preserving. Default 0.35.

      Returns void