API

Interface FgCapabilities

Scene-owned capabilities a block may invoke WITHOUT a scene reference. Provided by the loader/animation subsystem. All optional — Phase 1 ships none; animation/interpolation blocks (Phase 3) consume these.

interface FgCapabilities {
    onAnimationEnd?: (group: AnimationGroup, cb: () => void) => () => void;
    playAnimation?: (
        group: AnimationGroup,
        opts?: { from?: number; loop?: boolean; speed?: number; to?: number },
    ) => void;
    stopAnimation?: (group: AnimationGroup) => void;
    stopAnimationAt?: (group: AnimationGroup, frame: number) => void;
}
Index
onAnimationEnd?: (group: AnimationGroup, cb: () => void) => () => void

Subscribe to an animation group's end; returns an unsubscribe fn.

playAnimation?: (
    group: AnimationGroup,
    opts?: { from?: number; loop?: boolean; speed?: number; to?: number },
) => void

Play an animation group (resolved from a glTF animation index).

stopAnimation?: (group: AnimationGroup) => void

Stop a playing animation group.

stopAnimationAt?: (group: AnimationGroup, frame: number) => void

Halt a playing animation group at a specific frame (glTF animation/stopAt).