/** * AnimationGraph.ts * * State machine-driven animation blending system. * Supports weighted transitions, blend trees, and animation layers. * * @module animation */ export interface AnimationClip { id: string; name: string; duration: number; loop: boolean; speed: number; tracks: AnimationTrack[]; } export interface AnimationTrack { targetProperty: string; keyframes: Keyframe[]; interpolation: 'linear' | 'step' | 'cubic'; } export interface Keyframe { time: number; value: number; inTangent?: number; outTangent?: number; } export interface AnimationState { id: string; clipId: string; speed: number; loop: boolean; currentTime: number; weight: number; isPlaying: boolean; } export interface AnimationTransition { id: string; fromState: string; toState: string; duration: number; condition: TransitionCondition; interruptible: boolean; } export type TransitionCondition = { type: 'parameter'; name: string; comparator: '>' | '<' | '==' | '!='; value: number | boolean; } | { type: 'finished'; } | { type: 'trigger'; name: string; }; export interface BlendNode { type: 'clip' | 'blend1d' | 'blend2d'; clipId?: string; parameter?: string; children?: { position: number; node: BlendNode; }[]; children2D?: { position: { x: number; y: number; }; node: BlendNode; }[]; } export interface AnimationLayer { id: string; weight: number; blendMode: 'override' | 'additive'; mask?: string[]; graph: AnimationGraphInstance; } export interface AnimationGraphInstance { states: Map; transitions: AnimationTransition[]; currentState: string; parameters: Map; activeTransition: { from: string; to: string; progress: number; duration: number; } | null; } export declare class AnimationGraph { private clips; private layers; private defaultGraph; constructor(); addClip(clip: AnimationClip): void; getClip(id: string): AnimationClip | undefined; removeClip(id: string): boolean; getClipIds(): string[]; addState(id: string, clipId: string, options?: Partial<{ speed: number; loop: boolean; }>): AnimationState; getState(id: string): AnimationState | undefined; getCurrentState(): string; addTransition(transition: AnimationTransition): void; setParameter(name: string, value: number | boolean): void; getParameter(name: string): number | boolean | undefined; setTrigger(name: string): void; update(dt: number): Map; addLayer(layer: AnimationLayer): void; getLayers(): AnimationLayer[]; private evaluateCondition; private sampleTrack; } //# sourceMappingURL=AnimationGraph.d.ts.map