2020-01-07 06:29:51 +01:00
|
|
|
import { Clock } from "three";
|
2018-10-28 16:55:30 +01:00
|
|
|
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;
|
2018-10-28 16:55:30 +01:00
|
|
|
readonly animation: Animation;
|
|
|
|
|
reset(): void;
|
2020-01-07 06:29:51 +01:00
|
|
|
}
|
|
|
|
|
export interface SubAnimationHandle extends AnimationHandle {
|
2018-10-28 16:55:30 +01:00
|
|
|
remove(): void;
|
2020-01-07 06:29:51 +01:00
|
|
|
resetAndRemove(): void;
|
2018-10-28 16:55:30 +01:00
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
2018-10-28 16:55:30 +01:00
|
|
|
export declare const WalkingAnimation: Animation;
|
|
|
|
|
export declare const RunningAnimation: Animation;
|
|
|
|
|
export declare const RotatingAnimation: Animation;
|