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,9 +1,8 @@
1
1
  import type { Array4 } from '../../types';
2
+ import type { FloatTypedArrayConstructor, TypedArray } from '../../types/CommonTypes';
2
3
  import { AbstractMatrix } from './AbstractMatrix';
3
- import type { IMatrix22 } from './IMatrix';
4
+ import type { IMatrix22, IMutableMatrix22 } from './IMatrix';
4
5
  import type { IVector2 } from './IVector';
5
- import type { Matrix33 } from './Matrix33';
6
- import type { MutableMatrix22 } from './MutableMatrix22';
7
6
  import type { MutableVector2 } from './MutableVector2';
8
7
  import { Vector2 } from './Vector2';
9
8
  /**
@@ -31,13 +30,16 @@ import { Vector2 } from './Vector2';
31
30
  * const scale = Matrix22.scale(Vector2.fromCopyArray2([2, 3]));
32
31
  * ```
33
32
  */
34
- export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
33
+ export declare class Matrix22_<T extends FloatTypedArrayConstructor> extends AbstractMatrix implements IMatrix22 {
35
34
  /**
36
- * Creates a new Matrix22 instance.
35
+ * Creates a new Matrix22_ instance.
37
36
  *
38
- * @param m - Float32Array containing matrix values in column-major order
37
+ * @param m - Typed array containing matrix values in column-major order
38
+ * @param _options - Configuration object containing the typed array constructor
39
39
  */
40
- constructor(m: Float32Array);
40
+ constructor(m: TypedArray, _options: {
41
+ type: T;
42
+ });
41
43
  /**
42
44
  * Gets the matrix element at row 0, column 0.
43
45
  *
@@ -109,7 +111,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
109
111
  * // | 0 0 |
110
112
  * ```
111
113
  */
112
- static zero(): Matrix22;
114
+ static _zero(type: FloatTypedArrayConstructor): IMatrix22;
113
115
  /**
114
116
  * Creates a 2x2 identity matrix.
115
117
  *
@@ -123,14 +125,14 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
123
125
  * // | 0 1 |
124
126
  * ```
125
127
  */
126
- static identity(): Matrix22;
128
+ static _identity(type: FloatTypedArrayConstructor): IMatrix22;
127
129
  /**
128
130
  * Creates a dummy matrix with empty data.
129
131
  * Used as a placeholder when no valid matrix data is available.
130
132
  *
131
133
  * @returns A new Matrix22 with empty Float32Array
132
134
  */
133
- static dummy(): Matrix22;
135
+ static _dummy(type: FloatTypedArrayConstructor): IMatrix22;
134
136
  /**
135
137
  * Creates the transpose of the given matrix.
136
138
  * The transpose swaps rows and columns: (i,j) becomes (j,i).
@@ -147,7 +149,18 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
147
149
  * // | 3 4 | | 2 4 |
148
150
  * ```
149
151
  */
150
- static transpose(mat: IMatrix22): Matrix22;
152
+ static _transpose(mat: IMatrix22, type: FloatTypedArrayConstructor): IMatrix22;
153
+ /**
154
+ * Attempts to create the inverse of the given matrix.
155
+ *
156
+ * Unlike `invert`, this method never returns a matrix filled with
157
+ * `Infinity`/`NaN`: it returns `null` when the matrix is numerically
158
+ * singular (see {@link MathUtil.isSingularDet}).
159
+ *
160
+ * @param mat - The matrix to invert
161
+ * @returns A new Matrix22, or null if the matrix is not invertible
162
+ */
163
+ static _tryInvert(mat: IMatrix22, type: FloatTypedArrayConstructor): IMatrix22 | null;
151
164
  /**
152
165
  * Creates the inverse of the given matrix.
153
166
  *
@@ -157,9 +170,13 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
157
170
  * where A = | a b | and det(A) = ad - bc
158
171
  * | c d |
159
172
  *
173
+ * If the matrix is numerically singular, an identity matrix is returned
174
+ * instead of dividing by zero. Use {@link Matrix22.tryInvert} when the
175
+ * caller needs to detect the failure.
176
+ *
160
177
  * @param mat - The matrix to invert
161
- * @returns A new Matrix22 that is the inverse of the input matrix
162
- * @throws Error if the matrix is singular (determinant is 0)
178
+ * @returns A new Matrix22 that is the inverse of the input matrix,
179
+ * or the identity matrix if the input is singular
163
180
  *
164
181
  * @example
165
182
  * ```typescript
@@ -170,17 +187,32 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
170
187
  * // | 0 0.5 |
171
188
  * ```
172
189
  */
173
- static invert(mat: IMatrix22): Matrix22;
190
+ static _invert(mat: IMatrix22, type: FloatTypedArrayConstructor): IMatrix22;
191
+ /**
192
+ * Attempts to calculate the inverse of the given matrix and stores the
193
+ * result in the output matrix.
194
+ *
195
+ * The output matrix is left untouched when the input is numerically
196
+ * singular, which lets callers keep the previous valid value.
197
+ *
198
+ * @param mat - The matrix to invert
199
+ * @param outMat - The mutable matrix to store the result
200
+ * @returns True if the inversion succeeded, false if the matrix is singular
201
+ */
202
+ static _tryInvertTo(mat: IMatrix22, outMat: IMutableMatrix22): boolean;
174
203
  /**
175
204
  * Calculates the inverse of the given matrix and stores the result in the output matrix.
176
205
  * This method avoids creating a new matrix instance for better performance.
177
206
  *
207
+ * If the matrix is numerically singular, the output matrix is set to the
208
+ * identity matrix instead of being filled with `Infinity`/`NaN`.
209
+ * Use {@link Matrix22.tryInvertTo} when the caller needs to detect the failure.
210
+ *
178
211
  * @param mat - The matrix to invert
179
212
  * @param outMat - The mutable matrix to store the result
180
- * @returns The output matrix containing the inverse
181
- * @throws Error if the matrix is singular (determinant is 0)
213
+ * @returns The output matrix containing the inverse, or the identity matrix if the input is singular
182
214
  */
183
- static invertTo(mat: Matrix22, outMat: MutableMatrix22): MutableMatrix22;
215
+ static _invertTo(mat: IMatrix22, outMat: IMutableMatrix22): IMutableMatrix22;
184
216
  /**
185
217
  * Creates a 2D rotation matrix for the given angle.
186
218
  *
@@ -197,7 +229,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
197
229
  * const rotation = Matrix22.rotate(Math.PI / 2);
198
230
  * ```
199
231
  */
200
- static rotate(radian: number): Matrix22;
232
+ static _rotate(radian: number, type: FloatTypedArrayConstructor): IMatrix22;
201
233
  /**
202
234
  * Creates a 2D scaling matrix from a 2D vector.
203
235
  *
@@ -214,7 +246,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
214
246
  * // Creates a matrix that scales x by 2 and y by 3
215
247
  * ```
216
248
  */
217
- static scale(vec: IVector2): Matrix22;
249
+ static _scale(vec: IVector2, type: FloatTypedArrayConstructor): IMatrix22;
218
250
  /**
219
251
  * Multiplies two 2x2 matrices and returns the result.
220
252
  * Matrix multiplication is not commutative: A * B ≠ B * A in general.
@@ -230,7 +262,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
230
262
  * const result = Matrix22.multiply(a, b); // Scale then rotate
231
263
  * ```
232
264
  */
233
- static multiply(l_mat: IMatrix22, r_mat: IMatrix22): Matrix22;
265
+ static _multiply(l_mat: IMatrix22, r_mat: IMatrix22, type: FloatTypedArrayConstructor): IMatrix22;
234
266
  /**
235
267
  * Multiplies two matrices and stores the result in the output matrix.
236
268
  * This method avoids creating a new matrix instance for better performance.
@@ -243,7 +275,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
243
275
  * @param outMat - The mutable matrix to store the result
244
276
  * @returns The output matrix containing the product
245
277
  */
246
- static multiplyTo(l_mat: Matrix33, r_mat: Matrix33, outMat: MutableMatrix22): MutableMatrix22;
278
+ static _multiplyTo(l_mat: IMatrix22, r_mat: IMatrix22, outMat: IMutableMatrix22): IMutableMatrix22;
247
279
  /**
248
280
  * Returns a string representation of the matrix in a readable format.
249
281
  *
@@ -401,7 +433,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
401
433
  * // | 3 4 |
402
434
  * ```
403
435
  */
404
- static fromCopy4RowMajor(m00: number, m01: number, m10: number, m11: number): Matrix22;
436
+ static _fromCopy4RowMajor(m00: number, m01: number, m10: number, m11: number, type: FloatTypedArrayConstructor): IMatrix22;
405
437
  /**
406
438
  * Creates a new Matrix22 from individual components in column-major order.
407
439
  *
@@ -417,7 +449,7 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
417
449
  * @param m11 - Element at row 1, column 1
418
450
  * @returns A new Matrix22 with the specified values
419
451
  */
420
- static fromCopy4ColumnMajor(m00: number, m10: number, m01: number, m11: number): Matrix22;
452
+ static _fromCopy4ColumnMajor(m00: number, m10: number, m01: number, m11: number, type: FloatTypedArrayConstructor): IMatrix22;
421
453
  /**
422
454
  * Creates a new Matrix22 that directly uses the provided Float32Array.
423
455
  * The array is used as-is without copying, so modifications to the array
@@ -426,35 +458,35 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
426
458
  * @param float32Array - Float32Array containing matrix values in column-major order
427
459
  * @returns A new Matrix22 using the provided array
428
460
  */
429
- static fromFloat32ArrayColumnMajor(float32Array: Float32Array): Matrix22;
461
+ static _fromTypedArrayColumnMajor(array: TypedArray, type: FloatTypedArrayConstructor): IMatrix22;
430
462
  /**
431
463
  * Creates a new Matrix22 by copying values from a Float32Array in column-major order.
432
464
  *
433
465
  * @param float32Array - Float32Array containing matrix values in column-major order
434
466
  * @returns A new Matrix22 with copied values
435
467
  */
436
- static fromCopyFloat32ArrayColumnMajor(float32Array: Float32Array): Matrix22;
468
+ static _fromCopyTypedArrayColumnMajor(array: TypedArray, type: FloatTypedArrayConstructor): IMatrix22;
437
469
  /**
438
470
  * Creates a new Matrix22 by copying values from a Float32Array in row-major order.
439
471
  *
440
472
  * @param array - Float32Array containing matrix values in row-major order
441
473
  * @returns A new Matrix22 with values converted to column-major order
442
474
  */
443
- static fromCopyFloat32ArrayRowMajor(array: Float32Array): Matrix22;
475
+ static _fromCopyTypedArrayRowMajor(array: TypedArray, type: FloatTypedArrayConstructor): IMatrix22;
444
476
  /**
445
477
  * Creates a new Matrix22 by copying values from another IMatrix22.
446
478
  *
447
479
  * @param mat - The matrix to copy from
448
480
  * @returns A new Matrix22 with copied values
449
481
  */
450
- static fromCopyMatrix22(mat: IMatrix22): Matrix22;
482
+ static _fromCopyMatrix22(mat: IMatrix22, type: FloatTypedArrayConstructor): IMatrix22;
451
483
  /**
452
484
  * Creates a new Matrix22 from a 4-element array in column-major order.
453
485
  *
454
486
  * @param array - Array4 containing exactly 4 numbers in column-major order
455
487
  * @returns A new Matrix22 with the array values
456
488
  */
457
- static fromCopyArray9ColumnMajor(array: Array4<number>): Matrix22;
489
+ static _fromCopyArray4ColumnMajor(array: Array4<number>, type: FloatTypedArrayConstructor): IMatrix22;
458
490
  /**
459
491
  * Creates a new Matrix22 from a variable-length array in column-major order.
460
492
  * Only the first 4 elements are used.
@@ -462,14 +494,14 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
462
494
  * @param array - Array containing matrix values in column-major order
463
495
  * @returns A new Matrix22 with the first 4 array values
464
496
  */
465
- static fromCopyArrayColumnMajor(array: Array<number>): Matrix22;
497
+ static _fromCopyArrayColumnMajor(array: Array<number>, type: FloatTypedArrayConstructor): IMatrix22;
466
498
  /**
467
499
  * Creates a new Matrix22 from a 4-element array in row-major order.
468
500
  *
469
501
  * @param array - Array4 containing exactly 4 numbers in row-major order
470
502
  * @returns A new Matrix22 with values converted to column-major order
471
503
  */
472
- static fromCopyArray9RowMajor(array: Array4<number>): Matrix22;
504
+ static _fromCopyArray4RowMajor(array: Array4<number>, type: FloatTypedArrayConstructor): IMatrix22;
473
505
  /**
474
506
  * Creates a new Matrix22 from a variable-length array in row-major order.
475
507
  * Only the first 4 elements are used.
@@ -477,5 +509,119 @@ export declare class Matrix22 extends AbstractMatrix implements IMatrix22 {
477
509
  * @param array - Array containing matrix values in row-major order
478
510
  * @returns A new Matrix22 with values converted to column-major order
479
511
  */
512
+ static _fromCopyArrayRowMajor(array: Array<number>, type: FloatTypedArrayConstructor): IMatrix22;
513
+ }
514
+ /**
515
+ * Immutable 2x2 matrix with 32-bit float components.
516
+ * This is the standard precision implementation for most 2D graphics operations.
517
+ */
518
+ export declare class Matrix22 extends Matrix22_<Float32ArrayConstructor> {
519
+ /**
520
+ * Creates a new Matrix22 instance.
521
+ * @param m - The typed array containing the matrix components
522
+ */
523
+ constructor(m: TypedArray);
524
+ /** Creates a zero matrix. */
525
+ static zero(): Matrix22;
526
+ /** Creates an identity matrix. */
527
+ static identity(): Matrix22;
528
+ /** Creates a dummy matrix with an empty array. */
529
+ static dummy(): Matrix22;
530
+ /** Creates the transpose of the given matrix. */
531
+ static transpose(mat: IMatrix22): Matrix22;
532
+ /** Attempts to invert the given matrix, returning null when it is singular. */
533
+ static tryInvert(mat: IMatrix22): Matrix22 | null;
534
+ /** Creates the inverse of the given matrix (identity when singular). */
535
+ static invert(mat: IMatrix22): Matrix22;
536
+ /** Attempts to invert the given matrix into outMat. */
537
+ static tryInvertTo<T extends IMutableMatrix22>(mat: IMatrix22, outMat: T): boolean;
538
+ /** Inverts the given matrix into outMat (identity when singular). */
539
+ static invertTo<T extends IMutableMatrix22>(mat: IMatrix22, outMat: T): T;
540
+ /** Creates a 2D rotation matrix. */
541
+ static rotate(radian: number): Matrix22;
542
+ /** Creates a 2D scaling matrix. */
543
+ static scale(vec: IVector2): Matrix22;
544
+ /** Multiplies two 2x2 matrices. */
545
+ static multiply(l_mat: IMatrix22, r_mat: IMatrix22): Matrix22;
546
+ /** Multiplies two matrices and stores the result in outMat. */
547
+ static multiplyTo<T extends IMutableMatrix22>(l_mat: IMatrix22, r_mat: IMatrix22, outMat: T): T;
548
+ /** Creates a matrix from row-major components. */
549
+ static fromCopy4RowMajor(m00: number, m01: number, m10: number, m11: number): Matrix22;
550
+ /** Creates a matrix from column-major components. */
551
+ static fromCopy4ColumnMajor(m00: number, m10: number, m01: number, m11: number): Matrix22;
552
+ /** Creates a matrix that directly uses the given Float32Array. */
553
+ static fromFloat32ArrayColumnMajor(array: Float32Array): Matrix22;
554
+ /** Creates a matrix by copying a Float32Array in column-major order. */
555
+ static fromCopyFloat32ArrayColumnMajor(array: Float32Array): Matrix22;
556
+ /** Creates a matrix by copying a Float32Array in row-major order. */
557
+ static fromCopyFloat32ArrayRowMajor(array: Float32Array): Matrix22;
558
+ /** Creates a matrix by copying another matrix. */
559
+ static fromCopyMatrix22(mat: IMatrix22): Matrix22;
560
+ /** Creates a matrix from a 4-element array in column-major order. */
561
+ static fromCopyArray9ColumnMajor(array: Array4<number>): Matrix22;
562
+ /** Creates a matrix from an array in column-major order. */
563
+ static fromCopyArrayColumnMajor(array: Array<number>): Matrix22;
564
+ /** Creates a matrix from a 4-element array in row-major order. */
565
+ static fromCopyArray9RowMajor(array: Array4<number>): Matrix22;
566
+ /** Creates a matrix from an array in row-major order. */
480
567
  static fromCopyArrayRowMajor(array: Array<number>): Matrix22;
481
568
  }
569
+ /**
570
+ * Immutable 2x2 matrix with 64-bit float components.
571
+ * Use this implementation when higher numerical precision is required.
572
+ */
573
+ export declare class Matrix22D extends Matrix22_<Float64ArrayConstructor> {
574
+ /**
575
+ * Creates a new Matrix22D instance.
576
+ * @param m - The typed array containing the matrix components
577
+ */
578
+ private constructor();
579
+ /** Creates a zero matrix. */
580
+ static zero(): Matrix22D;
581
+ /** Creates an identity matrix. */
582
+ static identity(): Matrix22D;
583
+ /** Creates a dummy matrix with an empty array. */
584
+ static dummy(): Matrix22D;
585
+ /** Creates the transpose of the given matrix. */
586
+ static transpose(mat: IMatrix22): Matrix22D;
587
+ /** Attempts to invert the given matrix, returning null when it is singular. */
588
+ static tryInvert(mat: IMatrix22): Matrix22D | null;
589
+ /** Creates the inverse of the given matrix (identity when singular). */
590
+ static invert(mat: IMatrix22): Matrix22D;
591
+ /** Attempts to invert the given matrix into outMat. */
592
+ static tryInvertTo<T extends IMutableMatrix22>(mat: IMatrix22, outMat: T): boolean;
593
+ /** Inverts the given matrix into outMat (identity when singular). */
594
+ static invertTo<T extends IMutableMatrix22>(mat: IMatrix22, outMat: T): T;
595
+ /** Creates a 2D rotation matrix. */
596
+ static rotate(radian: number): Matrix22D;
597
+ /** Creates a 2D scaling matrix. */
598
+ static scale(vec: IVector2): Matrix22D;
599
+ /** Multiplies two 2x2 matrices. */
600
+ static multiply(l_mat: IMatrix22, r_mat: IMatrix22): Matrix22D;
601
+ /** Multiplies two matrices and stores the result in outMat. */
602
+ static multiplyTo<T extends IMutableMatrix22>(l_mat: IMatrix22, r_mat: IMatrix22, outMat: T): T;
603
+ /** Creates a matrix from row-major components. */
604
+ static fromCopy4RowMajor(m00: number, m01: number, m10: number, m11: number): Matrix22D;
605
+ /** Creates a matrix from column-major components. */
606
+ static fromCopy4ColumnMajor(m00: number, m10: number, m01: number, m11: number): Matrix22D;
607
+ /** Creates a matrix that directly uses the given Float64Array. */
608
+ static fromFloat64ArrayColumnMajor(array: Float64Array): Matrix22D;
609
+ /** Creates a matrix by copying a Float64Array in column-major order. */
610
+ static fromCopyFloat64ArrayColumnMajor(array: Float64Array): Matrix22D;
611
+ /** Creates a matrix by copying a Float64Array in row-major order. */
612
+ static fromCopyFloat64ArrayRowMajor(array: Float64Array): Matrix22D;
613
+ /** Creates a matrix by copying another matrix. */
614
+ static fromCopyMatrix22(mat: IMatrix22): Matrix22D;
615
+ /** Creates a matrix from a 4-element array in column-major order. */
616
+ static fromCopyArray9ColumnMajor(array: Array4<number>): Matrix22D;
617
+ /** Creates a matrix from an array in column-major order. */
618
+ static fromCopyArrayColumnMajor(array: Array<number>): Matrix22D;
619
+ /** Creates a matrix from a 4-element array in row-major order. */
620
+ static fromCopyArray9RowMajor(array: Array4<number>): Matrix22D;
621
+ /** Creates a matrix from an array in row-major order. */
622
+ static fromCopyArrayRowMajor(array: Array<number>): Matrix22D;
623
+ }
624
+ /**
625
+ * Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
626
+ */
627
+ export { Matrix22 as Matrix22F };