UNPKG

1.4 kBTypeScriptView Raw
1import { KeyframeTrack } from './KeyframeTrack';
2import { Vector3 } from './../math/Vector3';
3import { Bone } from './../objects/Bone';
4import { AnimationBlendMode } from '../constants';
5
6export interface MorphTarget {
7 name: string;
8 vertices: Vector3[];
9}
10
11export class AnimationClip {
12 constructor(name?: string, duration?: number, tracks?: KeyframeTrack[], blendMode?: AnimationBlendMode);
13
14 name: string;
15 tracks: KeyframeTrack[];
16
17 /**
18 * @default THREE.NormalAnimationBlendMode
19 */
20 blendMode: AnimationBlendMode;
21
22 /**
23 * @default -1
24 */
25 duration: number;
26 uuid: string;
27 results: any[];
28
29 resetDuration(): AnimationClip;
30 trim(): AnimationClip;
31 validate(): boolean;
32 optimize(): AnimationClip;
33 clone(): this;
34 toJSON(clip: AnimationClip): any;
35
36 static CreateFromMorphTargetSequence(
37 name: string,
38 morphTargetSequence: MorphTarget[],
39 fps: number,
40 noLoop: boolean,
41 ): AnimationClip;
42 static findByName(clipArray: AnimationClip[], name: string): AnimationClip;
43 static CreateClipsFromMorphTargetSequences(
44 morphTargets: MorphTarget[],
45 fps: number,
46 noLoop: boolean,
47 ): AnimationClip[];
48 static parse(json: any): AnimationClip;
49 static parseAnimation(animation: any, bones: Bone[]): AnimationClip;
50 static toJSON(clip: AnimationClip): any;
51}