UNPKG

1.74 kBTypeScriptView Raw
1import { InterpolationModes } from "../constants.js";
2import { Interpolant } from "../math/Interpolant.js";
3import { CubicInterpolant } from "../math/interpolants/CubicInterpolant.js";
4import { DiscreteInterpolant } from "../math/interpolants/DiscreteInterpolant.js";
5import { LinearInterpolant } from "../math/interpolants/LinearInterpolant.js";
6
7export interface KeyframeTrackJSON {
8 name: string;
9 times: number[];
10 values: number[];
11 interpolation?: InterpolationModes;
12 type: string;
13}
14
15export class KeyframeTrack {
16 /**
17 * @param name
18 * @param times
19 * @param values
20 * @param [interpolation=THREE.InterpolateLinear]
21 */
22 constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>, interpolation?: InterpolationModes);
23
24 name: string;
25 times: Float32Array;
26 values: Float32Array;
27
28 ValueTypeName: string;
29 TimeBufferType: Float32Array;
30 ValueBufferType: Float32Array;
31
32 /**
33 * @default THREE.InterpolateLinear
34 */
35 DefaultInterpolation: InterpolationModes;
36
37 InterpolantFactoryMethodDiscrete(result: any): DiscreteInterpolant;
38 InterpolantFactoryMethodLinear(result: any): LinearInterpolant;
39 InterpolantFactoryMethodSmooth(result: any): CubicInterpolant;
40
41 setInterpolation(interpolation: InterpolationModes): KeyframeTrack;
42 getInterpolation(): InterpolationModes;
43 createInterpolant(): Interpolant;
44
45 getValueSize(): number;
46
47 shift(timeOffset: number): KeyframeTrack;
48 scale(timeScale: number): KeyframeTrack;
49 trim(startTime: number, endTime: number): KeyframeTrack;
50 validate(): boolean;
51 optimize(): KeyframeTrack;
52 clone(): this;
53
54 static toJSON(track: KeyframeTrack): KeyframeTrackJSON;
55}