rhodonite 0.19.10 → 0.20.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.
- package/README.md +32 -2
- package/VERSION-FILE +1 -1
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
- package/dist/esm/foundation/core/Component.d.ts +63 -3
- package/dist/esm/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
- package/dist/esm/foundation/core/Config.d.ts +8 -7
- package/dist/esm/foundation/definitions/BoneDataType.d.ts +12 -1
- package/dist/esm/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
- package/dist/esm/foundation/importer/index.d.ts +1 -0
- package/dist/esm/foundation/math/AbstractMatrix.d.ts +3 -2
- package/dist/esm/foundation/math/AbstractQuaternion.d.ts +2 -1
- package/dist/esm/foundation/math/IMatrix.d.ts +2 -2
- package/dist/esm/foundation/math/IQuaternion.d.ts +4 -4
- package/dist/esm/foundation/math/LogQuaternion.d.ts +110 -38
- package/dist/esm/foundation/math/MathUtil.d.ts +55 -0
- package/dist/esm/foundation/math/Matrix22.d.ts +176 -30
- package/dist/esm/foundation/math/Matrix33.d.ts +206 -38
- package/dist/esm/foundation/math/Matrix44.d.ts +222 -39
- package/dist/esm/foundation/math/MutableMatrix22.d.ts +125 -130
- package/dist/esm/foundation/math/MutableMatrix33.d.ts +148 -162
- package/dist/esm/foundation/math/MutableMatrix44.d.ts +159 -183
- package/dist/esm/foundation/math/MutableQuaternion.d.ts +241 -132
- package/dist/esm/foundation/math/MutableScalar.d.ts +11 -12
- package/dist/esm/foundation/math/MutableVector2.d.ts +30 -31
- package/dist/esm/foundation/math/MutableVector3.d.ts +28 -26
- package/dist/esm/foundation/math/MutableVector4.d.ts +37 -37
- package/dist/esm/foundation/math/Quaternion.d.ts +529 -36
- package/dist/esm/foundation/math/Scalar.d.ts +13 -14
- package/dist/esm/foundation/math/Vector2.d.ts +38 -38
- package/dist/esm/foundation/math/Vector3.d.ts +55 -54
- package/dist/esm/foundation/math/Vector4.d.ts +54 -55
- package/dist/esm/index.js +691 -686
- package/dist/esm/types/glTF2.d.ts +7 -0
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
- package/dist/esmdev/foundation/core/Component.d.ts +63 -3
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
- package/dist/esmdev/foundation/core/Config.d.ts +8 -7
- package/dist/esmdev/foundation/definitions/BoneDataType.d.ts +12 -1
- package/dist/esmdev/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
- package/dist/esmdev/foundation/importer/index.d.ts +1 -0
- package/dist/esmdev/foundation/math/AbstractMatrix.d.ts +3 -2
- package/dist/esmdev/foundation/math/AbstractQuaternion.d.ts +2 -1
- package/dist/esmdev/foundation/math/IMatrix.d.ts +2 -2
- package/dist/esmdev/foundation/math/IQuaternion.d.ts +4 -4
- package/dist/esmdev/foundation/math/LogQuaternion.d.ts +110 -38
- package/dist/esmdev/foundation/math/MathUtil.d.ts +55 -0
- package/dist/esmdev/foundation/math/Matrix22.d.ts +176 -30
- package/dist/esmdev/foundation/math/Matrix33.d.ts +206 -38
- package/dist/esmdev/foundation/math/Matrix44.d.ts +222 -39
- package/dist/esmdev/foundation/math/MutableMatrix22.d.ts +125 -130
- package/dist/esmdev/foundation/math/MutableMatrix33.d.ts +148 -162
- package/dist/esmdev/foundation/math/MutableMatrix44.d.ts +159 -183
- package/dist/esmdev/foundation/math/MutableQuaternion.d.ts +241 -132
- package/dist/esmdev/foundation/math/MutableScalar.d.ts +11 -12
- package/dist/esmdev/foundation/math/MutableVector2.d.ts +30 -31
- package/dist/esmdev/foundation/math/MutableVector3.d.ts +28 -26
- package/dist/esmdev/foundation/math/MutableVector4.d.ts +37 -37
- package/dist/esmdev/foundation/math/Quaternion.d.ts +529 -36
- package/dist/esmdev/foundation/math/Scalar.d.ts +13 -14
- package/dist/esmdev/foundation/math/Vector2.d.ts +38 -38
- package/dist/esmdev/foundation/math/Vector3.d.ts +55 -54
- package/dist/esmdev/foundation/math/Vector4.d.ts +54 -55
- package/dist/esmdev/index.js +4994 -2723
- package/dist/esmdev/types/glTF2.d.ts +7 -0
- package/package.json +12 -10
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import type { Array4 } from '../../types/CommonTypes';
|
|
1
|
+
import type { Array4, FloatTypedArrayConstructor, TypedArray } from '../../types/CommonTypes';
|
|
2
2
|
import type { IMatrix44 } from './IMatrix';
|
|
3
3
|
import type { ILogQuaternion, IMutableQuaternion, IQuaternion } from './IQuaternion';
|
|
4
4
|
import type { IVector3, IVector4 } from './IVector';
|
|
5
|
-
import {
|
|
5
|
+
import { Quaternion_ } from './Quaternion';
|
|
6
6
|
/**
|
|
7
7
|
* A mutable quaternion class that extends the immutable Quaternion class.
|
|
8
8
|
* Provides methods for quaternion operations that modify the instance in place.
|
|
9
9
|
* Quaternions are used to represent rotations in 3D space and are particularly
|
|
10
10
|
* useful for avoiding gimbal lock and providing smooth interpolations.
|
|
11
11
|
*/
|
|
12
|
-
export declare class
|
|
12
|
+
export declare class MutableQuaternion_<T extends FloatTypedArrayConstructor> extends Quaternion_<T> implements IMutableQuaternion {
|
|
13
|
+
/**
|
|
14
|
+
* Creates a new MutableQuaternion_ instance.
|
|
15
|
+
* @param v - The typed array containing the quaternion components
|
|
16
|
+
* @param _options - Configuration object containing the typed array constructor
|
|
17
|
+
*/
|
|
18
|
+
constructor(v: TypedArray, _options?: {
|
|
19
|
+
type: T;
|
|
20
|
+
});
|
|
13
21
|
/**
|
|
14
22
|
* Sets the x component of the quaternion.
|
|
15
23
|
* @param x - The x component value
|
|
@@ -55,104 +63,18 @@ export declare class MutableQuaternion extends Quaternion implements IMutableQua
|
|
|
55
63
|
* @returns The string 'MutableQuaternion'
|
|
56
64
|
*/
|
|
57
65
|
get className(): string;
|
|
58
|
-
/**
|
|
59
|
-
* Creates an identity quaternion (0, 0, 0, 1).
|
|
60
|
-
* @returns A new MutableQuaternion representing no rotation
|
|
61
|
-
*/
|
|
62
|
-
static identity(): MutableQuaternion;
|
|
63
|
-
/**
|
|
64
|
-
* Creates a dummy quaternion with empty array (for initialization purposes).
|
|
65
|
-
* @returns A new MutableQuaternion with zero-length array
|
|
66
|
-
*/
|
|
67
|
-
static dummy(): MutableQuaternion;
|
|
68
|
-
/**
|
|
69
|
-
* Inverts a quaternion and returns a new MutableQuaternion.
|
|
70
|
-
* @param quat - The quaternion to invert
|
|
71
|
-
* @returns A new MutableQuaternion representing the inverse rotation
|
|
72
|
-
*/
|
|
73
|
-
static invert(quat: IQuaternion): MutableQuaternion;
|
|
74
|
-
/**
|
|
75
|
-
* Performs spherical linear interpolation (SLERP) between two quaternions.
|
|
76
|
-
* @param l_quat - The starting quaternion
|
|
77
|
-
* @param r_quat - The ending quaternion
|
|
78
|
-
* @param ratio - Interpolation factor (0.0 to 1.0)
|
|
79
|
-
* @returns A new MutableQuaternion representing the interpolated rotation
|
|
80
|
-
*/
|
|
81
|
-
static qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternion;
|
|
82
|
-
/**
|
|
83
|
-
* Performs linear interpolation between two quaternions.
|
|
84
|
-
* @param l_quat - The starting quaternion
|
|
85
|
-
* @param r_quat - The ending quaternion
|
|
86
|
-
* @param ratio - Interpolation factor (0.0 to 1.0)
|
|
87
|
-
* @returns A new MutableQuaternion representing the interpolated rotation
|
|
88
|
-
*/
|
|
89
|
-
static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternion;
|
|
90
|
-
/**
|
|
91
|
-
* Creates a quaternion from an axis and angle.
|
|
92
|
-
* @param vec - The rotation axis (normalized vector recommended)
|
|
93
|
-
* @param radian - The rotation angle in radians
|
|
94
|
-
* @returns A new MutableQuaternion representing the axis-angle rotation
|
|
95
|
-
*/
|
|
96
|
-
static axisAngle(vec: IVector3, radian: number): MutableQuaternion;
|
|
97
|
-
/**
|
|
98
|
-
* Creates a quaternion from a rotation matrix.
|
|
99
|
-
* @param mat - The 4x4 transformation matrix
|
|
100
|
-
* @returns A new MutableQuaternion representing the matrix's rotation
|
|
101
|
-
*/
|
|
102
|
-
static fromMatrix(mat: IMatrix44): MutableQuaternion;
|
|
103
|
-
/**
|
|
104
|
-
* Creates a quaternion from a position vector (w component set to 0).
|
|
105
|
-
* @param vec - The position vector
|
|
106
|
-
* @returns A new MutableQuaternion with position data
|
|
107
|
-
*/
|
|
108
|
-
static fromPosition(vec: IVector3): MutableQuaternion;
|
|
109
|
-
/**
|
|
110
|
-
* Adds two quaternions component-wise.
|
|
111
|
-
* @param l_quat - The left quaternion
|
|
112
|
-
* @param r_quat - The right quaternion
|
|
113
|
-
* @returns A new MutableQuaternion representing the sum
|
|
114
|
-
*/
|
|
115
|
-
static add(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
116
|
-
/**
|
|
117
|
-
* Subtracts the second quaternion from the first component-wise.
|
|
118
|
-
* @param l_quat - The left quaternion
|
|
119
|
-
* @param r_quat - The right quaternion
|
|
120
|
-
* @returns A new MutableQuaternion representing the difference
|
|
121
|
-
*/
|
|
122
|
-
static subtract(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
123
|
-
/**
|
|
124
|
-
* Multiplies two quaternions (quaternion composition).
|
|
125
|
-
* @param l_quat - The left quaternion
|
|
126
|
-
* @param r_quat - The right quaternion
|
|
127
|
-
* @returns A new MutableQuaternion representing the composed rotation
|
|
128
|
-
*/
|
|
129
|
-
static multiply(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
130
|
-
/**
|
|
131
|
-
* Multiplies a quaternion by a scalar value.
|
|
132
|
-
* @param quat - The quaternion to multiply
|
|
133
|
-
* @param value - The scalar value
|
|
134
|
-
* @returns A new MutableQuaternion representing the scaled quaternion
|
|
135
|
-
*/
|
|
136
|
-
static multiplyNumber(quat: IQuaternion, value: number): MutableQuaternion;
|
|
137
|
-
/**
|
|
138
|
-
* Divides a quaternion by a scalar value.
|
|
139
|
-
* @param quat - The quaternion to divide
|
|
140
|
-
* @param value - The scalar value (must not be zero)
|
|
141
|
-
* @returns A new MutableQuaternion representing the scaled quaternion
|
|
142
|
-
*/
|
|
143
|
-
static divideNumber(quat: IQuaternion, value: number): MutableQuaternion;
|
|
144
66
|
/**
|
|
145
67
|
* Gets the raw Float32Array containing the quaternion components.
|
|
146
68
|
* @returns The underlying Float32Array [x, y, z, w]
|
|
147
69
|
*/
|
|
148
|
-
raw():
|
|
70
|
+
raw(): TypedArray;
|
|
149
71
|
/**
|
|
150
72
|
* Sets a component value at the specified index.
|
|
151
73
|
* @param i - The component index (0=x, 1=y, 2=z, 3=w)
|
|
152
74
|
* @param value - The value to set
|
|
153
75
|
* @returns This instance for method chaining
|
|
154
76
|
*/
|
|
155
|
-
setAt(i: number, value: number):
|
|
77
|
+
setAt(i: number, value: number): this;
|
|
156
78
|
/**
|
|
157
79
|
* Sets all quaternion components.
|
|
158
80
|
* @param x - The x component
|
|
@@ -161,28 +83,28 @@ export declare class MutableQuaternion extends Quaternion implements IMutableQua
|
|
|
161
83
|
* @param w - The w component
|
|
162
84
|
* @returns This instance for method chaining
|
|
163
85
|
*/
|
|
164
|
-
setComponents(x: number, y: number, z: number, w: number):
|
|
86
|
+
setComponents(x: number, y: number, z: number, w: number): this;
|
|
165
87
|
/**
|
|
166
88
|
* Copies components from another quaternion.
|
|
167
89
|
* @param quat - The quaternion to copy from
|
|
168
90
|
* @returns This instance for method chaining
|
|
169
91
|
*/
|
|
170
|
-
copyComponents(quat: IQuaternion):
|
|
92
|
+
copyComponents(quat: IQuaternion): this;
|
|
171
93
|
/**
|
|
172
94
|
* Sets this quaternion to the identity quaternion (0, 0, 0, 1).
|
|
173
95
|
* @returns This instance for method chaining
|
|
174
96
|
*/
|
|
175
|
-
identity():
|
|
97
|
+
identity(): this;
|
|
176
98
|
/**
|
|
177
99
|
* Normalizes this quaternion to unit length in place.
|
|
178
100
|
* @returns This instance for method chaining
|
|
179
101
|
*/
|
|
180
|
-
normalize():
|
|
102
|
+
normalize(): this;
|
|
181
103
|
/**
|
|
182
104
|
* Inverts this quaternion in place (conjugate divided by magnitude squared).
|
|
183
105
|
* @returns This instance for method chaining
|
|
184
106
|
*/
|
|
185
|
-
invert():
|
|
107
|
+
invert(): this;
|
|
186
108
|
/**
|
|
187
109
|
* Performs spherical linear interpolation (SLERP) and stores the result in this quaternion.
|
|
188
110
|
* @param l_quat - The starting quaternion
|
|
@@ -190,7 +112,7 @@ export declare class MutableQuaternion extends Quaternion implements IMutableQua
|
|
|
190
112
|
* @param ratio - Interpolation factor (0.0 to 1.0)
|
|
191
113
|
* @returns This instance for method chaining
|
|
192
114
|
*/
|
|
193
|
-
qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number):
|
|
115
|
+
qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): this;
|
|
194
116
|
/**
|
|
195
117
|
* Performs linear interpolation and stores the result in this quaternion.
|
|
196
118
|
* @param l_quat - The starting quaternion
|
|
@@ -198,107 +120,294 @@ export declare class MutableQuaternion extends Quaternion implements IMutableQua
|
|
|
198
120
|
* @param ratio - Interpolation factor (0.0 to 1.0)
|
|
199
121
|
* @returns This instance for method chaining
|
|
200
122
|
*/
|
|
201
|
-
lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number):
|
|
123
|
+
lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): this;
|
|
124
|
+
/**
|
|
125
|
+
* Attempts to set this quaternion from an axis and angle.
|
|
126
|
+
*
|
|
127
|
+
* The quaternion is left unchanged when the axis is degenerate
|
|
128
|
+
* (zero length or non-finite).
|
|
129
|
+
*
|
|
130
|
+
* @param vec - The rotation axis (will be normalized)
|
|
131
|
+
* @param radian - The rotation angle in radians
|
|
132
|
+
* @returns True if the quaternion could be set, false otherwise
|
|
133
|
+
*/
|
|
134
|
+
tryAxisAngle(vec: IVector3, radian: number): boolean;
|
|
202
135
|
/**
|
|
203
136
|
* Sets this quaternion from an axis and angle.
|
|
137
|
+
*
|
|
138
|
+
* If the axis is degenerate (zero length), this quaternion is set to the
|
|
139
|
+
* identity quaternion instead of being filled with `Infinity`/`NaN`.
|
|
140
|
+
* Use {@link MutableQuaternion.tryAxisAngle} when the caller needs to detect the failure.
|
|
141
|
+
*
|
|
204
142
|
* @param vec - The rotation axis (will be normalized)
|
|
205
143
|
* @param radian - The rotation angle in radians
|
|
206
144
|
* @returns This instance for method chaining
|
|
207
145
|
*/
|
|
208
|
-
axisAngle(vec: IVector3, radian: number):
|
|
146
|
+
axisAngle(vec: IVector3, radian: number): this;
|
|
147
|
+
/**
|
|
148
|
+
* Attempts to set this quaternion from a 4x4 transformation matrix.
|
|
149
|
+
* Extracts the rotation component from the matrix, ignoring scale and translation.
|
|
150
|
+
*
|
|
151
|
+
* The quaternion is left unchanged when the rotation cannot be extracted.
|
|
152
|
+
*
|
|
153
|
+
* @param mat - The 4x4 transformation matrix
|
|
154
|
+
* @returns True if the rotation could be extracted, false otherwise
|
|
155
|
+
*/
|
|
156
|
+
tryFromMatrix(mat: IMatrix44): boolean;
|
|
209
157
|
/**
|
|
210
158
|
* Sets this quaternion from a 4x4 transformation matrix.
|
|
211
159
|
* Extracts the rotation component from the matrix, ignoring scale and translation.
|
|
160
|
+
*
|
|
161
|
+
* If the rotation cannot be extracted, this quaternion is set to the identity
|
|
162
|
+
* quaternion instead of being filled with `Infinity`/`NaN`.
|
|
163
|
+
* Use {@link MutableQuaternion.tryFromMatrix} when the caller needs to detect the failure.
|
|
164
|
+
*
|
|
212
165
|
* @param mat - The 4x4 transformation matrix
|
|
213
166
|
* @returns This instance for method chaining
|
|
214
167
|
*/
|
|
215
|
-
fromMatrix(mat: IMatrix44):
|
|
168
|
+
fromMatrix(mat: IMatrix44): this;
|
|
216
169
|
/**
|
|
217
170
|
* Sets this quaternion from a position vector (w component set to 0).
|
|
218
171
|
* @param vec - The position vector
|
|
219
172
|
* @returns This instance for method chaining
|
|
220
173
|
*/
|
|
221
|
-
fromPosition(vec: IVector3):
|
|
174
|
+
fromPosition(vec: IVector3): this;
|
|
222
175
|
/**
|
|
223
176
|
* Adds another quaternion to this quaternion component-wise.
|
|
224
177
|
* @param quat - The quaternion to add
|
|
225
178
|
* @returns This instance for method chaining
|
|
226
179
|
*/
|
|
227
|
-
add(quat: IQuaternion):
|
|
180
|
+
add(quat: IQuaternion): this;
|
|
228
181
|
/**
|
|
229
182
|
* Subtracts another quaternion from this quaternion component-wise.
|
|
230
183
|
* @param quat - The quaternion to subtract
|
|
231
184
|
* @returns This instance for method chaining
|
|
232
185
|
*/
|
|
233
|
-
subtract(quat: IQuaternion):
|
|
186
|
+
subtract(quat: IQuaternion): this;
|
|
234
187
|
/**
|
|
235
188
|
* Multiplies this quaternion by another quaternion (quaternion composition).
|
|
236
189
|
* The result represents the combined rotation.
|
|
237
190
|
* @param quat - The quaternion to multiply by
|
|
238
191
|
* @returns This instance for method chaining
|
|
239
192
|
*/
|
|
240
|
-
multiply(quat: IQuaternion):
|
|
193
|
+
multiply(quat: IQuaternion): this;
|
|
241
194
|
/**
|
|
242
195
|
* Multiplies this quaternion by a scalar value.
|
|
243
196
|
* @param value - The scalar value to multiply by
|
|
244
197
|
* @returns This instance for method chaining
|
|
245
198
|
*/
|
|
246
|
-
multiplyNumber(value: number):
|
|
199
|
+
multiplyNumber(value: number): this;
|
|
247
200
|
/**
|
|
248
201
|
* Divides this quaternion by a scalar value.
|
|
249
202
|
* @param value - The scalar value to divide by (must not be zero)
|
|
250
203
|
* @returns This instance for method chaining
|
|
251
204
|
*/
|
|
252
|
-
divideNumber(value: number):
|
|
205
|
+
divideNumber(value: number): this;
|
|
253
206
|
/**
|
|
254
207
|
* Creates a copy of this quaternion.
|
|
255
208
|
* @returns A new IMutableQuaternion with the same component values
|
|
256
209
|
*/
|
|
257
|
-
clone():
|
|
210
|
+
clone(): this;
|
|
211
|
+
}
|
|
212
|
+
/**
|
|
213
|
+
* Mutable quaternion with 32-bit float components.
|
|
214
|
+
*/
|
|
215
|
+
export declare class MutableQuaternion extends MutableQuaternion_<Float32ArrayConstructor> {
|
|
216
|
+
/**
|
|
217
|
+
* Creates a new MutableQuaternion instance.
|
|
218
|
+
* @param v - The typed array containing the quaternion components
|
|
219
|
+
*/
|
|
220
|
+
constructor(v: TypedArray);
|
|
221
|
+
/**
|
|
222
|
+
* identity
|
|
223
|
+
*/
|
|
224
|
+
static identity(): MutableQuaternion;
|
|
225
|
+
/**
|
|
226
|
+
* dummy
|
|
227
|
+
*/
|
|
228
|
+
static dummy(): MutableQuaternion;
|
|
229
|
+
/**
|
|
230
|
+
* invert
|
|
231
|
+
*/
|
|
232
|
+
static invert(quat: IQuaternion): MutableQuaternion;
|
|
233
|
+
/**
|
|
234
|
+
* qlerp
|
|
235
|
+
*/
|
|
236
|
+
static qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternion;
|
|
237
|
+
/**
|
|
238
|
+
* lerp
|
|
239
|
+
*/
|
|
240
|
+
static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternion;
|
|
241
|
+
/**
|
|
242
|
+
* tryAxisAngle
|
|
243
|
+
*/
|
|
244
|
+
static tryAxisAngle(vec: IVector3, radian: number): MutableQuaternion | null;
|
|
245
|
+
/**
|
|
246
|
+
* axisAngle
|
|
247
|
+
*/
|
|
248
|
+
static axisAngle(vec: IVector3, radian: number): MutableQuaternion;
|
|
249
|
+
/**
|
|
250
|
+
* tryFromMatrix
|
|
251
|
+
*/
|
|
252
|
+
static tryFromMatrix(mat: IMatrix44): MutableQuaternion | null;
|
|
258
253
|
/**
|
|
259
|
-
*
|
|
260
|
-
|
|
261
|
-
|
|
254
|
+
* fromMatrix
|
|
255
|
+
*/
|
|
256
|
+
static fromMatrix(mat: IMatrix44): MutableQuaternion;
|
|
257
|
+
/**
|
|
258
|
+
* fromPosition
|
|
259
|
+
*/
|
|
260
|
+
static fromPosition(vec: IVector3): MutableQuaternion;
|
|
261
|
+
/**
|
|
262
|
+
* add
|
|
263
|
+
*/
|
|
264
|
+
static add(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
265
|
+
/**
|
|
266
|
+
* subtract
|
|
267
|
+
*/
|
|
268
|
+
static subtract(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
269
|
+
/**
|
|
270
|
+
* multiply
|
|
271
|
+
*/
|
|
272
|
+
static multiply(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternion;
|
|
273
|
+
/**
|
|
274
|
+
* multiplyNumber
|
|
275
|
+
*/
|
|
276
|
+
static multiplyNumber(quat: IQuaternion, value: number): MutableQuaternion;
|
|
277
|
+
/**
|
|
278
|
+
* divideNumber
|
|
279
|
+
*/
|
|
280
|
+
static divideNumber(quat: IQuaternion, value: number): MutableQuaternion;
|
|
281
|
+
/**
|
|
282
|
+
* Creates a mutable quaternion that directly uses the given Float32Array (no copy).
|
|
262
283
|
*/
|
|
263
284
|
static fromFloat32Array(array: Float32Array): MutableQuaternion;
|
|
264
285
|
/**
|
|
265
|
-
*
|
|
266
|
-
* @param array - Array containing [x, y, z, w] components
|
|
267
|
-
* @returns A new MutableQuaternion instance
|
|
286
|
+
* fromCopyArray4
|
|
268
287
|
*/
|
|
269
288
|
static fromCopyArray4(array: Array4<number>): MutableQuaternion;
|
|
270
289
|
/**
|
|
271
|
-
*
|
|
272
|
-
* @param array - Array containing quaternion components
|
|
273
|
-
* @returns A new MutableQuaternion instance
|
|
290
|
+
* fromCopyArray
|
|
274
291
|
*/
|
|
275
292
|
static fromCopyArray(array: Array<number>): MutableQuaternion;
|
|
276
293
|
/**
|
|
277
|
-
*
|
|
278
|
-
* @param x - The x component
|
|
279
|
-
* @param y - The y component
|
|
280
|
-
* @param z - The z component
|
|
281
|
-
* @param w - The w component
|
|
282
|
-
* @returns A new MutableQuaternion instance
|
|
294
|
+
* fromCopy4
|
|
283
295
|
*/
|
|
284
296
|
static fromCopy4(x: number, y: number, z: number, w: number): MutableQuaternion;
|
|
285
297
|
/**
|
|
286
|
-
*
|
|
287
|
-
* @param quat - The quaternion to copy from
|
|
288
|
-
* @returns A new MutableQuaternion instance
|
|
298
|
+
* fromCopyQuaternion
|
|
289
299
|
*/
|
|
290
300
|
static fromCopyQuaternion(quat: IQuaternion): MutableQuaternion;
|
|
291
301
|
/**
|
|
292
|
-
*
|
|
293
|
-
* @param vec - The 4D vector to copy from
|
|
294
|
-
* @returns A new MutableQuaternion instance
|
|
302
|
+
* fromCopyVector4
|
|
295
303
|
*/
|
|
296
304
|
static fromCopyVector4(vec: IVector4): MutableQuaternion;
|
|
297
305
|
/**
|
|
298
|
-
*
|
|
299
|
-
* Converts from log space back to quaternion space using exponential map.
|
|
300
|
-
* @param x - The logarithmic quaternion to convert
|
|
301
|
-
* @returns A new MutableQuaternion instance
|
|
306
|
+
* fromCopyLogQuaternion
|
|
302
307
|
*/
|
|
303
308
|
static fromCopyLogQuaternion(x: ILogQuaternion): MutableQuaternion;
|
|
304
309
|
}
|
|
310
|
+
/**
|
|
311
|
+
* Mutable quaternion with 64-bit float components.
|
|
312
|
+
*/
|
|
313
|
+
export declare class MutableQuaternionD extends MutableQuaternion_<Float64ArrayConstructor> {
|
|
314
|
+
/** The typed array constructor used for newly created quaternions. */
|
|
315
|
+
protected static readonly _type: FloatTypedArrayConstructor;
|
|
316
|
+
/**
|
|
317
|
+
* Creates a new MutableQuaternionD instance.
|
|
318
|
+
* @param v - The typed array containing the quaternion components
|
|
319
|
+
*/
|
|
320
|
+
constructor(v: TypedArray);
|
|
321
|
+
/**
|
|
322
|
+
* identity
|
|
323
|
+
*/
|
|
324
|
+
static identity(): MutableQuaternionD;
|
|
325
|
+
/**
|
|
326
|
+
* dummy
|
|
327
|
+
*/
|
|
328
|
+
static dummy(): MutableQuaternionD;
|
|
329
|
+
/**
|
|
330
|
+
* invert
|
|
331
|
+
*/
|
|
332
|
+
static invert(quat: IQuaternion): MutableQuaternionD;
|
|
333
|
+
/**
|
|
334
|
+
* qlerp
|
|
335
|
+
*/
|
|
336
|
+
static qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternionD;
|
|
337
|
+
/**
|
|
338
|
+
* lerp
|
|
339
|
+
*/
|
|
340
|
+
static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): MutableQuaternionD;
|
|
341
|
+
/**
|
|
342
|
+
* tryAxisAngle
|
|
343
|
+
*/
|
|
344
|
+
static tryAxisAngle(vec: IVector3, radian: number): MutableQuaternionD | null;
|
|
345
|
+
/**
|
|
346
|
+
* axisAngle
|
|
347
|
+
*/
|
|
348
|
+
static axisAngle(vec: IVector3, radian: number): MutableQuaternionD;
|
|
349
|
+
/**
|
|
350
|
+
* tryFromMatrix
|
|
351
|
+
*/
|
|
352
|
+
static tryFromMatrix(mat: IMatrix44): MutableQuaternionD | null;
|
|
353
|
+
/**
|
|
354
|
+
* fromMatrix
|
|
355
|
+
*/
|
|
356
|
+
static fromMatrix(mat: IMatrix44): MutableQuaternionD;
|
|
357
|
+
/**
|
|
358
|
+
* fromPosition
|
|
359
|
+
*/
|
|
360
|
+
static fromPosition(vec: IVector3): MutableQuaternionD;
|
|
361
|
+
/**
|
|
362
|
+
* add
|
|
363
|
+
*/
|
|
364
|
+
static add(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternionD;
|
|
365
|
+
/**
|
|
366
|
+
* subtract
|
|
367
|
+
*/
|
|
368
|
+
static subtract(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternionD;
|
|
369
|
+
/**
|
|
370
|
+
* multiply
|
|
371
|
+
*/
|
|
372
|
+
static multiply(l_quat: IQuaternion, r_quat: IQuaternion): MutableQuaternionD;
|
|
373
|
+
/**
|
|
374
|
+
* multiplyNumber
|
|
375
|
+
*/
|
|
376
|
+
static multiplyNumber(quat: IQuaternion, value: number): MutableQuaternionD;
|
|
377
|
+
/**
|
|
378
|
+
* divideNumber
|
|
379
|
+
*/
|
|
380
|
+
static divideNumber(quat: IQuaternion, value: number): MutableQuaternionD;
|
|
381
|
+
/**
|
|
382
|
+
* Creates a mutable quaternion that directly uses the given Float64Array (no copy).
|
|
383
|
+
*/
|
|
384
|
+
static fromFloat64Array(array: Float64Array): MutableQuaternionD;
|
|
385
|
+
/**
|
|
386
|
+
* fromCopyArray4
|
|
387
|
+
*/
|
|
388
|
+
static fromCopyArray4(array: Array4<number>): MutableQuaternionD;
|
|
389
|
+
/**
|
|
390
|
+
* fromCopyArray
|
|
391
|
+
*/
|
|
392
|
+
static fromCopyArray(array: Array<number>): MutableQuaternionD;
|
|
393
|
+
/**
|
|
394
|
+
* fromCopy4
|
|
395
|
+
*/
|
|
396
|
+
static fromCopy4(x: number, y: number, z: number, w: number): MutableQuaternionD;
|
|
397
|
+
/**
|
|
398
|
+
* fromCopyQuaternion
|
|
399
|
+
*/
|
|
400
|
+
static fromCopyQuaternion(quat: IQuaternion): MutableQuaternionD;
|
|
401
|
+
/**
|
|
402
|
+
* fromCopyVector4
|
|
403
|
+
*/
|
|
404
|
+
static fromCopyVector4(vec: IVector4): MutableQuaternionD;
|
|
405
|
+
/**
|
|
406
|
+
* fromCopyLogQuaternion
|
|
407
|
+
*/
|
|
408
|
+
static fromCopyLogQuaternion(x: ILogQuaternion): MutableQuaternionD;
|
|
409
|
+
}
|
|
410
|
+
/**
|
|
411
|
+
* Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
|
|
412
|
+
*/
|
|
413
|
+
export { MutableQuaternion as MutableQuaternionF };
|
|
@@ -109,7 +109,7 @@ export declare class MutableScalar extends MutableScalar_<Float32ArrayConstructo
|
|
|
109
109
|
* Mutable scalar class with 64-bit float components.
|
|
110
110
|
* This class provides a mutable scalar value backed by a Float64Array for higher precision.
|
|
111
111
|
*/
|
|
112
|
-
export declare class
|
|
112
|
+
export declare class MutableScalarD extends MutableScalar_<Float64ArrayConstructor> {
|
|
113
113
|
/**
|
|
114
114
|
* Creates a new mutable scalar with 64-bit float precision.
|
|
115
115
|
* @param x - The typed array containing the scalar value
|
|
@@ -117,27 +117,26 @@ export declare class MutableScalard extends MutableScalar_<Float64ArrayConstruct
|
|
|
117
117
|
constructor(x: TypedArray);
|
|
118
118
|
/**
|
|
119
119
|
* Creates a copy of this scalar.
|
|
120
|
-
* @returns A new
|
|
120
|
+
* @returns A new MutableScalarD instance with the same value
|
|
121
121
|
*/
|
|
122
|
-
clone():
|
|
122
|
+
clone(): MutableScalarD;
|
|
123
123
|
/**
|
|
124
124
|
* Creates a scalar with value 1.
|
|
125
|
-
* @returns A new
|
|
125
|
+
* @returns A new MutableScalarD instance with value 1
|
|
126
126
|
*/
|
|
127
|
-
static one():
|
|
127
|
+
static one(): MutableScalarD;
|
|
128
128
|
/**
|
|
129
129
|
* Creates a dummy scalar with no data.
|
|
130
|
-
* @returns A new
|
|
130
|
+
* @returns A new MutableScalarD instance with empty array
|
|
131
131
|
*/
|
|
132
|
-
static dummy():
|
|
132
|
+
static dummy(): MutableScalarD;
|
|
133
133
|
/**
|
|
134
134
|
* Creates a scalar with value 0.
|
|
135
|
-
* @returns A new
|
|
135
|
+
* @returns A new MutableScalarD instance with value 0
|
|
136
136
|
*/
|
|
137
|
-
static zero():
|
|
137
|
+
static zero(): MutableScalarD;
|
|
138
138
|
}
|
|
139
139
|
/**
|
|
140
|
-
*
|
|
141
|
-
* Provides backward compatibility and clearer naming.
|
|
140
|
+
* Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
|
|
142
141
|
*/
|
|
143
|
-
export
|
|
142
|
+
export { MutableScalar as MutableScalarF };
|