rhodonite 0.19.9 → 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.
Files changed (199) hide show
  1. package/README.md +32 -2
  2. package/VERSION-FILE +1 -1
  3. package/dist/esm/effekseer/main.d.ts +3 -1
  4. package/dist/esm/foundation/components/Animation/AnimationComponent.d.ts +15 -1
  5. package/dist/esm/foundation/components/Animation/AnimationStateRepository.d.ts +26 -10
  6. package/dist/esm/foundation/components/AnimationState/AnimationStateComponent.d.ts +14 -0
  7. package/dist/esm/foundation/components/CharacterController/CharacterAnimationController.d.ts +63 -0
  8. package/dist/esm/foundation/components/CharacterController/CharacterControllerComponent.d.ts +67 -0
  9. package/dist/esm/foundation/components/CharacterController/ICharacterControllerEntity.d.ts +4 -0
  10. package/dist/esm/foundation/components/CharacterController/createCharacterControllerEntity.d.ts +4 -0
  11. package/dist/esm/foundation/components/CharacterController/index.d.ts +4 -0
  12. package/dist/esm/foundation/components/ComponentTypes.d.ts +6 -0
  13. package/dist/esm/foundation/components/Physics/PhysicsComponent.d.ts +27 -0
  14. package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +30 -0
  15. package/dist/esm/foundation/components/Shape/IShapeEntity.d.ts +4 -0
  16. package/dist/esm/foundation/components/Shape/ShapeComponent.d.ts +43 -0
  17. package/dist/esm/foundation/components/Shape/createShapeEntity.d.ts +3 -0
  18. package/dist/esm/foundation/components/Shape/index.d.ts +3 -0
  19. package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
  20. package/dist/esm/foundation/components/Transform/TransformComponent.d.ts +2 -3
  21. package/dist/esm/foundation/components/Trigger/ITriggerEntity.d.ts +4 -0
  22. package/dist/esm/foundation/components/Trigger/TriggerComponent.d.ts +58 -0
  23. package/dist/esm/foundation/components/Trigger/index.d.ts +2 -0
  24. package/dist/esm/foundation/components/Vrm/VrmComponent.d.ts +16 -1
  25. package/dist/esm/foundation/components/WellKnownComponentTIDs.d.ts +4 -1
  26. package/dist/esm/foundation/components/index.d.ts +3 -0
  27. package/dist/esm/foundation/core/Component.d.ts +63 -3
  28. package/dist/esm/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
  29. package/dist/esm/foundation/core/Config.d.ts +8 -7
  30. package/dist/esm/foundation/core/Entity.d.ts +15 -0
  31. package/dist/esm/foundation/definitions/BoneDataType.d.ts +12 -1
  32. package/dist/esm/foundation/definitions/PhysicsShapeType.d.ts +1 -0
  33. package/dist/esm/foundation/definitions/ProcessApproach.d.ts +8 -4
  34. package/dist/esm/foundation/exporter/Gltf2ExporterOps.d.ts +2 -0
  35. package/dist/esm/foundation/geometry/Shape.d.ts +35 -0
  36. package/dist/esm/foundation/geometry/index.d.ts +1 -0
  37. package/dist/esm/foundation/geometry/shapes/Cylinder.d.ts +16 -0
  38. package/dist/esm/foundation/geometry/shapes/index.d.ts +1 -0
  39. package/dist/esm/foundation/gizmos/ShapeGizmo.d.ts +22 -0
  40. package/dist/esm/foundation/gizmos/index.d.ts +1 -0
  41. package/dist/esm/foundation/helpers/EntityHelper.d.ts +6 -0
  42. package/dist/esm/foundation/helpers/MeshHelper.d.ts +275 -15
  43. package/dist/esm/foundation/importer/AnimationAssigner.d.ts +62 -3
  44. package/dist/esm/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
  45. package/dist/esm/foundation/importer/Gltf2Importer.d.ts +6 -0
  46. package/dist/esm/foundation/importer/KhrPhysicsImporter.d.ts +58 -0
  47. package/dist/esm/foundation/importer/VrmaImporter.d.ts +11 -3
  48. package/dist/esm/foundation/importer/index.d.ts +2 -0
  49. package/dist/esm/foundation/math/AbstractMatrix.d.ts +3 -2
  50. package/dist/esm/foundation/math/AbstractQuaternion.d.ts +2 -1
  51. package/dist/esm/foundation/math/AnimatedQuaternion.d.ts +4 -0
  52. package/dist/esm/foundation/math/AnimatedScalar.d.ts +4 -0
  53. package/dist/esm/foundation/math/AnimatedVector2.d.ts +4 -0
  54. package/dist/esm/foundation/math/AnimatedVector3.d.ts +4 -0
  55. package/dist/esm/foundation/math/AnimatedVector4.d.ts +4 -0
  56. package/dist/esm/foundation/math/AnimatedVectorN.d.ts +4 -0
  57. package/dist/esm/foundation/math/IAnimatedValue.d.ts +12 -0
  58. package/dist/esm/foundation/math/IMatrix.d.ts +2 -2
  59. package/dist/esm/foundation/math/IQuaternion.d.ts +4 -4
  60. package/dist/esm/foundation/math/LogQuaternion.d.ts +110 -38
  61. package/dist/esm/foundation/math/MathUtil.d.ts +63 -1
  62. package/dist/esm/foundation/math/Matrix22.d.ts +176 -30
  63. package/dist/esm/foundation/math/Matrix33.d.ts +206 -38
  64. package/dist/esm/foundation/math/Matrix44.d.ts +222 -39
  65. package/dist/esm/foundation/math/MutableMatrix22.d.ts +125 -130
  66. package/dist/esm/foundation/math/MutableMatrix33.d.ts +148 -162
  67. package/dist/esm/foundation/math/MutableMatrix44.d.ts +159 -183
  68. package/dist/esm/foundation/math/MutableQuaternion.d.ts +241 -132
  69. package/dist/esm/foundation/math/MutableScalar.d.ts +11 -12
  70. package/dist/esm/foundation/math/MutableVector2.d.ts +30 -31
  71. package/dist/esm/foundation/math/MutableVector3.d.ts +28 -26
  72. package/dist/esm/foundation/math/MutableVector4.d.ts +37 -37
  73. package/dist/esm/foundation/math/Quaternion.d.ts +529 -36
  74. package/dist/esm/foundation/math/Scalar.d.ts +13 -14
  75. package/dist/esm/foundation/math/Vector2.d.ts +38 -38
  76. package/dist/esm/foundation/math/Vector3.d.ts +55 -54
  77. package/dist/esm/foundation/math/Vector4.d.ts +54 -55
  78. package/dist/esm/foundation/misc/MiscUtil.d.ts +79 -16
  79. package/dist/esm/foundation/misc/Time.d.ts +10 -1
  80. package/dist/esm/foundation/physics/CharacterControllerStrategy.d.ts +65 -0
  81. package/dist/esm/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +17 -1
  82. package/dist/esm/foundation/physics/PhysicsProperty.d.ts +43 -0
  83. package/dist/esm/foundation/physics/PhysicsStrategy.d.ts +15 -0
  84. package/dist/esm/foundation/physics/PhysicsWorldQuery.d.ts +65 -0
  85. package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +58 -0
  86. package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +157 -19
  87. package/dist/esm/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.d.ts +11 -0
  88. package/dist/esm/foundation/physics/Rapier/index.d.ts +2 -0
  89. package/dist/esm/foundation/physics/ShapeTransformResolver.d.ts +19 -0
  90. package/dist/esm/foundation/physics/index.d.ts +2 -0
  91. package/dist/esm/index.js +728 -723
  92. package/dist/esm/types/AnimationTypes.d.ts +1 -1
  93. package/dist/esm/types/KHR_implicit_shapes.d.ts +47 -0
  94. package/dist/esm/types/KHR_physics_rigid_bodies.d.ts +54 -0
  95. package/dist/esm/types/VRMC.d.ts +12 -12
  96. package/dist/esm/types/VRMC_vrm_animation.d.ts +5 -0
  97. package/dist/esm/types/glTF2.d.ts +8 -0
  98. package/dist/esm/types/index.d.ts +2 -0
  99. package/dist/esm/webgl/main.d.ts +2 -1
  100. package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +12 -0
  101. package/dist/esmdev/effekseer/main.d.ts +3 -1
  102. package/dist/esmdev/foundation/components/Animation/AnimationComponent.d.ts +15 -1
  103. package/dist/esmdev/foundation/components/Animation/AnimationStateRepository.d.ts +26 -10
  104. package/dist/esmdev/foundation/components/AnimationState/AnimationStateComponent.d.ts +14 -0
  105. package/dist/esmdev/foundation/components/CharacterController/CharacterAnimationController.d.ts +63 -0
  106. package/dist/esmdev/foundation/components/CharacterController/CharacterControllerComponent.d.ts +67 -0
  107. package/dist/esmdev/foundation/components/CharacterController/ICharacterControllerEntity.d.ts +4 -0
  108. package/dist/esmdev/foundation/components/CharacterController/createCharacterControllerEntity.d.ts +4 -0
  109. package/dist/esmdev/foundation/components/CharacterController/index.d.ts +4 -0
  110. package/dist/esmdev/foundation/components/ComponentTypes.d.ts +6 -0
  111. package/dist/esmdev/foundation/components/Physics/PhysicsComponent.d.ts +27 -0
  112. package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +30 -0
  113. package/dist/esmdev/foundation/components/Shape/IShapeEntity.d.ts +4 -0
  114. package/dist/esmdev/foundation/components/Shape/ShapeComponent.d.ts +43 -0
  115. package/dist/esmdev/foundation/components/Shape/createShapeEntity.d.ts +3 -0
  116. package/dist/esmdev/foundation/components/Shape/index.d.ts +3 -0
  117. package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
  118. package/dist/esmdev/foundation/components/Transform/TransformComponent.d.ts +2 -3
  119. package/dist/esmdev/foundation/components/Trigger/ITriggerEntity.d.ts +4 -0
  120. package/dist/esmdev/foundation/components/Trigger/TriggerComponent.d.ts +58 -0
  121. package/dist/esmdev/foundation/components/Trigger/index.d.ts +2 -0
  122. package/dist/esmdev/foundation/components/Vrm/VrmComponent.d.ts +16 -1
  123. package/dist/esmdev/foundation/components/WellKnownComponentTIDs.d.ts +4 -1
  124. package/dist/esmdev/foundation/components/index.d.ts +3 -0
  125. package/dist/esmdev/foundation/core/Component.d.ts +63 -3
  126. package/dist/esmdev/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
  127. package/dist/esmdev/foundation/core/Config.d.ts +8 -7
  128. package/dist/esmdev/foundation/core/Entity.d.ts +15 -0
  129. package/dist/esmdev/foundation/definitions/BoneDataType.d.ts +12 -1
  130. package/dist/esmdev/foundation/definitions/PhysicsShapeType.d.ts +1 -0
  131. package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +8 -4
  132. package/dist/esmdev/foundation/exporter/Gltf2ExporterOps.d.ts +2 -0
  133. package/dist/esmdev/foundation/geometry/Shape.d.ts +35 -0
  134. package/dist/esmdev/foundation/geometry/index.d.ts +1 -0
  135. package/dist/esmdev/foundation/geometry/shapes/Cylinder.d.ts +16 -0
  136. package/dist/esmdev/foundation/geometry/shapes/index.d.ts +1 -0
  137. package/dist/esmdev/foundation/gizmos/ShapeGizmo.d.ts +22 -0
  138. package/dist/esmdev/foundation/gizmos/index.d.ts +1 -0
  139. package/dist/esmdev/foundation/helpers/EntityHelper.d.ts +6 -0
  140. package/dist/esmdev/foundation/helpers/MeshHelper.d.ts +275 -15
  141. package/dist/esmdev/foundation/importer/AnimationAssigner.d.ts +62 -3
  142. package/dist/esmdev/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
  143. package/dist/esmdev/foundation/importer/Gltf2Importer.d.ts +6 -0
  144. package/dist/esmdev/foundation/importer/KhrPhysicsImporter.d.ts +58 -0
  145. package/dist/esmdev/foundation/importer/VrmaImporter.d.ts +11 -3
  146. package/dist/esmdev/foundation/importer/index.d.ts +2 -0
  147. package/dist/esmdev/foundation/math/AbstractMatrix.d.ts +3 -2
  148. package/dist/esmdev/foundation/math/AbstractQuaternion.d.ts +2 -1
  149. package/dist/esmdev/foundation/math/AnimatedQuaternion.d.ts +4 -0
  150. package/dist/esmdev/foundation/math/AnimatedScalar.d.ts +4 -0
  151. package/dist/esmdev/foundation/math/AnimatedVector2.d.ts +4 -0
  152. package/dist/esmdev/foundation/math/AnimatedVector3.d.ts +4 -0
  153. package/dist/esmdev/foundation/math/AnimatedVector4.d.ts +4 -0
  154. package/dist/esmdev/foundation/math/AnimatedVectorN.d.ts +4 -0
  155. package/dist/esmdev/foundation/math/IAnimatedValue.d.ts +12 -0
  156. package/dist/esmdev/foundation/math/IMatrix.d.ts +2 -2
  157. package/dist/esmdev/foundation/math/IQuaternion.d.ts +4 -4
  158. package/dist/esmdev/foundation/math/LogQuaternion.d.ts +110 -38
  159. package/dist/esmdev/foundation/math/MathUtil.d.ts +63 -1
  160. package/dist/esmdev/foundation/math/Matrix22.d.ts +176 -30
  161. package/dist/esmdev/foundation/math/Matrix33.d.ts +206 -38
  162. package/dist/esmdev/foundation/math/Matrix44.d.ts +222 -39
  163. package/dist/esmdev/foundation/math/MutableMatrix22.d.ts +125 -130
  164. package/dist/esmdev/foundation/math/MutableMatrix33.d.ts +148 -162
  165. package/dist/esmdev/foundation/math/MutableMatrix44.d.ts +159 -183
  166. package/dist/esmdev/foundation/math/MutableQuaternion.d.ts +241 -132
  167. package/dist/esmdev/foundation/math/MutableScalar.d.ts +11 -12
  168. package/dist/esmdev/foundation/math/MutableVector2.d.ts +30 -31
  169. package/dist/esmdev/foundation/math/MutableVector3.d.ts +28 -26
  170. package/dist/esmdev/foundation/math/MutableVector4.d.ts +37 -37
  171. package/dist/esmdev/foundation/math/Quaternion.d.ts +529 -36
  172. package/dist/esmdev/foundation/math/Scalar.d.ts +13 -14
  173. package/dist/esmdev/foundation/math/Vector2.d.ts +38 -38
  174. package/dist/esmdev/foundation/math/Vector3.d.ts +55 -54
  175. package/dist/esmdev/foundation/math/Vector4.d.ts +54 -55
  176. package/dist/esmdev/foundation/misc/MiscUtil.d.ts +79 -16
  177. package/dist/esmdev/foundation/misc/Time.d.ts +10 -1
  178. package/dist/esmdev/foundation/physics/CharacterControllerStrategy.d.ts +65 -0
  179. package/dist/esmdev/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +17 -1
  180. package/dist/esmdev/foundation/physics/PhysicsProperty.d.ts +43 -0
  181. package/dist/esmdev/foundation/physics/PhysicsStrategy.d.ts +15 -0
  182. package/dist/esmdev/foundation/physics/PhysicsWorldQuery.d.ts +65 -0
  183. package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +58 -0
  184. package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +157 -19
  185. package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.d.ts +11 -0
  186. package/dist/esmdev/foundation/physics/Rapier/index.d.ts +2 -0
  187. package/dist/esmdev/foundation/physics/ShapeTransformResolver.d.ts +19 -0
  188. package/dist/esmdev/foundation/physics/index.d.ts +2 -0
  189. package/dist/esmdev/index.js +35168 -27712
  190. package/dist/esmdev/types/AnimationTypes.d.ts +1 -1
  191. package/dist/esmdev/types/KHR_implicit_shapes.d.ts +47 -0
  192. package/dist/esmdev/types/KHR_physics_rigid_bodies.d.ts +54 -0
  193. package/dist/esmdev/types/VRMC.d.ts +12 -12
  194. package/dist/esmdev/types/VRMC_vrm_animation.d.ts +5 -0
  195. package/dist/esmdev/types/glTF2.d.ts +8 -0
  196. package/dist/esmdev/types/index.d.ts +2 -0
  197. package/dist/esmdev/webgl/main.d.ts +2 -1
  198. package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.d.ts +12 -0
  199. package/package.json +25 -23
@@ -1,8 +1,8 @@
1
- import type { Array16, Index } from '../../types/CommonTypes';
1
+ import type { Array16, ArrayType, FloatTypedArrayConstructor, Index, TypedArray } from '../../types/CommonTypes';
2
2
  import type { IMatrix33, IMatrix44, IMutableMatrix, IMutableMatrix44 } from './IMatrix';
3
3
  import type { IQuaternion } from './IQuaternion';
4
4
  import type { IVector3 } from './IVector';
5
- import { Matrix44 } from './Matrix44';
5
+ import { Matrix44_ } from './Matrix44';
6
6
  import type { MutableVector3 } from './MutableVector3';
7
7
  /**
8
8
  * A mutable 4x4 matrix class that extends the immutable Matrix44 class.
@@ -18,7 +18,15 @@ import type { MutableVector3 } from './MutableVector3';
18
18
  * matrix.rotateY(Math.PI / 4);
19
19
  * ```
20
20
  */
21
- export declare class MutableMatrix44 extends Matrix44 implements IMutableMatrix, IMutableMatrix44 {
21
+ export declare class MutableMatrix44_<T extends FloatTypedArrayConstructor> extends Matrix44_<T> implements IMutableMatrix, IMutableMatrix44 {
22
+ /**
23
+ * Creates a new MutableMatrix44_ instance.
24
+ * @param m - The typed array containing the matrix components
25
+ * @param options - Configuration object containing the typed array constructor
26
+ */
27
+ constructor(m: TypedArray, options: {
28
+ type: T;
29
+ });
22
30
  /**
23
31
  * Sets the value at position (0,0) in the matrix.
24
32
  *
@@ -253,97 +261,6 @@ export declare class MutableMatrix44 extends Matrix44 implements IMutableMatrix,
253
261
  * @returns The string 'MutableMatrix44'
254
262
  */
255
263
  get className(): string;
256
- /**
257
- * Creates a zero matrix (all elements are 0).
258
- *
259
- * @returns A new MutableMatrix44 instance with all elements set to 0
260
- */
261
- static zero(): MutableMatrix44;
262
- /**
263
- * Creates an identity matrix.
264
- *
265
- * @returns A new MutableMatrix44 instance representing the 4x4 identity matrix
266
- */
267
- static identity(): MutableMatrix44;
268
- /**
269
- * Creates a dummy matrix (typically used as a placeholder).
270
- *
271
- * @returns A new MutableMatrix44 instance representing a dummy matrix
272
- */
273
- static dummy(): MutableMatrix44;
274
- /**
275
- * Creates a transposed matrix from the given matrix.
276
- *
277
- * @param mat - The matrix to transpose
278
- * @returns A new MutableMatrix44 instance that is the transpose of the input matrix
279
- */
280
- static transpose(mat: IMatrix44): MutableMatrix44;
281
- /**
282
- * Creates an inverted matrix from the given matrix.
283
- *
284
- * @param mat - The matrix to invert
285
- * @returns A new MutableMatrix44 instance that is the inverse of the input matrix
286
- */
287
- static invert(mat: IMatrix44): MutableMatrix44;
288
- /**
289
- * Creates a translation matrix from the given vector.
290
- *
291
- * @param vec - The translation vector
292
- * @returns A new MutableMatrix44 instance representing the translation transformation
293
- */
294
- static translate(vec: IVector3): MutableMatrix44;
295
- /**
296
- * Creates a rotation matrix around the X-axis.
297
- *
298
- * @param radian - The rotation angle in radians
299
- * @returns A new MutableMatrix44 instance representing the X-axis rotation
300
- */
301
- static rotateX(radian: number): MutableMatrix44;
302
- /**
303
- * Creates a rotation matrix around the Y-axis.
304
- *
305
- * @param radian - The rotation angle in radians
306
- * @returns A new MutableMatrix44 instance representing the Y-axis rotation
307
- */
308
- static rotateY(radian: number): MutableMatrix44;
309
- /**
310
- * Creates a rotation matrix around the Z-axis.
311
- *
312
- * @param radian - The rotation angle in radians
313
- * @returns A new MutableMatrix44 instance representing the Z-axis rotation
314
- */
315
- static rotateZ(radian: number): MutableMatrix44;
316
- /**
317
- * Creates a rotation matrix with rotations around X, Y, and Z axes in that order.
318
- *
319
- * @param x - Rotation angle around X-axis in radians
320
- * @param y - Rotation angle around Y-axis in radians
321
- * @param z - Rotation angle around Z-axis in radians
322
- * @returns A new MutableMatrix44 instance representing the combined rotation
323
- */
324
- static rotateXYZ(x: number, y: number, z: number): MutableMatrix44;
325
- /**
326
- * Creates a rotation matrix from a vector containing X, Y, Z rotation angles.
327
- *
328
- * @param vec - Vector containing rotation angles (x, y, z) in radians
329
- * @returns A new MutableMatrix44 instance representing the rotation transformation
330
- */
331
- static rotate(vec: IVector3): MutableMatrix44;
332
- /**
333
- * Creates a scaling matrix from the given vector.
334
- *
335
- * @param vec - The scaling factors for X, Y, and Z axes
336
- * @returns A new MutableMatrix44 instance representing the scaling transformation
337
- */
338
- static scale(vec: IVector3): MutableMatrix44;
339
- /**
340
- * Multiplies two matrices and returns the result as a new matrix.
341
- *
342
- * @param l_mat - The left matrix in the multiplication
343
- * @param r_mat - The right matrix in the multiplication
344
- * @returns A new MutableMatrix44 instance representing the product l_mat * r_mat
345
- */
346
- static multiply(l_mat: IMatrix44, r_mat: IMatrix44): MutableMatrix44;
347
264
  /**
348
265
  * Creates a copy of this matrix.
349
266
  *
@@ -380,7 +297,7 @@ export declare class MutableMatrix44 extends Matrix44 implements IMutableMatrix,
380
297
  *
381
298
  * @returns The internal Float32Array with matrix values in column-major order
382
299
  */
383
- raw(): Float32Array;
300
+ raw(): TypedArray;
384
301
  /**
385
302
  * Sets a value at the specified row and column position.
386
303
  *
@@ -439,9 +356,21 @@ export declare class MutableMatrix44 extends Matrix44 implements IMutableMatrix,
439
356
  * @returns This matrix instance for method chaining
440
357
  */
441
358
  transpose(): MutableMatrix44;
359
+ /**
360
+ * Attempts to invert this matrix in place.
361
+ *
362
+ * The matrix is left unchanged when it is numerically singular, which
363
+ * lets callers keep the previous valid value.
364
+ *
365
+ * @returns True if the inversion succeeded, false if the matrix is singular
366
+ */
367
+ tryInvert(): boolean;
442
368
  /**
443
369
  * Inverts this matrix in place.
444
- * The matrix must be invertible (determinant != 0), otherwise an error is logged.
370
+ *
371
+ * If the matrix is numerically singular, it is set to the identity matrix
372
+ * instead of being filled with `Infinity`/`NaN`.
373
+ * Use {@link MutableMatrix44.tryInvert} when the caller needs to detect the failure.
445
374
  *
446
375
  * @returns This matrix instance for method chaining
447
376
  */
@@ -543,103 +472,150 @@ export declare class MutableMatrix44 extends Matrix44 implements IMutableMatrix,
543
472
  * @returns This matrix instance for method chaining
544
473
  */
545
474
  fromQuaternion(quat: IQuaternion): MutableMatrix44;
475
+ }
476
+ export declare class MutableMatrix44 extends MutableMatrix44_<Float32ArrayConstructor> {
546
477
  /**
547
- * Creates a matrix from 16 values in row-major order.
548
- * Values are provided in row-major order but stored internally in column-major order.
549
- *
550
- * @param m00-m33 - Matrix elements in row-major order
551
- * @returns A new MutableMatrix44 instance
478
+ * Creates a new MutableMatrix44 instance.
479
+ * @param m - The typed array containing the matrix components
552
480
  */
481
+ constructor(m: TypedArray);
482
+ /** Creates a zero matrix. */
483
+ static zero(): MutableMatrix44;
484
+ /** Creates an identity matrix (optimized IdentityMatrix44 instance). */
485
+ static identity(): MutableMatrix44;
486
+ /** Creates a dummy matrix with an empty array. */
487
+ static dummy(): MutableMatrix44;
488
+ /** Creates the transpose of the given matrix. */
489
+ static transpose(mat: IMatrix44): MutableMatrix44;
490
+ /** Attempts to invert the given matrix, returning null when it is singular. */
491
+ static tryInvert(mat: IMatrix44): MutableMatrix44 | null;
492
+ /** Creates the inverse of the given matrix (identity when singular). */
493
+ static invert(mat: IMatrix44): MutableMatrix44;
494
+ /** Attempts to invert the given matrix into outMat. */
495
+ static tryInvertTo<T extends IMutableMatrix44>(mat: IMatrix44, outMat: T): boolean;
496
+ /** Inverts the given matrix into outMat (identity when singular). */
497
+ static invertTo<T extends IMutableMatrix44>(mat: IMatrix44, outMat: T): T;
498
+ /** Creates a translation matrix. */
499
+ static translate(vec: IVector3): MutableMatrix44;
500
+ /** Creates a rotation matrix around the X-axis. */
501
+ static rotateX(radian: number): MutableMatrix44;
502
+ /** Creates a rotation matrix around the Y-axis. */
503
+ static rotateY(radian: number): MutableMatrix44;
504
+ /** Creates a rotation matrix around the Z-axis. */
505
+ static rotateZ(radian: number): MutableMatrix44;
506
+ /** Creates a rotation matrix from Euler angles in XYZ order. */
507
+ static rotateXYZ(x: number, y: number, z: number): MutableMatrix44;
508
+ /** Creates a rotation matrix from a vector containing Euler angles. */
509
+ static rotate(vec: IVector3): MutableMatrix44;
510
+ /** Creates a scaling matrix. */
511
+ static scale(vec: IVector3): MutableMatrix44;
512
+ /** Multiplies two matrices. */
513
+ static multiply(l_mat: IMatrix44, r_mat: IMatrix44): MutableMatrix44;
514
+ /** Multiplies two matrices and stores the result in outMat. */
515
+ static multiplyTo<T extends IMutableMatrix44>(l_mat: IMatrix44, r_mat: IMatrix44, outMat: T): T;
516
+ /** Multiplies a matrix with typed array data and stores the result in outMat. */
517
+ static multiplyTypedArrayTo<T extends IMutableMatrix44>(l_mat: IMatrix44, r_array: ArrayType, outMat: T, offsetAsComposition: number): T;
518
+ /** Creates a rotation matrix from a quaternion and stores it in outMat. */
519
+ static fromQuaternionTo<T extends IMutableMatrix44>(quat: IQuaternion, outMat: T): T;
520
+ /** Creates a matrix from row-major components. */
553
521
  static fromCopy16RowMajor(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): MutableMatrix44;
554
- /**
555
- * Creates a matrix from 16 values in column-major order.
556
- *
557
- * @param m00-m33 - Matrix elements in column-major order
558
- * @returns A new MutableMatrix44 instance
559
- */
522
+ /** Creates a matrix from column-major components. */
560
523
  static fromCopy16ColumnMajor(m00: number, m10: number, m20: number, m30: number, m01: number, m11: number, m21: number, m31: number, m02: number, m12: number, m22: number, m32: number, m03: number, m13: number, m23: number, m33: number): MutableMatrix44;
561
- /**
562
- * Creates a new MutableMatrix44 from an existing Matrix44 instance.
563
- * This creates a copy of the matrix data, so modifications to the new matrix
564
- * will not affect the original.
565
- *
566
- * @param mat - The source Matrix44 to copy from
567
- * @returns A new MutableMatrix44 instance with copied data
568
- */
524
+ /** Creates a matrix by copying another matrix. */
569
525
  static fromCopyMatrix44(mat: IMatrix44): MutableMatrix44;
570
- /**
571
- * Creates a new MutableMatrix44 directly from a Float32Array in column-major order.
572
- * This method does not copy the array, so the matrix will share the same memory
573
- * as the input array.
574
- *
575
- * @param float32Array - A Float32Array containing 16 elements in column-major order
576
- * @returns A new MutableMatrix44 instance using the provided array
577
- */
578
- static fromFloat32ArrayColumnMajor(float32Array: Float32Array): MutableMatrix44;
579
- /**
580
- * Creates a new MutableMatrix44 from a Float32Array in column-major order.
581
- * This method creates a copy of the input array, so modifications to the matrix
582
- * will not affect the original array.
583
- *
584
- * @param float32Array - A Float32Array containing 16 elements in column-major order
585
- * @returns A new MutableMatrix44 instance with copied data
586
- */
587
- static fromCopyFloat32ArrayColumnMajor(float32Array: Float32Array): MutableMatrix44;
588
- /**
589
- * Creates a new MutableMatrix44 from a Float32Array in row-major order.
590
- * The input data is converted from row-major to column-major order during creation.
591
- *
592
- * @param array - A Float32Array containing 16 elements in row-major order
593
- * @returns A new MutableMatrix44 instance with data converted to column-major order
594
- */
526
+ /** Creates a matrix that directly uses the given Float32Array. */
527
+ static fromFloat32ArrayColumnMajor(array: Float32Array): MutableMatrix44;
528
+ /** Creates a matrix by copying a Float32Array in column-major order. */
529
+ static fromCopyFloat32ArrayColumnMajor(array: Float32Array): MutableMatrix44;
530
+ /** Creates a matrix by copying a Float32Array in row-major order. */
595
531
  static fromCopyFloat32ArrayRowMajor(array: Float32Array): MutableMatrix44;
596
- /**
597
- * Creates a new MutableMatrix44 from a 3x3 matrix.
598
- * The 3x3 matrix is embedded in the upper-left corner of the 4x4 matrix,
599
- * with the bottom row and right column set to [0, 0, 0, 1].
600
- *
601
- * @param mat - The source 3x3 matrix to convert
602
- * @returns A new MutableMatrix44 instance with the 3x3 matrix embedded
603
- */
532
+ /** Creates a matrix from a 3x3 matrix embedded in the upper-left corner. */
604
533
  static fromCopyMatrix33(mat: IMatrix33): MutableMatrix44;
605
- /**
606
- * Creates a new MutableMatrix44 from an Array16 in column-major order.
607
- * This method copies the array data into a new Float32Array.
608
- *
609
- * @param array - An Array16 containing 16 elements in column-major order
610
- * @returns A new MutableMatrix44 instance with copied data
611
- */
534
+ /** Creates a matrix from a 16-element array in column-major order. */
612
535
  static fromCopyArray16ColumnMajor(array: Array16<number>): MutableMatrix44;
613
- /**
614
- * Creates a new MutableMatrix44 from a regular array in column-major order.
615
- * Only the first 16 elements are used if the array is larger.
616
- *
617
- * @param array - An array containing at least 16 elements in column-major order
618
- * @returns A new MutableMatrix44 instance with copied data
619
- */
536
+ /** Creates a matrix from an array in column-major order. */
620
537
  static fromCopyArrayColumnMajor(array: Array<number>): MutableMatrix44;
621
- /**
622
- * Creates a new MutableMatrix44 from an Array16 in row-major order.
623
- * The input data is converted from row-major to column-major order during creation.
624
- *
625
- * @param array - An Array16 containing 16 elements in row-major order
626
- * @returns A new MutableMatrix44 instance with data converted to column-major order
627
- */
538
+ /** Creates a matrix from a 16-element array in row-major order. */
628
539
  static fromCopyArray16RowMajor(array: Array16<number>): MutableMatrix44;
629
- /**
630
- * Creates a new MutableMatrix44 from a regular array in row-major order.
631
- * The input data is converted from row-major to column-major order during creation.
632
- * Only the first 16 elements are used if the array is larger.
633
- *
634
- * @param array - An array containing at least 16 elements in row-major order
635
- * @returns A new MutableMatrix44 instance with data converted to column-major order
636
- */
540
+ /** Creates a matrix from an array in row-major order. */
637
541
  static fromCopyArrayRowMajor(array: Array<number>): MutableMatrix44;
638
- /**
639
- * Creates a matrix from a quaternion.
640
- *
641
- * @param q - The quaternion to convert
642
- * @returns A new MutableMatrix44 instance representing the rotation
643
- */
542
+ /** Creates a rotation matrix from a quaternion. */
644
543
  static fromCopyQuaternion(q: IQuaternion): MutableMatrix44;
645
544
  }
545
+ /**
546
+ * Immutable 4x4 matrix with 64-bit float components.
547
+ * Use this implementation when higher numerical precision is required.
548
+ */
549
+ export declare class MutableMatrix44D extends MutableMatrix44_<Float64ArrayConstructor> {
550
+ /**
551
+ * Creates a new MutableMatrix44D instance.
552
+ * @param m - The typed array containing the matrix components
553
+ */
554
+ private constructor();
555
+ /** Creates a zero matrix. */
556
+ static zero(): MutableMatrix44D;
557
+ /** Creates an identity matrix. */
558
+ static identity(): MutableMatrix44D;
559
+ /** Creates a dummy matrix with an empty array. */
560
+ static dummy(): MutableMatrix44D;
561
+ /** Creates the transpose of the given matrix. */
562
+ static transpose(mat: IMatrix44): MutableMatrix44D;
563
+ /** Attempts to invert the given matrix, returning null when it is singular. */
564
+ static tryInvert(mat: IMatrix44): MutableMatrix44D | null;
565
+ /** Creates the inverse of the given matrix (identity when singular). */
566
+ static invert(mat: IMatrix44): MutableMatrix44D;
567
+ /** Attempts to invert the given matrix into outMat. */
568
+ static tryInvertTo<T extends IMutableMatrix44>(mat: IMatrix44, outMat: T): boolean;
569
+ /** Inverts the given matrix into outMat (identity when singular). */
570
+ static invertTo<T extends IMutableMatrix44>(mat: IMatrix44, outMat: T): T;
571
+ /** Creates a translation matrix. */
572
+ static translate(vec: IVector3): MutableMatrix44D;
573
+ /** Creates a rotation matrix around the X-axis. */
574
+ static rotateX(radian: number): MutableMatrix44D;
575
+ /** Creates a rotation matrix around the Y-axis. */
576
+ static rotateY(radian: number): MutableMatrix44D;
577
+ /** Creates a rotation matrix around the Z-axis. */
578
+ static rotateZ(radian: number): MutableMatrix44D;
579
+ /** Creates a rotation matrix from Euler angles in XYZ order. */
580
+ static rotateXYZ(x: number, y: number, z: number): MutableMatrix44D;
581
+ /** Creates a rotation matrix from a vector containing Euler angles. */
582
+ static rotate(vec: IVector3): MutableMatrix44D;
583
+ /** Creates a scaling matrix. */
584
+ static scale(vec: IVector3): MutableMatrix44D;
585
+ /** Multiplies two matrices. */
586
+ static multiply(l_mat: IMatrix44, r_mat: IMatrix44): MutableMatrix44D;
587
+ /** Multiplies two matrices and stores the result in outMat. */
588
+ static multiplyTo<T extends IMutableMatrix44>(l_mat: IMatrix44, r_mat: IMatrix44, outMat: T): T;
589
+ /** Multiplies a matrix with typed array data and stores the result in outMat. */
590
+ static multiplyTypedArrayTo<T extends IMutableMatrix44>(l_mat: IMatrix44, r_array: ArrayType, outMat: T, offsetAsComposition: number): T;
591
+ /** Creates a rotation matrix from a quaternion and stores it in outMat. */
592
+ static fromQuaternionTo<T extends IMutableMatrix44>(quat: IQuaternion, outMat: T): T;
593
+ /** Creates a matrix from row-major components. */
594
+ static fromCopy16RowMajor(m00: number, m01: number, m02: number, m03: number, m10: number, m11: number, m12: number, m13: number, m20: number, m21: number, m22: number, m23: number, m30: number, m31: number, m32: number, m33: number): MutableMatrix44D;
595
+ /** Creates a matrix from column-major components. */
596
+ static fromCopy16ColumnMajor(m00: number, m10: number, m20: number, m30: number, m01: number, m11: number, m21: number, m31: number, m02: number, m12: number, m22: number, m32: number, m03: number, m13: number, m23: number, m33: number): MutableMatrix44D;
597
+ /** Creates a matrix by copying another matrix. */
598
+ static fromCopyMatrix44(mat: IMatrix44): MutableMatrix44D;
599
+ /** Creates a matrix that directly uses the given Float64Array. */
600
+ static fromFloat64ArrayColumnMajor(array: Float64Array): MutableMatrix44D;
601
+ /** Creates a matrix by copying a Float64Array in column-major order. */
602
+ static fromCopyFloat64ArrayColumnMajor(array: Float64Array): MutableMatrix44D;
603
+ /** Creates a matrix by copying a Float64Array in row-major order. */
604
+ static fromCopyFloat64ArrayRowMajor(array: Float64Array): MutableMatrix44D;
605
+ /** Creates a matrix from a 3x3 matrix embedded in the upper-left corner. */
606
+ static fromCopyMatrix33(mat: IMatrix33): MutableMatrix44D;
607
+ /** Creates a matrix from a 16-element array in column-major order. */
608
+ static fromCopyArray16ColumnMajor(array: Array16<number>): MutableMatrix44D;
609
+ /** Creates a matrix from an array in column-major order. */
610
+ static fromCopyArrayColumnMajor(array: Array<number>): MutableMatrix44D;
611
+ /** Creates a matrix from a 16-element array in row-major order. */
612
+ static fromCopyArray16RowMajor(array: Array16<number>): MutableMatrix44D;
613
+ /** Creates a matrix from an array in row-major order. */
614
+ static fromCopyArrayRowMajor(array: Array<number>): MutableMatrix44D;
615
+ /** Creates a rotation matrix from a quaternion. */
616
+ static fromCopyQuaternion(q: IQuaternion): MutableMatrix44D;
617
+ }
618
+ /**
619
+ * Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
620
+ */
621
+ export { MutableMatrix44 as MutableMatrix44F };