@galacean/engine-math 1.6.7 → 1.6.8
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.
- package/package.json +1 -1
- package/dist/main.js +0 -5085
- package/dist/main.js.map +0 -1
- package/dist/module.js +0 -5062
- package/dist/module.js.map +0 -1
- package/types/BoundingBox.d.ts +0 -103
- package/types/BoundingFrustum.d.ts +0 -63
- package/types/BoundingSphere.d.ts +0 -43
- package/types/CollisionUtil.d.ts +0 -122
- package/types/Color.d.ts +0 -175
- package/types/IClone.d.ts +0 -10
- package/types/ICopy.d.ts +0 -15
- package/types/MathUtil.d.ts +0 -53
- package/types/Matrix.d.ts +0 -298
- package/types/Matrix3x3.d.ts +0 -228
- package/types/Plane.d.ts +0 -48
- package/types/Quaternion.d.ts +0 -333
- package/types/Rand.d.ts +0 -30
- package/types/Ray.d.ts +0 -44
- package/types/Rect.d.ts +0 -52
- package/types/SphericalHarmonics3.d.ts +0 -56
- package/types/Vector2.d.ts +0 -219
- package/types/Vector3.d.ts +0 -321
- package/types/Vector4.d.ts +0 -253
- package/types/enums/ContainmentType.d.ts +0 -11
- package/types/enums/FrustumFace.d.ts +0 -17
- package/types/enums/PlaneIntersectionType.d.ts +0 -11
- package/types/index.d.ts +0 -20
package/types/Vector4.d.ts
DELETED
|
@@ -1,253 +0,0 @@
|
|
|
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 to vector4 like object.
|
|
220
|
-
* @param target - Vector4 like object
|
|
221
|
-
* @returns This Vector4 like object
|
|
222
|
-
*/
|
|
223
|
-
copyTo(target: Vector4Like): Vector4Like;
|
|
224
|
-
/**
|
|
225
|
-
* Copy the value of this vector by an array.
|
|
226
|
-
* @param array - The array
|
|
227
|
-
* @param offset - The start offset of the array
|
|
228
|
-
* @returns This vector
|
|
229
|
-
*/
|
|
230
|
-
copyFromArray(array: ArrayLike<number>, offset?: number): Vector4;
|
|
231
|
-
/**
|
|
232
|
-
* Copy the value of this vector to an array.
|
|
233
|
-
* @param out - The array
|
|
234
|
-
* @param outOffset - The start offset of the array
|
|
235
|
-
*/
|
|
236
|
-
copyToArray(out: number[] | Float32Array | Float64Array, outOffset?: number): void;
|
|
237
|
-
/**
|
|
238
|
-
* Serialize this vector to a JSON representation.
|
|
239
|
-
* @returns A JSON representation of this vector
|
|
240
|
-
*/
|
|
241
|
-
toJSON(): Vector4Like;
|
|
242
|
-
}
|
|
243
|
-
interface Vector4Like {
|
|
244
|
-
/** {@inheritDoc Vector4.x} */
|
|
245
|
-
x: number;
|
|
246
|
-
/** {@inheritDoc Vector4.y} */
|
|
247
|
-
y: number;
|
|
248
|
-
/** {@inheritDoc Vector4.z} */
|
|
249
|
-
z: number;
|
|
250
|
-
/** {@inheritDoc Vector4.w} */
|
|
251
|
-
w: number;
|
|
252
|
-
}
|
|
253
|
-
export {};
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
-
}
|
package/types/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
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";
|
|
20
|
-
export { Rand } from "./Rand";
|