@types/three 0.174.0 → 0.175.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- three/README.md +1 -1
- three/examples/jsm/Addons.d.ts +1 -1
- three/examples/jsm/controls/PointerLockControls.d.ts +4 -1
- three/examples/jsm/geometries/ParametricFunctions.d.ts +8 -0
- three/examples/jsm/interactive/HTMLMesh.d.ts +9 -2
- three/examples/jsm/loaders/LUTImageLoader.d.ts +2 -2
- three/examples/jsm/postprocessing/HalftonePass.d.ts +1 -1
- three/examples/jsm/postprocessing/LUTPass.d.ts +1 -1
- three/examples/jsm/postprocessing/SMAAPass.d.ts +1 -1
- three/examples/jsm/transpiler/AST.d.ts +218 -1
- three/examples/jsm/transpiler/TSLEncoder.d.ts +35 -1
- three/examples/jsm/webxr/VRButton.d.ts +4 -2
- three/package.json +2 -2
- three/src/Three.TSL.d.ts +3 -1
- three/src/animation/AnimationAction.d.ts +219 -19
- three/src/animation/AnimationClip.d.ts +140 -28
- three/src/animation/AnimationMixer.d.ts +100 -8
- three/src/animation/AnimationObjectGroup.d.ts +55 -14
- three/src/animation/AnimationUtils.d.ts +154 -43
- three/src/animation/KeyframeTrack.d.ts +134 -25
- three/src/animation/PropertyBinding.d.ts +89 -31
- three/src/animation/PropertyMixer.d.ts +62 -5
- three/src/animation/tracks/BooleanKeyframeTrack.d.ts +12 -4
- three/src/animation/tracks/ColorKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/NumberKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/QuaternionKeyframeTrack.d.ts +10 -4
- three/src/animation/tracks/StringKeyframeTrack.d.ts +12 -4
- three/src/animation/tracks/VectorKeyframeTrack.d.ts +10 -4
- three/src/constants.d.ts +2 -2
- three/src/core/BufferAttribute.d.ts +11 -0
- three/src/core/BufferGeometry.d.ts +1 -3
- three/src/extras/Controls.d.ts +1 -1
- three/src/extras/Earcut.d.ts +5 -3
- three/src/extras/ImageUtils.d.ts +1 -0
- three/src/lights/PointLight.d.ts +1 -1
- three/src/loaders/FileLoader.d.ts +2 -2
- three/src/loaders/LoaderUtils.d.ts +0 -5
- three/src/materials/Material.d.ts +3 -0
- three/src/nodes/Nodes.d.ts +1 -0
- three/src/nodes/accessors/BufferAttributeNode.d.ts +11 -4
- three/src/nodes/accessors/Object3DNode.d.ts +6 -6
- three/src/nodes/accessors/SkinningNode.d.ts +4 -3
- three/src/nodes/accessors/StorageTextureNode.d.ts +2 -2
- three/src/nodes/accessors/TextureNode.d.ts +3 -1
- three/src/nodes/code/ExpressionNode.d.ts +3 -2
- three/src/nodes/code/ScriptableNode.d.ts +1 -1
- three/src/nodes/code/ScriptableValueNode.d.ts +1 -1
- three/src/nodes/core/StructTypeNode.d.ts +1 -1
- three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +1 -12
- three/src/nodes/math/ConditionalNode.d.ts +4 -4
- three/src/nodes/math/MathNode.d.ts +20 -12
- three/src/nodes/math/OperatorNode.d.ts +57 -26
- three/src/nodes/tsl/TSLBase.d.ts +1 -0
- three/src/nodes/utils/DebugNode.d.ts +20 -0
- three/src/nodes/utils/SpriteSheetUVNode.d.ts +2 -2
- three/src/renderers/common/Animation.d.ts +2 -2
- three/src/renderers/common/Attributes.d.ts +1 -1
- three/src/renderers/common/Color4.d.ts +1 -1
- three/src/renderers/common/CubeRenderTarget.d.ts +6 -0
- three/src/renderers/common/RenderList.d.ts +2 -2
- three/src/renderers/common/RenderObject.d.ts +1 -1
- three/src/renderers/common/RenderObjects.d.ts +2 -2
- three/src/renderers/common/Renderer.d.ts +36 -27
- three/src/renderers/common/XRManager.d.ts +69 -3
- three/src/renderers/common/nodes/NodeBuilderState.d.ts +3 -3
- three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +1 -1
- three/src/textures/CanvasTexture.d.ts +1 -1
- three/examples/jsm/geometries/ParametricGeometries.d.ts +0 -32
|
@@ -1,17 +1,58 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(...args: any[]);
|
|
1
|
+
import { Object3D } from "../core/Object3D.js";
|
|
3
2
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
/**
|
|
4
|
+
* A group of objects that receives a shared animation state.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
*
|
|
8
|
+
* - Add objects you would otherwise pass as 'root' to the
|
|
9
|
+
* constructor or the .clipAction method of AnimationMixer.
|
|
10
|
+
* - Instead pass this object as 'root'.
|
|
11
|
+
* - You can also add and remove objects later when the mixer is running.
|
|
12
|
+
*
|
|
13
|
+
* Note:
|
|
14
|
+
*
|
|
15
|
+
* - Objects of this class appear as one object to the mixer,
|
|
16
|
+
* so cache control of the individual objects must be done on the group.
|
|
17
|
+
*
|
|
18
|
+
* Limitation:
|
|
19
|
+
*
|
|
20
|
+
* - The animated properties must be compatible among the all objects in the group.
|
|
21
|
+
* - A single property can either be controlled through a target group or directly, but not both.
|
|
22
|
+
*/
|
|
23
|
+
export class AnimationObjectGroup {
|
|
24
|
+
/**
|
|
25
|
+
* Constructs a new animation group.
|
|
26
|
+
*
|
|
27
|
+
* @param {...Object3D} arguments - An arbitrary number of 3D objects that share the same animation state.
|
|
28
|
+
*/
|
|
29
|
+
constructor(...args: Object3D[]);
|
|
30
|
+
/**
|
|
31
|
+
* This flag can be used for type testing.
|
|
32
|
+
*
|
|
33
|
+
* @default true
|
|
34
|
+
*/
|
|
12
35
|
readonly isAnimationObjectGroup: true;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
36
|
+
/**
|
|
37
|
+
* The UUID of the 3D object.
|
|
38
|
+
*/
|
|
39
|
+
readonly uuid: string;
|
|
40
|
+
/**
|
|
41
|
+
* Adds an arbitrary number of objects to this animation group.
|
|
42
|
+
*
|
|
43
|
+
* @param {...Object3D} arguments - The 3D objects to add.
|
|
44
|
+
*/
|
|
45
|
+
add(...args: Object3D[]): void;
|
|
46
|
+
/**
|
|
47
|
+
* Removes an arbitrary number of objects to this animation group
|
|
48
|
+
*
|
|
49
|
+
* @param {...Object3D} arguments - The 3D objects to remove.
|
|
50
|
+
*/
|
|
51
|
+
remove(...args: Object3D[]): void;
|
|
52
|
+
/**
|
|
53
|
+
* Deallocates all memory resources for the passed 3D objects of this animation group.
|
|
54
|
+
*
|
|
55
|
+
* @param {...Object3D} arguments - The 3D objects to uncache.
|
|
56
|
+
*/
|
|
57
|
+
uncache(...args: Object3D[]): void;
|
|
17
58
|
}
|
|
@@ -1,60 +1,171 @@
|
|
|
1
|
+
import { TypedArray, TypedArrayConstructor } from "../core/BufferAttribute.js";
|
|
1
2
|
import { AnimationClip } from "./AnimationClip.js";
|
|
2
3
|
|
|
3
|
-
declare function convertArray(array: any, type: any, forceClone: boolean): any;
|
|
4
|
-
|
|
5
|
-
declare function isTypedArray(object: any): boolean;
|
|
6
|
-
|
|
7
|
-
declare function getKeyframeOrder(times: number[]): number[];
|
|
8
|
-
|
|
9
|
-
declare function sortedArray(values: any[], stride: number, order: number[]): any[];
|
|
10
|
-
|
|
11
|
-
declare function flattenJSON(jsonKeys: string[], times: any[], values: any[], valuePropertyName: string): void;
|
|
12
|
-
|
|
13
4
|
/**
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* @param
|
|
17
|
-
* @param
|
|
18
|
-
* @
|
|
5
|
+
* Converts an array to a specific type.
|
|
6
|
+
*
|
|
7
|
+
* @param {TypedArray|Array} array - The array to convert.
|
|
8
|
+
* @param {TypedArray.constructor} type - The constructor of a typed array that defines the new type.
|
|
9
|
+
* @return {TypedArray} The converted array.
|
|
10
|
+
*/
|
|
11
|
+
export function convertArray(array: TypedArray | number[], type: TypedArrayConstructor): TypedArray | number[];
|
|
12
|
+
/**
|
|
13
|
+
* Returns `true` if the given object is a typed array.
|
|
14
|
+
*
|
|
15
|
+
* @param {any} object - The object to check.
|
|
16
|
+
* @return {boolean} Whether the given object is a typed array.
|
|
17
|
+
*/
|
|
18
|
+
export function isTypedArray(object: unknown): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Returns an array by which times and values can be sorted.
|
|
21
|
+
*
|
|
22
|
+
* @param {Array<number>} times - The keyframe time values.
|
|
23
|
+
* @return {Array<number>} The array.
|
|
24
|
+
*/
|
|
25
|
+
export function getKeyframeOrder(times: Array<number>): Array<number>;
|
|
26
|
+
/**
|
|
27
|
+
* Sorts the given array by the previously computed order via `getKeyframeOrder()`.
|
|
28
|
+
*
|
|
29
|
+
* @param {Array<number>} values - The values to sort.
|
|
30
|
+
* @param {number} stride - The stride.
|
|
31
|
+
* @param {Array<number>} order - The sort order.
|
|
32
|
+
* @return {Array<number>} The sorted values.
|
|
33
|
+
*/
|
|
34
|
+
export function sortedArray(values: Array<number>, stride: number, order: Array<number>): Array<number>;
|
|
35
|
+
/**
|
|
36
|
+
* Used for parsing AOS keyframe formats.
|
|
37
|
+
*
|
|
38
|
+
* @param {Array<number>} jsonKeys - A list of JSON keyframes.
|
|
39
|
+
* @param {Array<number>} times - This array will be filled with keyframe times by this function.
|
|
40
|
+
* @param {Array<number>} values - This array will be filled with keyframe values by this function.
|
|
41
|
+
* @param {string} valuePropertyName - The name of the property to use.
|
|
42
|
+
*/
|
|
43
|
+
export function flattenJSON(
|
|
44
|
+
jsonKeys: Array<number>,
|
|
45
|
+
times: Array<number>,
|
|
46
|
+
values: Array<number>,
|
|
47
|
+
valuePropertyName: string,
|
|
48
|
+
): void;
|
|
49
|
+
/**
|
|
50
|
+
* Creates a new clip, containing only the segment of the original clip between the given frames.
|
|
51
|
+
*
|
|
52
|
+
* @param {AnimationClip} sourceClip - The values to sort.
|
|
53
|
+
* @param {string} name - The name of the clip.
|
|
54
|
+
* @param {number} startFrame - The start frame.
|
|
55
|
+
* @param {number} endFrame - The end frame.
|
|
56
|
+
* @param {number} [fps=30] - The FPS.
|
|
57
|
+
* @return {AnimationClip} The new sub clip.
|
|
19
58
|
*/
|
|
20
|
-
|
|
59
|
+
export function subclip(
|
|
21
60
|
sourceClip: AnimationClip,
|
|
22
61
|
name: string,
|
|
23
62
|
startFrame: number,
|
|
24
63
|
endFrame: number,
|
|
25
64
|
fps?: number,
|
|
26
65
|
): AnimationClip;
|
|
27
|
-
|
|
28
66
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @param
|
|
32
|
-
* @param [
|
|
67
|
+
* Converts the keyframes of the given animation clip to an additive format.
|
|
68
|
+
*
|
|
69
|
+
* @param {AnimationClip} targetClip - The clip to make additive.
|
|
70
|
+
* @param {number} [referenceFrame=0] - The reference frame.
|
|
71
|
+
* @param {AnimationClip} [referenceClip=targetClip] - The reference clip.
|
|
72
|
+
* @param {number} [fps=30] - The FPS.
|
|
73
|
+
* @return {AnimationClip} The updated clip which is now additive.
|
|
33
74
|
*/
|
|
34
|
-
|
|
75
|
+
export function makeClipAdditive(
|
|
35
76
|
targetClip: AnimationClip,
|
|
36
77
|
referenceFrame?: number,
|
|
37
78
|
referenceClip?: AnimationClip,
|
|
38
79
|
fps?: number,
|
|
39
80
|
): AnimationClip;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
81
|
+
/**
|
|
82
|
+
* A class with various methods to assist with animations.
|
|
83
|
+
*
|
|
84
|
+
* @hideconstructor
|
|
85
|
+
*/
|
|
86
|
+
export class AnimationUtils {
|
|
87
|
+
/**
|
|
88
|
+
* Converts an array to a specific type
|
|
89
|
+
*
|
|
90
|
+
* @static
|
|
91
|
+
* @param {TypedArray|Array} array - The array to convert.
|
|
92
|
+
* @param {TypedArray.constructor} type - The constructor of a type array.
|
|
93
|
+
* @return {TypedArray} The converted array
|
|
94
|
+
*/
|
|
95
|
+
static convertArray(array: TypedArray | number[], type: TypedArrayConstructor): TypedArray | number[];
|
|
96
|
+
/**
|
|
97
|
+
* Returns `true` if the given object is a typed array.
|
|
98
|
+
*
|
|
99
|
+
* @static
|
|
100
|
+
* @param {any} object - The object to check.
|
|
101
|
+
* @return {boolean} Whether the given object is a typed array.
|
|
102
|
+
*/
|
|
103
|
+
static isTypedArray(object: unknown): boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Returns an array by which times and values can be sorted.
|
|
106
|
+
*
|
|
107
|
+
* @static
|
|
108
|
+
* @param {Array<number>} times - The keyframe time values.
|
|
109
|
+
* @return {Array<number>} The array.
|
|
110
|
+
*/
|
|
111
|
+
static getKeyframeOrder(times: Array<number>): Array<number>;
|
|
112
|
+
/**
|
|
113
|
+
* Sorts the given array by the previously computed order via `getKeyframeOrder()`.
|
|
114
|
+
*
|
|
115
|
+
* @static
|
|
116
|
+
* @param {Array<number>} values - The values to sort.
|
|
117
|
+
* @param {number} stride - The stride.
|
|
118
|
+
* @param {Array<number>} order - The sort order.
|
|
119
|
+
* @return {Array<number>} The sorted values.
|
|
120
|
+
*/
|
|
121
|
+
static sortedArray(values: Array<number>, stride: number, order: Array<number>): Array<number>;
|
|
122
|
+
/**
|
|
123
|
+
* Used for parsing AOS keyframe formats.
|
|
124
|
+
*
|
|
125
|
+
* @static
|
|
126
|
+
* @param {Array<number>} jsonKeys - A list of JSON keyframes.
|
|
127
|
+
* @param {Array<number>} times - This array will be filled with keyframe times by this method.
|
|
128
|
+
* @param {Array<number>} values - This array will be filled with keyframe values by this method.
|
|
129
|
+
* @param {string} valuePropertyName - The name of the property to use.
|
|
130
|
+
*/
|
|
131
|
+
static flattenJSON(
|
|
132
|
+
jsonKeys: Array<number>,
|
|
133
|
+
times: Array<number>,
|
|
134
|
+
values: Array<number>,
|
|
135
|
+
valuePropertyName: string,
|
|
136
|
+
): void;
|
|
137
|
+
/**
|
|
138
|
+
* Creates a new clip, containing only the segment of the original clip between the given frames.
|
|
139
|
+
*
|
|
140
|
+
* @static
|
|
141
|
+
* @param {AnimationClip} sourceClip - The values to sort.
|
|
142
|
+
* @param {string} name - The name of the clip.
|
|
143
|
+
* @param {number} startFrame - The start frame.
|
|
144
|
+
* @param {number} endFrame - The end frame.
|
|
145
|
+
* @param {number} [fps=30] - The FPS.
|
|
146
|
+
* @return {AnimationClip} The new sub clip.
|
|
147
|
+
*/
|
|
148
|
+
static subclip(
|
|
149
|
+
sourceClip: AnimationClip,
|
|
150
|
+
name: string,
|
|
151
|
+
startFrame: number,
|
|
152
|
+
endFrame: number,
|
|
153
|
+
fps?: number,
|
|
154
|
+
): AnimationClip;
|
|
155
|
+
/**
|
|
156
|
+
* Converts the keyframes of the given animation clip to an additive format.
|
|
157
|
+
*
|
|
158
|
+
* @static
|
|
159
|
+
* @param {AnimationClip} targetClip - The clip to make additive.
|
|
160
|
+
* @param {number} [referenceFrame=0] - The reference frame.
|
|
161
|
+
* @param {AnimationClip} [referenceClip=targetClip] - The reference clip.
|
|
162
|
+
* @param {number} [fps=30] - The FPS.
|
|
163
|
+
* @return {AnimationClip} The updated clip which is now additive.
|
|
164
|
+
*/
|
|
165
|
+
static makeClipAdditive(
|
|
166
|
+
targetClip: AnimationClip,
|
|
167
|
+
referenceFrame?: number,
|
|
168
|
+
referenceClip?: AnimationClip,
|
|
169
|
+
fps?: number,
|
|
170
|
+
): AnimationClip;
|
|
171
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { InterpolationModes } from "../constants.js";
|
|
2
|
-
import {
|
|
2
|
+
import { TypedArray, TypedArrayConstructor } from "../core/BufferAttribute.js";
|
|
3
3
|
import { CubicInterpolant } from "../math/interpolants/CubicInterpolant.js";
|
|
4
4
|
import { DiscreteInterpolant } from "../math/interpolants/DiscreteInterpolant.js";
|
|
5
5
|
import { LinearInterpolant } from "../math/interpolants/LinearInterpolant.js";
|
|
@@ -12,44 +12,153 @@ export interface KeyframeTrackJSON {
|
|
|
12
12
|
type: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
+
/**
|
|
16
|
+
* Represents s a timed sequence of keyframes, which are composed of lists of
|
|
17
|
+
* times and related values, and which are used to animate a specific property
|
|
18
|
+
* of an object.
|
|
19
|
+
*/
|
|
15
20
|
export class KeyframeTrack {
|
|
16
21
|
/**
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
* @
|
|
20
|
-
* @param
|
|
22
|
+
* Converts the keyframe track to JSON.
|
|
23
|
+
*
|
|
24
|
+
* @static
|
|
25
|
+
* @param {KeyframeTrack} track - The keyframe track to serialize.
|
|
26
|
+
* @return {Object} The serialized keyframe track as JSON.
|
|
27
|
+
*/
|
|
28
|
+
static toJSON(track: KeyframeTrack): KeyframeTrackJSON;
|
|
29
|
+
/**
|
|
30
|
+
* Constructs a new keyframe track.
|
|
31
|
+
*
|
|
32
|
+
* @param {string} name - The keyframe track's name.
|
|
33
|
+
* @param {Array<number>} times - A list of keyframe times.
|
|
34
|
+
* @param {Array<number>} values - A list of keyframe values.
|
|
35
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} [interpolation] - The interpolation type.
|
|
36
|
+
*/
|
|
37
|
+
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<number>, interpolation?: InterpolationModes);
|
|
38
|
+
/**
|
|
39
|
+
* The track's name can refer to morph targets or bones or
|
|
40
|
+
* possibly other values within an animated object. See {@link PropertyBinding#parseTrackName}
|
|
41
|
+
* for the forms of strings that can be parsed for property binding.
|
|
21
42
|
*/
|
|
22
|
-
constructor(name: string, times: ArrayLike<number>, values: ArrayLike<any>, interpolation?: InterpolationModes);
|
|
23
|
-
|
|
24
43
|
name: string;
|
|
44
|
+
/**
|
|
45
|
+
* The keyframe times.
|
|
46
|
+
*/
|
|
25
47
|
times: Float32Array;
|
|
48
|
+
/**
|
|
49
|
+
* The keyframe values.
|
|
50
|
+
*/
|
|
26
51
|
values: Float32Array;
|
|
27
|
-
|
|
28
|
-
ValueTypeName: string;
|
|
29
|
-
TimeBufferType: Float32Array;
|
|
30
|
-
ValueBufferType: Float32Array;
|
|
31
|
-
|
|
32
52
|
/**
|
|
33
|
-
*
|
|
53
|
+
* Factory method for creating a new discrete interpolant.
|
|
54
|
+
*
|
|
55
|
+
* @static
|
|
56
|
+
* @param {TypedArray} [result] - The result buffer.
|
|
57
|
+
* @return {DiscreteInterpolant} The new interpolant.
|
|
58
|
+
*/
|
|
59
|
+
InterpolantFactoryMethodDiscrete(result?: TypedArray): DiscreteInterpolant;
|
|
60
|
+
/**
|
|
61
|
+
* Factory method for creating a new linear interpolant.
|
|
62
|
+
*
|
|
63
|
+
* @static
|
|
64
|
+
* @param {TypedArray} [result] - The result buffer.
|
|
65
|
+
* @return {LinearInterpolant} The new interpolant.
|
|
66
|
+
*/
|
|
67
|
+
InterpolantFactoryMethodLinear(result?: TypedArray): LinearInterpolant;
|
|
68
|
+
/**
|
|
69
|
+
* Factory method for creating a new smooth interpolant.
|
|
70
|
+
*
|
|
71
|
+
* @static
|
|
72
|
+
* @param {TypedArray} [result] - The result buffer.
|
|
73
|
+
* @return {CubicInterpolant} The new interpolant.
|
|
74
|
+
*/
|
|
75
|
+
InterpolantFactoryMethodSmooth(result?: TypedArray): CubicInterpolant;
|
|
76
|
+
/**
|
|
77
|
+
* Defines the interpolation factor method for this keyframe track.
|
|
78
|
+
*
|
|
79
|
+
* @param {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} interpolation - The interpolation type.
|
|
80
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
34
81
|
*/
|
|
35
|
-
DefaultInterpolation: InterpolationModes;
|
|
36
|
-
|
|
37
|
-
InterpolantFactoryMethodDiscrete(result: any): DiscreteInterpolant;
|
|
38
|
-
InterpolantFactoryMethodLinear(result: any): LinearInterpolant;
|
|
39
|
-
InterpolantFactoryMethodSmooth(result: any): CubicInterpolant;
|
|
40
|
-
|
|
41
82
|
setInterpolation(interpolation: InterpolationModes): KeyframeTrack;
|
|
83
|
+
/**
|
|
84
|
+
* Returns the current interpolation type.
|
|
85
|
+
*
|
|
86
|
+
* @return {(InterpolateLinear|InterpolateDiscrete|InterpolateSmooth)} The interpolation type.
|
|
87
|
+
*/
|
|
42
88
|
getInterpolation(): InterpolationModes;
|
|
43
|
-
|
|
44
|
-
|
|
89
|
+
/**
|
|
90
|
+
* Returns the value size.
|
|
91
|
+
*
|
|
92
|
+
* @return {number} The value size.
|
|
93
|
+
*/
|
|
45
94
|
getValueSize(): number;
|
|
46
|
-
|
|
95
|
+
/**
|
|
96
|
+
* Moves all keyframes either forward or backward in time.
|
|
97
|
+
*
|
|
98
|
+
* @param {number} timeOffset - The offset to move the time values.
|
|
99
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
100
|
+
*/
|
|
47
101
|
shift(timeOffset: number): KeyframeTrack;
|
|
102
|
+
/**
|
|
103
|
+
* Scale all keyframe times by a factor (useful for frame - seconds conversions).
|
|
104
|
+
*
|
|
105
|
+
* @param {number} timeScale - The time scale.
|
|
106
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
107
|
+
*/
|
|
48
108
|
scale(timeScale: number): KeyframeTrack;
|
|
109
|
+
/**
|
|
110
|
+
* Removes keyframes before and after animation without changing any values within the defined time range.
|
|
111
|
+
*
|
|
112
|
+
* Note: The method does not shift around keys to the start of the track time, because for interpolated
|
|
113
|
+
* keys this will change their values
|
|
114
|
+
*
|
|
115
|
+
* @param {number} startTime - The start time.
|
|
116
|
+
* @param {number} endTime - The end time.
|
|
117
|
+
* @return {KeyframeTrack} A reference to this keyframe track.
|
|
118
|
+
*/
|
|
49
119
|
trim(startTime: number, endTime: number): KeyframeTrack;
|
|
120
|
+
/**
|
|
121
|
+
* Performs minimal validation on the keyframe track. Returns `true` if the values
|
|
122
|
+
* are valid.
|
|
123
|
+
*
|
|
124
|
+
* @return {boolean} Whether the keyframes are valid or not.
|
|
125
|
+
*/
|
|
50
126
|
validate(): boolean;
|
|
51
|
-
|
|
127
|
+
/**
|
|
128
|
+
* Optimizes this keyframe track by removing equivalent sequential keys (which are
|
|
129
|
+
* common in morph target sequences).
|
|
130
|
+
*
|
|
131
|
+
* @return {AnimationClip} A reference to this animation clip.
|
|
132
|
+
*/
|
|
133
|
+
optimize(): this;
|
|
134
|
+
/**
|
|
135
|
+
* Returns a new keyframe track with copied values from this instance.
|
|
136
|
+
*
|
|
137
|
+
* @return {KeyframeTrack} A clone of this instance.
|
|
138
|
+
*/
|
|
52
139
|
clone(): this;
|
|
53
|
-
|
|
54
|
-
|
|
140
|
+
/**
|
|
141
|
+
* The value type name.
|
|
142
|
+
*
|
|
143
|
+
* @default ''
|
|
144
|
+
*/
|
|
145
|
+
ValueTypeName: string;
|
|
146
|
+
/**
|
|
147
|
+
* The time buffer type of this keyframe track.
|
|
148
|
+
*
|
|
149
|
+
* @default Float32Array.constructor
|
|
150
|
+
*/
|
|
151
|
+
TimeBufferType: TypedArrayConstructor | ArrayConstructor;
|
|
152
|
+
/**
|
|
153
|
+
* The value buffer type of this keyframe track.
|
|
154
|
+
*
|
|
155
|
+
* @default Float32Array.constructor
|
|
156
|
+
*/
|
|
157
|
+
ValueBufferType: TypedArrayConstructor | ArrayConstructor;
|
|
158
|
+
/**
|
|
159
|
+
* The default interpolation type of this keyframe track.
|
|
160
|
+
*
|
|
161
|
+
* @default InterpolateLinear
|
|
162
|
+
*/
|
|
163
|
+
DefaultInterpolation: InterpolationModes;
|
|
55
164
|
}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { Object3D } from "../core/Object3D.js";
|
|
2
|
+
import { Skeleton } from "../objects/Skeleton.js";
|
|
3
|
+
|
|
1
4
|
export interface ParseTrackNameResults {
|
|
2
5
|
nodeName: string;
|
|
3
6
|
objectName: string;
|
|
@@ -6,38 +9,93 @@ export interface ParseTrackNameResults {
|
|
|
6
9
|
propertyIndex: string;
|
|
7
10
|
}
|
|
8
11
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
12
|
+
/**
|
|
13
|
+
* This holds a reference to a real property in the scene graph; used internally.
|
|
14
|
+
*/
|
|
15
|
+
export class PropertyBinding {
|
|
16
|
+
/**
|
|
17
|
+
* Factory method for creating a property binding from the given parameters.
|
|
18
|
+
*
|
|
19
|
+
* @static
|
|
20
|
+
* @param {Object} root - The root node.
|
|
21
|
+
* @param {string} path - The path.
|
|
22
|
+
* @param {?Object} [parsedPath] - The parsed path.
|
|
23
|
+
* @return {PropertyBinding|Composite} The created property binding or composite.
|
|
24
|
+
*/
|
|
25
|
+
static create(root: object, path: string, parsedPath?: object | null): PropertyBinding | Composite;
|
|
26
|
+
/**
|
|
27
|
+
* Replaces spaces with underscores and removes unsupported characters from
|
|
28
|
+
* node names, to ensure compatibility with parseTrackName().
|
|
29
|
+
*
|
|
30
|
+
* @param {string} name - Node name to be sanitized.
|
|
31
|
+
* @return {string} The sanitized node name.
|
|
32
|
+
*/
|
|
33
|
+
static sanitizeNodeName(name: string): string;
|
|
34
|
+
/**
|
|
35
|
+
* Parses the given track name (an object path to an animated property) and
|
|
36
|
+
* returns an object with information about the path. Matches strings in the following forms:
|
|
37
|
+
*
|
|
38
|
+
* - nodeName.property
|
|
39
|
+
* - nodeName.property[accessor]
|
|
40
|
+
* - nodeName.material.property[accessor]
|
|
41
|
+
* - uuid.property[accessor]
|
|
42
|
+
* - uuid.objectName[objectIndex].propertyName[propertyIndex]
|
|
43
|
+
* - parentName/nodeName.property
|
|
44
|
+
* - parentName/parentName/nodeName.property[index]
|
|
45
|
+
* - .bone[Armature.DEF_cog].position
|
|
46
|
+
* - scene:helium_balloon_model:helium_balloon_model.position
|
|
47
|
+
*
|
|
48
|
+
* @static
|
|
49
|
+
* @param {string} trackName - The track name to parse.
|
|
50
|
+
* @return {Object} The parsed track name as an object.
|
|
51
|
+
*/
|
|
52
|
+
static parseTrackName(trackName: string): ParseTrackNameResults;
|
|
53
|
+
/**
|
|
54
|
+
* Searches for a node in the hierarchy of the given root object by the given
|
|
55
|
+
* node name.
|
|
56
|
+
*
|
|
57
|
+
* @static
|
|
58
|
+
* @param {Object} root - The root object.
|
|
59
|
+
* @param {string|number} nodeName - The name of the node.
|
|
60
|
+
* @return {?Object} The found node. Returns `null` if no object was found.
|
|
61
|
+
*/
|
|
62
|
+
static findNode(root: object, nodeName: string | number): object | null;
|
|
63
|
+
/**
|
|
64
|
+
* Constructs a new property binding.
|
|
65
|
+
*
|
|
66
|
+
* @param {Object} rootNode - The root node.
|
|
67
|
+
* @param {string} path - The path.
|
|
68
|
+
* @param {?Object} [parsedPath] - The parsed path.
|
|
69
|
+
*/
|
|
70
|
+
constructor(rootNode: Object3D | Skeleton, path: string, parsedPath?: object | null);
|
|
71
|
+
/**
|
|
72
|
+
* The object path to the animated property.
|
|
73
|
+
*/
|
|
21
74
|
path: string;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
75
|
+
/**
|
|
76
|
+
* An object holding information about the path.
|
|
77
|
+
*/
|
|
78
|
+
parsedPath: object;
|
|
79
|
+
/**
|
|
80
|
+
* The object owns the animated property.
|
|
81
|
+
*/
|
|
82
|
+
node: object | null;
|
|
83
|
+
/**
|
|
84
|
+
* The root node.
|
|
85
|
+
*/
|
|
86
|
+
rootNode: Object3D | Skeleton;
|
|
87
|
+
/**
|
|
88
|
+
* Creates a getter / setter pair for the property tracked by this binding.
|
|
89
|
+
*/
|
|
28
90
|
bind(): void;
|
|
91
|
+
/**
|
|
92
|
+
* Unbinds the property.
|
|
93
|
+
*/
|
|
29
94
|
unbind(): void;
|
|
30
|
-
|
|
31
|
-
BindingType: { [bindingType: string]: number };
|
|
32
|
-
Versioning: { [versioning: string]: number };
|
|
33
|
-
|
|
34
|
-
GetterByBindingType: Array<() => void>;
|
|
35
|
-
SetterByBindingTypeAndVersioning: Array<Array<() => void>>;
|
|
36
|
-
|
|
37
|
-
static create(root: any, path: any, parsedPath?: any): PropertyBinding | Composite;
|
|
38
|
-
static sanitizeNodeName(name: string): string;
|
|
39
|
-
static parseTrackName(trackName: string): ParseTrackNameResults;
|
|
40
|
-
static findNode(root: any, nodeName: string): any;
|
|
41
95
|
}
|
|
42
|
-
|
|
43
|
-
export {
|
|
96
|
+
export namespace PropertyBinding {
|
|
97
|
+
export { Composite };
|
|
98
|
+
}
|
|
99
|
+
declare class Composite {
|
|
100
|
+
}
|
|
101
|
+
export {};
|
|
@@ -1,17 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
constructor(binding: any, typeName: string, valueSize: number);
|
|
1
|
+
import { PropertyBinding } from "./PropertyBinding.js";
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Buffered scene graph property that allows weighted accumulation; used internally.
|
|
5
|
+
*/
|
|
6
|
+
export class PropertyMixer {
|
|
7
|
+
/**
|
|
8
|
+
* Constructs a new property mixer.
|
|
9
|
+
*
|
|
10
|
+
* @param {PropertyBinding} binding - The property binding.
|
|
11
|
+
* @param {string} typeName - The keyframe track type name.
|
|
12
|
+
* @param {number} valueSize - The keyframe track value size.
|
|
13
|
+
*/
|
|
14
|
+
constructor(binding: PropertyBinding, typeName: string, valueSize: number);
|
|
15
|
+
/**
|
|
16
|
+
* The property binding.
|
|
17
|
+
*/
|
|
18
|
+
binding: PropertyBinding;
|
|
19
|
+
/**
|
|
20
|
+
* The keyframe track value size.
|
|
21
|
+
*/
|
|
5
22
|
valueSize: number;
|
|
6
|
-
|
|
23
|
+
/**
|
|
24
|
+
* TODO
|
|
25
|
+
*
|
|
26
|
+
* @default 0
|
|
27
|
+
*/
|
|
7
28
|
cumulativeWeight: number;
|
|
29
|
+
/**
|
|
30
|
+
* TODO
|
|
31
|
+
*
|
|
32
|
+
* @default 0
|
|
33
|
+
*/
|
|
8
34
|
cumulativeWeightAdditive: number;
|
|
35
|
+
/**
|
|
36
|
+
* TODO
|
|
37
|
+
*
|
|
38
|
+
* @default 0
|
|
39
|
+
*/
|
|
9
40
|
useCount: number;
|
|
41
|
+
/**
|
|
42
|
+
* TODO
|
|
43
|
+
*
|
|
44
|
+
* @default 0
|
|
45
|
+
*/
|
|
10
46
|
referenceCount: number;
|
|
11
|
-
|
|
47
|
+
/**
|
|
48
|
+
* Accumulates data in the `incoming` region into `accu<i>`.
|
|
49
|
+
*
|
|
50
|
+
* @param {number} accuIndex - The accumulation index.
|
|
51
|
+
* @param {number} weight - The weight.
|
|
52
|
+
*/
|
|
12
53
|
accumulate(accuIndex: number, weight: number): void;
|
|
54
|
+
/**
|
|
55
|
+
* Accumulates data in the `incoming` region into `add`.
|
|
56
|
+
*
|
|
57
|
+
* @param {number} weight - The weight.
|
|
58
|
+
*/
|
|
13
59
|
accumulateAdditive(weight: number): void;
|
|
60
|
+
/**
|
|
61
|
+
* Applies the state of `accu<i>` to the binding when accus differ.
|
|
62
|
+
*
|
|
63
|
+
* @param {number} accuIndex - The accumulation index.
|
|
64
|
+
*/
|
|
14
65
|
apply(accuIndex: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* Remembers the state of the bound property and copy it to both accus.
|
|
68
|
+
*/
|
|
15
69
|
saveOriginalState(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Applies the state previously taken via {@link PropertyMixer#saveOriginalState} to the binding.
|
|
72
|
+
*/
|
|
16
73
|
restoreOriginalState(): void;
|
|
17
74
|
}
|