Documentation
    Preparing search index...

    Module @fourjs/animation

    @fourjs/animation

    Animation system — the animation pillar (Part III). Part of fourJS.

    Implements §14–§18 (§100, Part III) of docs/SPECIFICATION.md; shipped in Phase 4 (§107). All durations are in seconds; quaternion tracks interpolate by shortest-arc slerp.

    • Easing — the 34-name registry (EASINGS, EASING_NAMES, resolveEasing) covering the §15 families: quadratic through quintic, sine, circular, exponential, back, elastic, bounce, and a closed-form damped spring.
    • Tweens — Tween / tween() builder with repeat semantics and the TweenState lifecycle.
    • Value adapters — numberAdapter, vector2Adapter/vector3Adapter/vector4Adapter, quaternionAdapter (slerp), colorAdapter, booleanAdapter/discreteAdapter, and detectAdapter; primitives return values, reference types mutate out in place (ValueAdapter.mutatesInPlace).
    • Property binding — createBinding / PropertyBinding: paths resolved once, in-place writes that preserve identity and change hooks. Conflicting writers resolve last-started-wins via a claim registry shared by tweens and the mixer.
    • Timelines — Timeline with elapsed-space markers, seek suppression / replayOnSeek, and nestable TimelineChild entries.
    • Clips and tracks — AnimationTrack / AnimationClip (§17 shape; step, linear, and cubic interpolation) with clip events.
    • Playback — AnimationMixer (prepare() + play(), translation-only root-motion option) and AnimationSystem (priority 300, fixed-step advance, auto-untracks finished animations).
    • State machines, blend trees, skeletal and morph-target animation (staged per plan P4-3).
    • Rotational root motion (translation-only ships; staged 2026-08-02).
    • Physics-animation blending itself lives in @fourjs/physics (§19), driven by @fourjs/scene's PoseTarget.

    Unit tests are colocated in tests/ per §92.

    Workspace name @fourjs/animation; publishes as @danielsimonjr/fourjs-animation.

    AnimationClip
    AnimationController
    AnimationLayerStack
    AnimationMixer
    AnimationSystem
    AnimationTrack
    Timeline
    Tween
    Advanceable
    AnimationClipOptions
    AnimationControllerOptions
    AnimationControllerParameters
    AnimationEvent
    AnimationLayer
    AnimationLayerStackOptions
    AnimationStateOptions
    AnimationSystemOptions
    AnimationTrackLike
    AnimationTrackOptions
    AnimationTransition
    BlendTree1D
    BlendTree1DPoint
    BlendTree2D
    BlendTree2DPoint
    BooleanCondition
    ControllerAdvanceOptions
    MixerPlayOptions
    MixerRootMotionOptions
    NumericCondition
    PropertyBinding
    TimelineChild
    TimelineMarkerOptions
    TrackSampleSink
    TriggerCondition
    TweenProperties
    ValueAdapter
    WhenParameterLookup
    AnimationEventListener
    AnimationEventVisitor
    AnimationPlaybackState
    AnimationStateInput
    BlendTree
    ColorRGBA
    ControllerPlaybackState
    EasingFunction
    EasingName
    InterpolationMode
    MixerState
    NumericComparison
    StateChangeListener
    TimelineEntry
    TimelineMarkerCallback
    TimelineState
    TransitionCondition
    TransitionWhen
    TweenState
    TweenValue
    ValueKind
    ANY_STATE
    BACK_OVERSHOOT
    BACK_OVERSHOOT_IN_OUT
    backIn
    backInOut
    backOut
    booleanAdapter
    BOUNCE_AMPLITUDE
    BOUNCE_SEGMENT_DIVISOR
    bounceIn
    bounceInOut
    bounceOut
    circularIn
    circularInOut
    circularOut
    colorAdapter
    cubicIn
    cubicInOut
    cubicOut
    discreteAdapter
    EASING_NAMES
    EASINGS
    ELASTIC_AMPLITUDE
    ELASTIC_PERIOD
    ELASTIC_PERIOD_IN_OUT
    elasticIn
    elasticInOut
    elasticOut
    exponentialIn
    exponentialInOut
    exponentialOut
    linear
    numberAdapter
    PACKAGE_NAME
    quadraticIn
    quadraticInOut
    quadraticOut
    quarticIn
    quarticInOut
    quarticOut
    quaternionAdapter
    quinticIn
    quinticInOut
    quinticOut
    sineIn
    sineInOut
    sineOut
    SPRING_DAMPING_RATIO
    SPRING_OSCILLATIONS
    springIn
    springInOut
    springOut
    vector2Adapter
    vector3Adapter
    vector4Adapter
    animate
    compileWhenExpression
    createArrayElementBinding
    createBinding
    detectAdapter
    discreteAdapterFor
    isBlendTree
    resolveEasing
    tween