@galacean/engine-math 0.0.0-experimental-animator-additive.1

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.
@@ -0,0 +1,316 @@
1
+ import { IClone } from "./IClone";
2
+ import { ICopy } from "./ICopy";
3
+ import { Matrix } from "./Matrix";
4
+ import { Quaternion } from "./Quaternion";
5
+ import { Vector4 } from "./Vector4";
6
+ /**
7
+ * Describes a 3D-vector.
8
+ */
9
+ export declare class Vector3 implements IClone<Vector3>, ICopy<Vector3Like, Vector3> {
10
+ /**
11
+ * Determines the sum of two vectors.
12
+ * @param left - The first vector to add
13
+ * @param right - The second vector to add
14
+ * @param out - The sum of two vectors
15
+ */
16
+ static add(left: Vector3, right: Vector3, out: Vector3): void;
17
+ /**
18
+ * Determines the difference between two vectors.
19
+ * @param left - The first vector to subtract
20
+ * @param right - The second vector to subtract
21
+ * @param out - The difference between two vectors
22
+ */
23
+ static subtract(left: Vector3, right: Vector3, out: Vector3): void;
24
+ /**
25
+ * Determines the product of two vectors.
26
+ * @param left - The first vector to multiply
27
+ * @param right - The second vector to multiply
28
+ * @param out - The product of two vectors
29
+ */
30
+ static multiply(left: Vector3, right: Vector3, out: Vector3): void;
31
+ /**
32
+ * Determines the divisor of two vectors.
33
+ * @param left - The first vector to divide
34
+ * @param right - The second vector to divide
35
+ * @param out - The divisor of two vectors
36
+ */
37
+ static divide(left: Vector3, right: Vector3, out: Vector3): void;
38
+ /**
39
+ * Determines the dot product of two vectors.
40
+ * @param left - The first vector to dot
41
+ * @param right - The second vector to dot
42
+ * @returns The dot product of two vectors
43
+ */
44
+ static dot(left: Vector3, right: Vector3): number;
45
+ /**
46
+ * Determines the cross product of two vectors.
47
+ * @param left - The first vector to cross
48
+ * @param right - The second vector to cross
49
+ * @param out - The cross product of two vectors
50
+ */
51
+ static cross(left: Vector3, right: Vector3, out: Vector3): void;
52
+ /**
53
+ * Determines the distance of two vectors.
54
+ * @param a - The first vector
55
+ * @param b - The second vector
56
+ * @returns The distance of two vectors
57
+ */
58
+ static distance(a: Vector3, b: Vector3): number;
59
+ /**
60
+ * Determines the squared distance of two vectors.
61
+ * @param a - The first vector
62
+ * @param b - The second vector
63
+ * @returns The squared distance of two vectors
64
+ */
65
+ static distanceSquared(a: Vector3, b: Vector3): number;
66
+ /**
67
+ * Determines whether the specified vectors are equals.
68
+ * @param left - The first vector to compare
69
+ * @param right - The second vector to compare
70
+ * @returns True if the specified vectors are equals, false otherwise
71
+ */
72
+ static equals(left: Vector3, right: Vector3): boolean;
73
+ /**
74
+ * Performs a linear interpolation between two vectors.
75
+ * @param start - The first vector
76
+ * @param end - The second vector
77
+ * @param t - The blend amount where 0 returns start and 1 end
78
+ * @param out - The result of linear blending between two vectors
79
+ */
80
+ static lerp(start: Vector3, end: Vector3, t: number, out: Vector3): void;
81
+ /**
82
+ * Calculate a vector containing the largest components of the specified vectors.
83
+ * @param left - The first vector
84
+ * @param right - The second vector
85
+ * @param out - The vector containing the largest components of the specified vectors
86
+ */
87
+ static max(left: Vector3, right: Vector3, out: Vector3): void;
88
+ /**
89
+ * Calculate a vector containing the smallest components of the specified vectors.
90
+ * @param left - The first vector
91
+ * @param right - The second vector
92
+ * @param out - The vector containing the smallest components of the specified vectors
93
+ */
94
+ static min(left: Vector3, right: Vector3, out: Vector3): void;
95
+ /**
96
+ * Reverses the direction of a given vector.
97
+ * @param a - The vector to negate
98
+ * @param out - The vector facing in the opposite direction
99
+ */
100
+ static negate(a: Vector3, out: Vector3): void;
101
+ /**
102
+ * Converts the vector into a unit vector.
103
+ * @param a - The vector to normalize
104
+ * @param out - The normalized vector
105
+ */
106
+ static normalize(a: Vector3, out: Vector3): void;
107
+ /**
108
+ * Scale a vector by the given value.
109
+ * @param a - The vector to scale
110
+ * @param s - The amount by which to scale the vector
111
+ * @param out - The scaled vector
112
+ */
113
+ static scale(a: Vector3, s: number, out: Vector3): void;
114
+ /**
115
+ * Performs a normal transformation using the given 4x4 matrix.
116
+ * @remarks
117
+ * A normal transform performs the transformation with the assumption that the w component
118
+ * is zero. This causes the fourth row and fourth column of the matrix to be unused. The
119
+ * end result is a vector that is not translated, but all other transformation properties
120
+ * apply. This is often preferred for normal vectors as normals purely represent direction
121
+ * rather than location because normal vectors should not be translated.
122
+ * @param v - The normal vector to transform
123
+ * @param m - The transform matrix
124
+ * @param out - The transformed normal
125
+ */
126
+ static transformNormal(v: Vector3, m: Matrix, out: Vector3): void;
127
+ /**
128
+ * Performs a transformation using the given 4x4 matrix.
129
+ * @param v - The vector to transform
130
+ * @param m - The transform matrix
131
+ * @param out - The transformed vector3
132
+ */
133
+ static transformToVec3(v: Vector3, m: Matrix, out: Vector3): void;
134
+ /**
135
+ * Performs a transformation from vector3 to vector4 using the given 4x4 matrix.
136
+ * @param v - The vector to transform
137
+ * @param m - The transform matrix
138
+ * @param out - The transformed vector4
139
+ */
140
+ static transformToVec4(v: Vector3, m: Matrix, out: Vector4): void;
141
+ /**
142
+ * Performs a coordinate transformation using the given 4x4 matrix.
143
+ *
144
+ * @remarks
145
+ * A coordinate transform performs the transformation with the assumption that the w component
146
+ * is one. The four dimensional vector obtained from the transformation operation has each
147
+ * component in the vector divided by the w component. This forces the w-component to be one and
148
+ * therefore makes the vector homogeneous. The homogeneous vector is often preferred when working
149
+ * with coordinates as the w component can safely be ignored.
150
+ * @param v - The coordinate vector to transform
151
+ * @param m - The transform matrix
152
+ * @param out - The transformed coordinates
153
+ */
154
+ static transformCoordinate(v: Vector3, m: Matrix, out: Vector3): void;
155
+ /**
156
+ * Performs a transformation using the given quaternion.
157
+ * @param v - The vector to transform
158
+ * @param quaternion - The transform quaternion
159
+ * @param out - The transformed vector
160
+ */
161
+ static transformByQuat(v: Vector3, quaternion: Quaternion, out: Vector3): void;
162
+ /**
163
+ * The x component of the vector.
164
+ */
165
+ get x(): number;
166
+ set x(value: number);
167
+ /**
168
+ * The y component of the vector.
169
+ */
170
+ get y(): number;
171
+ set y(value: number);
172
+ /**
173
+ * The z component of the vector.
174
+ */
175
+ get z(): number;
176
+ set z(value: number);
177
+ /**
178
+ * Constructor of Vector3.
179
+ * @param x - The x component of the vector, default 0
180
+ * @param y - The y component of the vector, default 0
181
+ * @param z - The z component of the vector, default 0
182
+ */
183
+ constructor(x?: number, y?: number, z?: number);
184
+ /**
185
+ * Set the value of this vector.
186
+ * @param x - The x component of the vector
187
+ * @param y - The y component of the vector
188
+ * @param z - The z component of the vector
189
+ * @returns This vector
190
+ */
191
+ set(x: number, y: number, z: number): Vector3;
192
+ /**
193
+ * Determines the sum of this vector and the specified vector.
194
+ * @param right - The specified vector
195
+ * @returns This vector
196
+ */
197
+ add(right: Vector3): Vector3;
198
+ /**
199
+ * Determines the difference of this vector and the specified vector.
200
+ * @param right - The specified vector
201
+ * @returns This vector
202
+ */
203
+ subtract(right: Vector3): Vector3;
204
+ /**
205
+ * Determines the product of this vector and the specified vector.
206
+ * @param right - The specified vector
207
+ * @returns This vector
208
+ */
209
+ multiply(right: Vector3): Vector3;
210
+ /**
211
+ * Determines the divisor of this vector and the specified vector.
212
+ * @param right - The specified vector
213
+ * @returns This vector
214
+ */
215
+ divide(right: Vector3): Vector3;
216
+ /**
217
+ * Calculate the length of this vector.
218
+ * @returns The length of this vector
219
+ */
220
+ length(): number;
221
+ /**
222
+ * Calculate the squared length of this vector.
223
+ * @returns The squared length of this vector
224
+ */
225
+ lengthSquared(): number;
226
+ /**
227
+ * Reverses the direction of this vector.
228
+ * @returns This vector
229
+ */
230
+ negate(): Vector3;
231
+ /**
232
+ * Converts this vector into a unit vector.
233
+ * @returns This vector
234
+ */
235
+ normalize(): Vector3;
236
+ /**
237
+ * Scale this vector by the given value.
238
+ * @param s - The amount by which to scale the vector
239
+ * @returns This vector
240
+ */
241
+ scale(s: number): Vector3;
242
+ /**
243
+ * This vector performs a normal transformation using the given 4x4 matrix.
244
+ * @remarks
245
+ * A normal transform performs the transformation with the assumption that the w component
246
+ * is zero. This causes the fourth row and fourth column of the matrix to be unused. The
247
+ * end result is a vector that is not translated, but all other transformation properties
248
+ * apply. This is often preferred for normal vectors as normals purely represent direction
249
+ * rather than location because normal vectors should not be translated.
250
+ * @param m - The transform matrix
251
+ * @returns This vector
252
+ */
253
+ transformNormal(m: Matrix): Vector3;
254
+ /**
255
+ * This vector performs a transformation using the given 4x4 matrix.
256
+ * @param m - The transform matrix
257
+ * @returns This vector
258
+ */
259
+ transformToVec3(m: Matrix): Vector3;
260
+ /**
261
+ * This vector performs a coordinate transformation using the given 4x4 matrix.
262
+ * @remarks
263
+ * A coordinate transform performs the transformation with the assumption that the w component
264
+ * is one. The four dimensional vector obtained from the transformation operation has each
265
+ * component in the vector divided by the w component. This forces the w-component to be one and
266
+ * therefore makes the vector homogeneous. The homogeneous vector is often preferred when working
267
+ * with coordinates as the w component can safely be ignored.
268
+ * @param m - The transform matrix
269
+ * @returns This vector
270
+ */
271
+ transformCoordinate(m: Matrix): Vector3;
272
+ /**
273
+ * This vector performs a transformation using the given quaternion.
274
+ * @param quaternion - The transform quaternion
275
+ * @returns This vector
276
+ */
277
+ transformByQuat(quaternion: Quaternion): Vector3;
278
+ /**
279
+ * Creates a clone of this vector.
280
+ * @returns A clone of this vector
281
+ */
282
+ clone(): Vector3;
283
+ /**
284
+ * Copy from vector3 like object.
285
+ * @param source - Vector3 like object.
286
+ * @returns This vector
287
+ */
288
+ copyFrom(source: Vector3Like): Vector3;
289
+ /**
290
+ * Copy the value of this vector from an array.
291
+ * @param array - The array
292
+ * @param offset - The start offset of the array
293
+ * @returns This vector
294
+ */
295
+ copyFromArray(array: ArrayLike<number>, offset?: number): Vector3;
296
+ /**
297
+ * Copy the value of this vector to an array.
298
+ * @param out - The array
299
+ * @param outOffset - The start offset of the array
300
+ */
301
+ copyToArray(out: number[] | Float32Array | Float64Array, outOffset?: number): void;
302
+ /**
303
+ * Serialize this vector to a JSON representation.
304
+ * @returns A JSON representation of this vector
305
+ */
306
+ toJSON(): Vector3Like;
307
+ }
308
+ interface Vector3Like {
309
+ /** {@inheritDoc Vector3.x} */
310
+ x: number;
311
+ /** {@inheritDoc Vector3.y} */
312
+ y: number;
313
+ /** {@inheritDoc Vector3.z} */
314
+ z: number;
315
+ }
316
+ export {};
@@ -0,0 +1,247 @@
1
+ import { IClone } from "./IClone";
2
+ import { ICopy } from "./ICopy";
3
+ import { Matrix } from "./Matrix";
4
+ import { Quaternion } from "./Quaternion";
5
+ /**
6
+ * Describes a 4D-vector.
7
+ */
8
+ export declare class Vector4 implements IClone<Vector4>, ICopy<Vector4Like, Vector4> {
9
+ /**
10
+ * Determines the sum of two vectors.
11
+ * @param left - The first vector to add
12
+ * @param right - The second vector to add
13
+ * @param out - The sum of two vectors
14
+ */
15
+ static add(left: Vector4, right: Vector4, out: Vector4): void;
16
+ /**
17
+ * Determines the difference between two vectors.
18
+ * @param left - The first vector to subtract
19
+ * @param right - The second vector to subtract
20
+ * @param out - The difference between two vectors
21
+ */
22
+ static subtract(left: Vector4, right: Vector4, out: Vector4): void;
23
+ /**
24
+ * Determines the product of two vectors.
25
+ * @param left - The first vector to multiply
26
+ * @param right - The second vector to multiply
27
+ * @param out - The product of two vectors
28
+ */
29
+ static multiply(left: Vector4, right: Vector4, out: Vector4): void;
30
+ /**
31
+ * Determines the divisor of two vectors.
32
+ * @param left - The first vector to divide
33
+ * @param right - The second vector to divide
34
+ * @param out - The divisor of two vectors
35
+ */
36
+ static divide(left: Vector4, right: Vector4, out: Vector4): void;
37
+ /**
38
+ * Determines the dot product of two vectors.
39
+ * @param left - The first vector to dot
40
+ * @param right - The second vector to dot
41
+ * @returns The dot product of two vectors
42
+ */
43
+ static dot(left: Vector4, right: Vector4): number;
44
+ /**
45
+ * Determines the distance of two vectors.
46
+ * @param a - The first vector
47
+ * @param b - The second vector
48
+ * @returns The distance of two vectors
49
+ */
50
+ static distance(a: Vector4, b: Vector4): number;
51
+ /**
52
+ * Determines the squared distance of two vectors.
53
+ * @param a - The first vector
54
+ * @param b - The second vector
55
+ * @returns The squared distance of two vectors
56
+ */
57
+ static distanceSquared(a: Vector4, b: Vector4): number;
58
+ /**
59
+ * Determines whether the specified vectors are equals.
60
+ * @param left - The first vector to compare
61
+ * @param right - The second vector to compare
62
+ * @returns True if the specified vectors are equals, false otherwise
63
+ */
64
+ static equals(left: Vector4, right: Vector4): boolean;
65
+ /**
66
+ * Performs a linear interpolation between two vectors.
67
+ * @param start - The first vector
68
+ * @param end - The second vector
69
+ * @param t - The blend amount where 0 returns start and 1 end
70
+ * @param out - The result of linear blending between two vectors
71
+ */
72
+ static lerp(start: Vector4, end: Vector4, t: number, out: Vector4): void;
73
+ /**
74
+ * Calculate a vector containing the largest components of the specified vectors.
75
+ * @param left - The first vector
76
+ * @param right - The second vector
77
+ * @param out - The vector containing the largest components of the specified vectors
78
+ */
79
+ static max(left: Vector4, right: Vector4, out: Vector4): void;
80
+ /**
81
+ * Calculate a vector containing the smallest components of the specified vectors.
82
+ * @param left - The first vector
83
+ * @param right - The second vector
84
+ * @param out - The vector containing the smallest components of the specified vectors
85
+ */
86
+ static min(left: Vector4, right: Vector4, out: Vector4): void;
87
+ /**
88
+ * Reverses the direction of a given vector.
89
+ * @param a - The vector to negate
90
+ * @param out - The vector facing in the opposite direction
91
+ */
92
+ static negate(a: Vector4, out: Vector4): void;
93
+ /**
94
+ * Converts the vector into a unit vector.
95
+ * @param a - The vector to normalize
96
+ * @param out - The normalized vector
97
+ */
98
+ static normalize(a: Vector4, out: Vector4): void;
99
+ /**
100
+ * Scale a vector by the given value.
101
+ * @param a - The vector to scale
102
+ * @param s - The amount by which to scale the vector
103
+ * @param out - The scaled vector
104
+ */
105
+ static scale(a: Vector4, s: number, out: Vector4): void;
106
+ /**
107
+ * Performs a transformation using the given 4x4 matrix.
108
+ * @param v - The vector to transform
109
+ * @param m - The transform matrix
110
+ * @param out - The transformed vector3
111
+ */
112
+ static transform(v: Vector4, m: Matrix, out: Vector4): void;
113
+ /**
114
+ * Performs a transformation using the given quaternion.
115
+ * @param v - The vector to transform
116
+ * @param q - The transform quaternion
117
+ * @param out - The transformed vector
118
+ */
119
+ static transformByQuat(v: Vector4, q: Quaternion, out: Vector4): void;
120
+ /**
121
+ * The x component of the vector.
122
+ */
123
+ get x(): number;
124
+ set x(value: number);
125
+ /**
126
+ * The y component of the vector.
127
+ */
128
+ get y(): number;
129
+ set y(value: number);
130
+ /**
131
+ * The z component of the vector.
132
+ */
133
+ get z(): number;
134
+ set z(value: number);
135
+ /**
136
+ * The w component of the vector.
137
+ */
138
+ get w(): number;
139
+ set w(value: number);
140
+ /**
141
+ * Constructor of Vector4.
142
+ * @param x - The x component of the vector, default 0
143
+ * @param y - The y component of the vector, default 0
144
+ * @param z - The z component of the vector, default 0
145
+ * @param w - The w component of the vector, default 0
146
+ */
147
+ constructor(x?: number, y?: number, z?: number, w?: number);
148
+ /**
149
+ * Set the value of this vector.
150
+ * @param x - The x component of the vector
151
+ * @param y - The y component of the vector
152
+ * @param z - The z component of the vector
153
+ * @param w - The w component of the vector
154
+ * @returns This vector
155
+ */
156
+ set(x: number, y: number, z: number, w: number): Vector4;
157
+ /**
158
+ * Determines the sum of this vector and the specified vector.
159
+ * @param right - The specified vector
160
+ * @returns This vector
161
+ */
162
+ add(right: Vector4): Vector4;
163
+ /**
164
+ * Determines the difference of this vector and the specified vector.
165
+ * @param right - the specified vector
166
+ * @returns This vector
167
+ */
168
+ subtract(right: Vector4): Vector4;
169
+ /**
170
+ * Determines the product of this vector and the specified vector.
171
+ * @param right - the specified vector
172
+ * @returns This vector
173
+ */
174
+ multiply(right: Vector4): Vector4;
175
+ /**
176
+ * Determines the divisor of this vector and the specified vector.
177
+ * @param right - the specified vector
178
+ * @returns This vector
179
+ */
180
+ divide(right: Vector4): Vector4;
181
+ /**
182
+ * Calculate the length of this vector.
183
+ * @returns The length of this vector
184
+ */
185
+ length(): number;
186
+ /**
187
+ * Calculate the squared length of this vector.
188
+ * @returns The squared length of this vector
189
+ */
190
+ lengthSquared(): number;
191
+ /**
192
+ * Reverses the direction of this vector.
193
+ * @returns This vector
194
+ */
195
+ negate(): Vector4;
196
+ /**
197
+ * Converts this vector into a unit vector.
198
+ * @returns This vector
199
+ */
200
+ normalize(): Vector4;
201
+ /**
202
+ * Scale this vector by the given value.
203
+ * @param s - The amount by which to scale the vector
204
+ * @returns This vector
205
+ */
206
+ scale(s: number): Vector4;
207
+ /**
208
+ * Creates a clone of this vector.
209
+ * @returns A clone of this vector
210
+ */
211
+ clone(): Vector4;
212
+ /**
213
+ * Copy from vector3 like object.
214
+ * @param source - Vector3 like object.
215
+ * @returns This vector
216
+ */
217
+ copyFrom(source: Vector4Like): Vector4;
218
+ /**
219
+ * Copy the value of this vector by an array.
220
+ * @param array - The array
221
+ * @param offset - The start offset of the array
222
+ * @returns This vector
223
+ */
224
+ copyFromArray(array: ArrayLike<number>, offset?: number): Vector4;
225
+ /**
226
+ * Copy the value of this vector to an array.
227
+ * @param out - The array
228
+ * @param outOffset - The start offset of the array
229
+ */
230
+ copyToArray(out: number[] | Float32Array | Float64Array, outOffset?: number): void;
231
+ /**
232
+ * Serialize this vector to a JSON representation.
233
+ * @returns A JSON representation of this vector
234
+ */
235
+ toJSON(): Vector4Like;
236
+ }
237
+ interface Vector4Like {
238
+ /** {@inheritDoc Vector4.x} */
239
+ x: number;
240
+ /** {@inheritDoc Vector4.y} */
241
+ y: number;
242
+ /** {@inheritDoc Vector4.z} */
243
+ z: number;
244
+ /** {@inheritDoc Vector4.w} */
245
+ w: number;
246
+ }
247
+ export {};
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Defines how the bounding volumes intersects or contain one another.
3
+ */
4
+ export declare enum ContainmentType {
5
+ /** Indicates that there is no overlap between two bounding volumes. */
6
+ Disjoint = 0,
7
+ /** Indicates that one bounding volume completely contains another volume. */
8
+ Contains = 1,
9
+ /** Indicates that bounding volumes partially overlap one another. */
10
+ Intersects = 2
11
+ }
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Frustum face
3
+ */
4
+ export declare enum FrustumFace {
5
+ /** Near face */
6
+ Near = 0,
7
+ /** Far face */
8
+ Far = 1,
9
+ /** Left face */
10
+ Left = 2,
11
+ /** Right face */
12
+ Right = 3,
13
+ /** Bottom face */
14
+ Bottom = 4,
15
+ /** Top face */
16
+ Top = 5
17
+ }
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Defines the intersection between a plane and a bounding volume.
3
+ */
4
+ export declare enum PlaneIntersectionType {
5
+ /** There is no intersection, the bounding volume is in the back of the plane. */
6
+ Back = 0,
7
+ /** There is no intersection, the bounding volume is in the front of the plane. */
8
+ Front = 1,
9
+ /** The plane is intersected. */
10
+ Intersecting = 2
11
+ }
@@ -0,0 +1,19 @@
1
+ export { ContainmentType } from "./enums/ContainmentType";
2
+ export { PlaneIntersectionType } from "./enums/PlaneIntersectionType";
3
+ export { FrustumFace } from "./enums/FrustumFace";
4
+ export { BoundingSphere } from "./BoundingSphere";
5
+ export { BoundingBox } from "./BoundingBox";
6
+ export { BoundingFrustum } from "./BoundingFrustum";
7
+ export { MathUtil } from "./MathUtil";
8
+ export { CollisionUtil } from "./CollisionUtil";
9
+ export { Matrix } from "./Matrix";
10
+ export { Matrix3x3 } from "./Matrix3x3";
11
+ export { Quaternion } from "./Quaternion";
12
+ export { Ray } from "./Ray";
13
+ export { Vector2 } from "./Vector2";
14
+ export { Vector3 } from "./Vector3";
15
+ export { Vector4 } from "./Vector4";
16
+ export { Plane } from "./Plane";
17
+ export { Color } from "./Color";
18
+ export { Rect } from "./Rect";
19
+ export { SphericalHarmonics3 } from "./SphericalHarmonics3";