skinview3d/js/dist/animation.d.ts

38 lines
1.3 KiB
TypeScript
Raw Normal View History

2020-01-07 06:29:51 +01:00
import { Clock } from "three";
import { PlayerObject } from "./model";
export interface IAnimation {
play(player: PlayerObject, time: number): void;
}
export declare type AnimationFn = (player: PlayerObject, time: number) => void;
export declare type Animation = AnimationFn | IAnimation;
export declare function invokeAnimation(animation: Animation, player: PlayerObject, time: number): void;
export interface AnimationHandle {
speed: number;
2020-01-07 06:29:51 +01:00
paused: boolean;
progress: number;
readonly animation: Animation;
reset(): void;
2020-01-07 06:29:51 +01:00
}
export interface SubAnimationHandle extends AnimationHandle {
remove(): void;
2020-01-07 06:29:51 +01:00
resetAndRemove(): void;
}
export declare class CompositeAnimation implements IAnimation {
readonly handles: Set<AnimationHandle & IAnimation>;
add(animation: Animation): AnimationHandle;
play(player: PlayerObject, time: number): void;
}
2020-01-07 06:29:51 +01:00
export declare class RootAnimation extends CompositeAnimation implements AnimationHandle {
speed: number;
progress: number;
readonly clock: Clock;
get animation(): this;
get paused(): boolean;
set paused(value: boolean);
runAnimationLoop(player: PlayerObject): void;
reset(): void;
}
export declare const WalkingAnimation: Animation;
export declare const RunningAnimation: Animation;
export declare const RotatingAnimation: Animation;