import type { ModelAnimationConfig } from "../game/playableGame.js"; import type { AnimGraph } from "./animGraph.js"; /** Inputs for {@link locomotionGraph}: the locomotion clip names and the one-shot table a rig config already carries. */ export interface LocomotionGraphInput { idle: string; walk: string; run?: string; /** Clip for moving to the character's left; adds the `strafe` state. */ strafeLeft?: string; /** Clip for moving to the character's right; adds the `strafe` state. */ strafeRight?: string; /** Clip for moving backwards; adds the `backward` state. */ backward?: string; /** Clip for turning on the spot. Omitted, the turn blend uses `walk` as its pivot step. */ turn?: string; /** Speed (world units/sec) above which the character walks. Default 0.5. */ walkSpeed?: number; /** Speed above which it runs. Default 6. */ runSpeed?: number; /** Crossfade seconds between locomotion states. Default 0.2. */ fadeSec?: number; /** Lateral share above which the character counts as strafing. Default 0.35. */ strafeGate?: number; /** Lateral share at or below which it stops strafing. Default 0.2. */ strafeRelease?: number; /** Facing-vs-motion dot below which it counts as moving backwards. Default -0.35. */ backwardGate?: number; /** Facing-vs-motion dot at or above which it stops. Default -0.2. */ backwardRelease?: number; /** Turn rate (radians/sec) above which the character counts as turning on the spot. Default 1.5. */ turnGate?: number; /** Turn rate at which the turn blend reaches its pivot clip. Default 4. */ turnFull?: number; /** Speed below which a turn counts as turning on the spot. Default 0.5. */ turnSpeed?: number; /** * Mark every locomotion state as a root-motion state, so the rig plays in place and the blended * root travel comes out as `AnimGraphOutput.rootDelta`. The movement owner consumes it with * `takeRootMotion` and resolves it through its controller. Off by default, for rigs whose clips * are authored in place. */ rootMotion?: boolean; /** One-shot clips keyed by trigger name; `death` holds its last frame instead of returning. */ oneShots?: Readonly>; } /** The parameter name the shell feeds with the entity's smoothed ground speed. */ export declare const LOCOMOTION_SPEED_PARAM = "speed"; /** Ground contact reported by the shared player motor; absent for custom movers without authored parameters. */ export declare const LOCOMOTION_GROUNDED_PARAM = "grounded"; /** Resolved vertical velocity from the shared player motor, in world units/sec. */ export declare const LOCOMOTION_VERTICAL_SPEED_PARAM = "verticalSpeed"; /** Physically resolved crouch stance from the shared player motor. */ export declare const LOCOMOTION_CROUCHED_PARAM = "crouched"; /** * Signed lateral share of the character's motion: `-1` fully to its left, `+1` fully to its right, * `0` straight ahead or straight back. A custom mover feeds it under `ANIM_PARAMS_KEY`. */ export declare const LOCOMOTION_DIRECTION_PARAM = "direction"; /** * Dot of the character's facing with its motion direction: `1` running forward, `-1` running * backwards. A custom mover feeds it under `ANIM_PARAMS_KEY`. */ export declare const LOCOMOTION_FACING_PARAM = "facing"; /** Signed yaw rate in radians/sec; a custom mover feeds it under `ANIM_PARAMS_KEY`. */ export declare const LOCOMOTION_TURN_RATE_PARAM = "turnRate"; /** Layer id the locomotion graph uses; query `runtime.stateOf(LOCOMOTION_LAYER)`. */ export declare const LOCOMOTION_LAYER = "base"; /** State id of the forward idle/walk/run blend. */ export declare const LOCOMOTION_STATE = "locomotion"; /** State id of the lateral strafe blend. */ export declare const LOCOMOTION_STRAFE_STATE = "strafe"; /** State id of the backwards blend. */ export declare const LOCOMOTION_BACKWARD_STATE = "backward"; /** State id of the on-the-spot turn blend. */ export declare const LOCOMOTION_TURN_STATE = "turn"; /** * The engine's default locomotion as an authored graph: a speed-driven blend between idle, walk and * run, plus a state per one-shot that plays once and returns (or clamps for `death`). What * `useModelAnimation` used to hardcode. * * Supplying `strafeLeft`/`strafeRight` adds a `strafe` blend on the `direction` parameter, and * `backward` and `turn` add their states behind the `facing` and `turnRate` parameters. Each extra * state is joined to the base by a crossfaded transition, so a direction change blends rather than * pops; without them the graph is exactly the speed-only tree it has always been. * * @capability locomotion-graph build the default idle/walk/run plus one-shot graph from clip names */ export declare function locomotionGraph(input: LocomotionGraphInput): AnimGraph; /** * The graph a model animation config plays: its `graph`, or the {@link locomotionGraph} its * `states` and `oneShots` describe, retaining every one-shot variant. `undefined` for a * single-clip config or incomplete locomotion roles. Idle must name a clip; an absent or blank * walk role holds that idle clip at walking speeds until configured. The shell plays this and * the editor inspects it, so both see the same graph. * * @capability locomotion-graph resolve the animation graph a model config plays */ export declare function animGraphFromConfig(config: ModelAnimationConfig): AnimGraph | undefined;