import { AnimationData, AnimationTargetPose, AnimationDataChannel, AnimationDataChannels, AnimationDataChannelSample } from './AnimationData'; import { IVec3, IVec4 } from '@gglib/math'; /** * @public */ export declare class AnimationPlayer { /** * The model that is being animated */ readonly data: ReadonlyArray; private clips; get clip(): IAnimationClip; private activeClip; private looping; constructor(data: ReadonlyArray); loadClip(indexOrName: string | number, looping?: boolean): IAnimationClip; sample(time: number, targets: AnimationTargetPose[]): boolean; } export interface IAnimationClip { /** * Name of the animation clip */ name: string; /** * Start time of the clip */ startTime: number; /** * End time of the clip */ endTime: number; /** * Duration of the clip */ duration: number; /** * List of target ids that are animated */ targets: number[]; /** * Resolves a sample at given time for given target * * @param time - time in seconds * @param target - target id * @param out - where output is written to */ sample(time: number, target: number, out?: AnimationTargetPose): AnimationTargetPose; } export declare class AnimationChannelsSampler implements IAnimationClip { /** * The name of this animation */ readonly name: string; /** * A map of targetId to its individual animation sampler */ protected readonly channels: Map; readonly startTime: number; readonly endTime: number; readonly duration: number; readonly targets: number[]; constructor(data: AnimationData); sample(time: number, target: number, out: AnimationTargetPose): AnimationTargetPose; } export declare class AnimationChannelSampler { /** * The target id (bone or node index) */ get target(): number; /** * The animation data */ readonly data: AnimationDataChannels; /** * Minimum start time in this animation data */ readonly startTime: number; /** * Maximum end time in this animation data */ readonly endTime: number; /** * Duration of this animation data */ readonly duration: number; protected readonly position: AnimationChannelIndexer; protected readonly rotation: AnimationChannelIndexer; protected readonly scale: AnimationChannelIndexer; constructor(data: AnimationDataChannels); sample(time: number, out: AnimationTargetPose): void; private sampleVec3; private sampleVec4; } export declare class AnimationChannelIndexer { readonly samples: AnimationDataChannelSample[]; readonly interpolation: 'step' | 'linear' | 'cubic'; readonly startTime: number; readonly endTime: number; readonly duration: number; private resolution; private timeToSample; constructor(data: AnimationDataChannel); getIndex(time: number): number; } //# sourceMappingURL=AnimationPlayer.d.ts.map