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,4 +1,4 @@
1
- import type { Array4 } from '../../types/CommonTypes';
1
+ import type { Array4, FloatTypedArrayConstructor, TypedArray } from '../../types/CommonTypes';
2
2
  import { AbstractQuaternion } from './AbstractQuaternion';
3
3
  import type { IMatrix44 } from './IMatrix';
4
4
  import type { ILogQuaternion, IMutableQuaternion, IQuaternion } from './IQuaternion';
@@ -26,7 +26,9 @@ import { Vector3 } from './Vector3';
26
26
  * const combined = Quaternion.multiply(rotation1, rotation2);
27
27
  * ```
28
28
  */
29
- export declare class Quaternion extends AbstractQuaternion implements IQuaternion {
29
+ export declare class Quaternion_<T extends FloatTypedArrayConstructor> extends AbstractQuaternion implements IQuaternion {
30
+ /** The typed array constructor used for newly created quaternions. */
31
+ protected static readonly _type: FloatTypedArrayConstructor;
30
32
  private static __tmp_upVec;
31
33
  private static __tmp_vec3_0;
32
34
  private static __tmp_vec3_1;
@@ -35,10 +37,13 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
35
37
  private static __tmp_vec3_4;
36
38
  private static __tmp_vec3_5;
37
39
  /**
38
- * Creates a new Quaternion instance.
39
- * @param x - The Float32Array containing the quaternion components [x, y, z, w]
40
+ * Creates a new Quaternion_ instance.
41
+ * @param x - The typed array containing the quaternion components [x, y, z, w]
42
+ * @param _options - Configuration object containing the typed array constructor
40
43
  */
41
- constructor(x: Float32Array);
44
+ constructor(x: TypedArray, _options?: {
45
+ type: T;
46
+ });
42
47
  /**
43
48
  * Gets the class name for debugging and reflection purposes.
44
49
  * @returns The string "Quaternion"
@@ -76,13 +81,13 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
76
81
  * The identity quaternion is (0, 0, 0, 1) in (x, y, z, w) format.
77
82
  * @returns A new identity quaternion
78
83
  */
79
- static identity(): Quaternion;
84
+ static identity(): Quaternion_<FloatTypedArrayConstructor>;
80
85
  /**
81
86
  * Creates a dummy quaternion with zero-length internal array.
82
87
  * Used as a placeholder or uninitialized quaternion.
83
88
  * @returns A new dummy quaternion
84
89
  */
85
- static dummy(): Quaternion;
90
+ static dummy(): Quaternion_<FloatTypedArrayConstructor>;
86
91
  /**
87
92
  * Computes the inverse of a quaternion.
88
93
  * For a unit quaternion, the inverse is the conjugate divided by the squared magnitude.
@@ -123,7 +128,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
123
128
  * @param ratio - The interpolation parameter (0.0 = l_quat, 1.0 = r_quat)
124
129
  * @returns The linearly interpolated quaternion
125
130
  */
126
- static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): Quaternion;
131
+ static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): Quaternion_<FloatTypedArrayConstructor>;
127
132
  /**
128
133
  * Performs linear interpolation (LERP) and stores the result in the output parameter.
129
134
  * @param l_quat - The starting quaternion
@@ -133,25 +138,88 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
133
138
  * @returns The output quaternion containing the interpolated result
134
139
  */
135
140
  static lerpTo(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number, out: IMutableQuaternion): IMutableQuaternion;
141
+ /**
142
+ * Attempts to create a quaternion from an axis-angle representation.
143
+ *
144
+ * Returns null when the axis has zero length (or contains non-finite values),
145
+ * because such a rotation is undefined.
146
+ *
147
+ * @param vec - The rotation axis (will be normalized internally)
148
+ * @param radian - The rotation angle in radians
149
+ * @returns A quaternion representing the rotation around the given axis, or null
150
+ */
151
+ static tryAxisAngle(vec: IVector3, radian: number): Quaternion | null;
136
152
  /**
137
153
  * Creates a quaternion from an axis-angle representation.
154
+ *
155
+ * If the axis has zero length, an identity quaternion is returned instead of
156
+ * a quaternion filled with `Infinity`/`NaN`.
157
+ * Use {@link Quaternion.tryAxisAngle} when the caller needs to detect the failure.
158
+ *
138
159
  * @param vec - The rotation axis (will be normalized internally)
139
160
  * @param radian - The rotation angle in radians
140
- * @returns A quaternion representing the rotation around the given axis
161
+ * @returns A quaternion representing the rotation around the given axis,
162
+ * or the identity quaternion if the axis is degenerate
141
163
  */
142
164
  static axisAngle(vec: IVector3, radian: number): Quaternion;
165
+ /**
166
+ * Core implementation for extracting a quaternion from a 4x4 matrix.
167
+ * Writes the x, y, z, w components into `outV`.
168
+ *
169
+ * The rotation part is normalized by its column lengths so that scale and
170
+ * translation are ignored. Extraction is impossible (and the result would be
171
+ * `NaN`) when a basis vector has zero length, when the linear part is
172
+ * numerically singular, or when the matrix contains non-finite values.
173
+ *
174
+ * @param mat - The 4x4 matrix containing rotation information
175
+ * @param outV - The destination for the x, y, z, w components
176
+ * @returns True if the quaternion could be extracted, false otherwise
177
+ * @private
178
+ */
179
+ private static __fromMatrixToTypedArray;
180
+ /**
181
+ * Attempts to create a quaternion from a 4x4 rotation matrix.
182
+ * Extracts the rotation component from the matrix and converts it to quaternion form.
183
+ *
184
+ * @param mat - The 4x4 matrix containing rotation information
185
+ * @returns A quaternion representing the same rotation as the matrix, or null
186
+ * if the rotation cannot be extracted (zero-length basis vector,
187
+ * numerically singular linear part, or non-finite values)
188
+ */
189
+ static tryFromMatrix(mat: IMatrix44): Quaternion | null;
143
190
  /**
144
191
  * Creates a quaternion from a 4x4 rotation matrix.
145
192
  * Extracts the rotation component from the matrix and converts it to quaternion form.
193
+ *
194
+ * If the rotation cannot be extracted, an identity quaternion is returned
195
+ * instead of a quaternion filled with `Infinity`/`NaN`.
196
+ * Use {@link Quaternion.tryFromMatrix} when the caller needs to detect the failure.
197
+ *
146
198
  * @param mat - The 4x4 matrix containing rotation information
147
- * @returns A quaternion representing the same rotation as the matrix
199
+ * @returns A quaternion representing the same rotation as the matrix,
200
+ * or the identity quaternion if the rotation cannot be extracted
148
201
  */
149
202
  static fromMatrix(mat: IMatrix44): Quaternion;
203
+ /**
204
+ * Attempts to create a quaternion from a 4x4 rotation matrix and stores it in the output parameter.
205
+ * The output quaternion is left untouched when the rotation cannot be extracted.
206
+ *
207
+ * @param mat - The 4x4 matrix containing rotation information
208
+ * @param out - The output quaternion to store the result
209
+ * @returns True if the quaternion could be extracted, false otherwise
210
+ */
211
+ static tryFromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): boolean;
150
212
  /**
151
213
  * Creates a quaternion from a 4x4 rotation matrix and stores it in the output parameter.
214
+ *
215
+ * If the rotation cannot be extracted, the output quaternion is set to the
216
+ * identity quaternion instead of being filled with `Infinity`/`NaN`.
217
+ * Use {@link Quaternion.tryFromMatrixTo} when the caller needs to detect the failure.
218
+ *
152
219
  * @param mat - The 4x4 matrix containing rotation information
153
220
  * @param out - The output quaternion to store the result
154
- * @returns The output quaternion containing the extracted rotation
221
+ * @returns The output quaternion containing the extracted rotation,
222
+ * or the identity quaternion if the rotation cannot be extracted
155
223
  */
156
224
  static fromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): IMutableQuaternion;
157
225
  /**
@@ -161,17 +229,48 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
161
229
  * @returns A quaternion representing the rotation from fromDirection to toDirection
162
230
  */
163
231
  static lookFromTo(fromDirection: IVector3, toDirection: IVector3): IQuaternion;
232
+ /**
233
+ * Attempts to create a quaternion that looks in the specified forward direction using default up vector (0, 1, 0).
234
+ * @param forward - The forward direction vector
235
+ * @returns A quaternion representing the look rotation, or null if the direction is degenerate
236
+ */
237
+ static tryLookForward(forward: IVector3): Quaternion | null;
164
238
  /**
165
239
  * Creates a quaternion that looks in the specified forward direction using default up vector (0, 1, 0).
240
+ *
241
+ * If the direction is degenerate (zero length), an identity quaternion is
242
+ * returned instead of a quaternion filled with `Infinity`/`NaN`.
243
+ * Use {@link Quaternion.tryLookForward} when the caller needs to detect the failure.
244
+ *
166
245
  * @param forward - The forward direction vector
167
- * @returns A quaternion representing the look rotation
246
+ * @returns A quaternion representing the look rotation,
247
+ * or the identity quaternion if the direction is degenerate
168
248
  */
169
- static lookForward(forward: IVector3): IQuaternion;
249
+ static lookForward(forward: IVector3): Quaternion;
250
+ /**
251
+ * Attempts to create a quaternion that looks in the specified forward direction with a custom up vector.
252
+ *
253
+ * Returns null when either direction has zero length or when the forward and
254
+ * up directions are parallel, because the rotation basis cannot be built.
255
+ *
256
+ * @param forward - The forward direction vector
257
+ * @param up - The up direction vector
258
+ * @returns A quaternion representing the look rotation, or null
259
+ */
260
+ static tryLookForwardAccordingToThisUp(forward: IVector3, up: IVector3): Quaternion | null;
170
261
  /**
171
262
  * Creates a quaternion that looks in the specified forward direction with a custom up vector.
263
+ *
264
+ * If the directions are degenerate (zero length, or forward parallel to up),
265
+ * an identity quaternion is returned instead of a quaternion filled with
266
+ * `Infinity`/`NaN`.
267
+ * Use {@link Quaternion.tryLookForwardAccordingToThisUp} when the caller needs
268
+ * to detect the failure.
269
+ *
172
270
  * @param forward - The forward direction vector
173
271
  * @param up - The up direction vector
174
- * @returns A quaternion representing the look rotation with the specified up vector
272
+ * @returns A quaternion representing the look rotation with the specified up vector,
273
+ * or the identity quaternion if the directions are degenerate
175
274
  */
176
275
  static lookForwardAccordingToThisUp(forward: IVector3, up: IVector3): IQuaternion;
177
276
  /**
@@ -180,14 +279,14 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
180
279
  * @param vec - The position vector
181
280
  * @returns A quaternion with xyz from the vector and w=0
182
281
  */
183
- static fromPosition(vec: IVector3): Quaternion;
282
+ static fromPosition(vec: IVector3): Quaternion_<FloatTypedArrayConstructor>;
184
283
  /**
185
284
  * Adds two quaternions component-wise.
186
285
  * @param l_quat - The left quaternion
187
286
  * @param r_quat - The right quaternion
188
287
  * @returns The sum of the two quaternions
189
288
  */
190
- static add(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
289
+ static add(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion_<FloatTypedArrayConstructor>;
191
290
  /**
192
291
  * Adds two quaternions component-wise and stores the result in the output parameter.
193
292
  * @param l_quat - The left quaternion
@@ -202,7 +301,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
202
301
  * @param r_quat - The right quaternion
203
302
  * @returns The difference of the two quaternions
204
303
  */
205
- static subtract(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
304
+ static subtract(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion_<FloatTypedArrayConstructor>;
206
305
  /**
207
306
  * Subtracts two quaternions component-wise and stores the result in the output parameter.
208
307
  * @param l_quat - The left quaternion
@@ -219,7 +318,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
219
318
  * @param r_quat - The right quaternion
220
319
  * @returns The product of the two quaternions
221
320
  */
222
- static multiply(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
321
+ static multiply(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion_<FloatTypedArrayConstructor>;
223
322
  /**
224
323
  * Multiplies two quaternions and stores the result in the output parameter.
225
324
  * @param l_quat - The left quaternion
@@ -234,7 +333,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
234
333
  * @param value - The scalar value to multiply by
235
334
  * @returns A new quaternion with all components multiplied by the scalar
236
335
  */
237
- static multiplyNumber(quat: IQuaternion, value: number): Quaternion;
336
+ static multiplyNumber(quat: IQuaternion, value: number): Quaternion_<FloatTypedArrayConstructor>;
238
337
  /**
239
338
  * Multiplies a quaternion by a scalar and stores the result in the output parameter.
240
339
  * @param quat - The quaternion to multiply
@@ -245,15 +344,21 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
245
344
  static multiplyNumberTo(quat: IQuaternion, value: number, out: IMutableQuaternion): IMutableQuaternion;
246
345
  /**
247
346
  * Divides a quaternion by a scalar value.
347
+ * If the divisor is zero, all components are set to 0 and an error is logged
348
+ * instead of producing `Infinity`/`NaN`.
349
+ *
248
350
  * @param quat - The quaternion to divide
249
- * @param value - The scalar value to divide by (must not be zero)
351
+ * @param value - The scalar value to divide by
250
352
  * @returns A new quaternion with all components divided by the scalar
251
353
  */
252
- static divideNumber(quat: IQuaternion, value: number): Quaternion;
354
+ static divideNumber(quat: IQuaternion, value: number): Quaternion_<FloatTypedArrayConstructor>;
253
355
  /**
254
356
  * Divides a quaternion by a scalar and stores the result in the output parameter.
357
+ * If the divisor is zero, all components are set to 0 and an error is logged
358
+ * instead of producing `Infinity`/`NaN`.
359
+ *
255
360
  * @param quat - The quaternion to divide
256
- * @param value - The scalar value to divide by (must not be zero)
361
+ * @param value - The scalar value to divide by
257
362
  * @param out - The output quaternion to store the result
258
363
  * @returns The output quaternion containing the divided result
259
364
  */
@@ -308,7 +413,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
308
413
  * Private helper method for dividing a quaternion by a scalar value.
309
414
  * @param vec - The quaternion to divide
310
415
  * @param value - The scalar value to divide by
311
- * @returns A new quaternion with divided components, or Infinity components if division by zero
416
+ * @returns A new quaternion with divided components, or zero components if division by zero
312
417
  */
313
418
  private static _divide;
314
419
  /**
@@ -321,6 +426,8 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
321
426
  private static _divideTo;
322
427
  /**
323
428
  * Normalizes a quaternion to unit length.
429
+ * A zero-length quaternion is normalized to the identity quaternion (an error
430
+ * is logged) instead of becoming `Infinity`/`NaN`.
324
431
  * @param vec - The quaternion to normalize
325
432
  * @returns A new normalized quaternion
326
433
  */
@@ -339,7 +446,7 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
339
446
  * @param to - The target direction vector
340
447
  * @returns The normalized quaternion representing the rotation
341
448
  */
342
- fromToRotation(from: IVector3, to: IVector3): Quaternion;
449
+ fromToRotation(from: IVector3, to: IVector3): any;
343
450
  /**
344
451
  * Creates a quaternion representing the rotation from one vector to another (static version).
345
452
  * @param from - The starting direction vector
@@ -374,30 +481,30 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
374
481
  * @param v - The vector to transform
375
482
  * @returns A new transformed vector
376
483
  */
377
- transformVector3Inverse(v: IVector3): IVector3;
484
+ transformVector3Inverse(v: IVector3): any;
378
485
  /**
379
486
  * Creates a deep copy of this quaternion.
380
487
  * @returns A new quaternion with the same component values
381
488
  */
382
- clone(): Quaternion;
489
+ clone(): this;
383
490
  /**
384
- * Creates a quaternion from a Float32Array.
385
- * @param array - The Float32Array containing quaternion components
491
+ * Creates a quaternion that directly uses the given typed array (no copy).
492
+ * @param array - The typed array containing quaternion components
386
493
  * @returns A new quaternion using the provided array
387
494
  */
388
- static fromFloat32Array(array: Float32Array): Quaternion;
495
+ static fromTypedArray(array: TypedArray): Quaternion_<FloatTypedArrayConstructor>;
389
496
  /**
390
497
  * Creates a quaternion from a 4-element array.
391
498
  * @param array - The array containing [x, y, z, w] components
392
499
  * @returns A new quaternion with copied components
393
500
  */
394
- static fromCopyArray4(array: Array4<number>): Quaternion;
501
+ static fromCopyArray4(array: Array4<number>): Quaternion_<FloatTypedArrayConstructor>;
395
502
  /**
396
503
  * Creates a quaternion from a variable-length array (taking first 4 elements).
397
504
  * @param array - The array containing quaternion components
398
505
  * @returns A new quaternion with the first 4 components copied
399
506
  */
400
- static fromCopyArray(array: Array<number>): Quaternion;
507
+ static fromCopyArray(array: Array<number>): Quaternion_<FloatTypedArrayConstructor>;
401
508
  /**
402
509
  * Creates a quaternion from individual component values.
403
510
  * @param x - The x component
@@ -406,32 +513,32 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
406
513
  * @param w - The w component
407
514
  * @returns A new quaternion with the specified components
408
515
  */
409
- static fromCopy4(x: number, y: number, z: number, w: number): Quaternion;
516
+ static fromCopy4(x: number, y: number, z: number, w: number): Quaternion_<FloatTypedArrayConstructor>;
410
517
  /**
411
518
  * Creates a quaternion by copying from another quaternion.
412
519
  * @param quat - The quaternion to copy from
413
520
  * @returns A new quaternion with copied components
414
521
  */
415
- static fromCopyQuaternion(quat: IQuaternion): Quaternion;
522
+ static fromCopyQuaternion(quat: IQuaternion): Quaternion_<FloatTypedArrayConstructor>;
416
523
  /**
417
524
  * Creates a quaternion by copying from a 4D vector.
418
525
  * @param vec - The 4D vector to copy from
419
526
  * @returns A new quaternion with components copied from the vector
420
527
  */
421
- static fromCopyVector4(vec: IVector4): Quaternion;
528
+ static fromCopyVector4(vec: IVector4): Quaternion_<FloatTypedArrayConstructor>;
422
529
  /**
423
530
  * Creates a quaternion from a log quaternion representation.
424
531
  * @param x - The log quaternion to convert
425
532
  * @returns A new quaternion converted from log space
426
533
  */
427
- static fromCopyLogQuaternion(x: ILogQuaternion): Quaternion;
534
+ static fromCopyLogQuaternion(x: ILogQuaternion): Quaternion_<FloatTypedArrayConstructor>;
428
535
  /**
429
536
  * Creates a quaternion from an axis-angle representation.
430
537
  * @param axis - The rotation axis vector
431
538
  * @param rad - The rotation angle in radians
432
539
  * @returns A new quaternion representing the rotation
433
540
  */
434
- static fromAxisAngle(axis: IVector3, rad: number): Quaternion;
541
+ static fromAxisAngle(axis: IVector3, rad: number): Quaternion_<FloatTypedArrayConstructor>;
435
542
  /**
436
543
  * Creates a quaternion from an axis-angle representation and stores it in the output parameter.
437
544
  * @param axis - The rotation axis vector
@@ -455,3 +562,389 @@ export declare class Quaternion extends AbstractQuaternion implements IQuaternio
455
562
  */
456
563
  static clampRotation(quat: IQuaternion, thetaMax: number): IQuaternion;
457
564
  }
565
+ /**
566
+ * Immutable quaternion with 32-bit float components.
567
+ */
568
+ export declare class Quaternion extends Quaternion_<Float32ArrayConstructor> {
569
+ /**
570
+ * Creates a new Quaternion instance.
571
+ * @param v - The typed array containing the quaternion components
572
+ */
573
+ constructor(v: TypedArray);
574
+ /**
575
+ * identity
576
+ */
577
+ static identity(): Quaternion;
578
+ /**
579
+ * dummy
580
+ */
581
+ static dummy(): Quaternion;
582
+ /**
583
+ * invert
584
+ */
585
+ static invert(quat: IQuaternion): Quaternion;
586
+ /**
587
+ * invertTo
588
+ */
589
+ static invertTo(quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
590
+ /**
591
+ * qlerp
592
+ */
593
+ static qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): Quaternion;
594
+ /**
595
+ * qlerpTo
596
+ */
597
+ static qlerpTo(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number, out: IMutableQuaternion): IMutableQuaternion;
598
+ /**
599
+ * lerp
600
+ */
601
+ static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): Quaternion;
602
+ /**
603
+ * lerpTo
604
+ */
605
+ static lerpTo(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number, out: IMutableQuaternion): IMutableQuaternion;
606
+ /**
607
+ * tryAxisAngle
608
+ */
609
+ static tryAxisAngle(vec: IVector3, radian: number): Quaternion | null;
610
+ /**
611
+ * axisAngle
612
+ */
613
+ static axisAngle(vec: IVector3, radian: number): Quaternion;
614
+ /**
615
+ * tryFromMatrix
616
+ */
617
+ static tryFromMatrix(mat: IMatrix44): Quaternion | null;
618
+ /**
619
+ * fromMatrix
620
+ */
621
+ static fromMatrix(mat: IMatrix44): Quaternion;
622
+ /**
623
+ * tryFromMatrixTo
624
+ */
625
+ static tryFromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): boolean;
626
+ /**
627
+ * fromMatrixTo
628
+ */
629
+ static fromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): IMutableQuaternion;
630
+ /**
631
+ * lookFromTo
632
+ */
633
+ static lookFromTo(fromDirection: IVector3, toDirection: IVector3): IMutableQuaternion;
634
+ /**
635
+ * tryLookForward
636
+ */
637
+ static tryLookForward(forward: IVector3): Quaternion | null;
638
+ /**
639
+ * lookForward
640
+ */
641
+ static lookForward(forward: IVector3): Quaternion;
642
+ /**
643
+ * tryLookForwardAccordingToThisUp
644
+ */
645
+ static tryLookForwardAccordingToThisUp(forward: IVector3, up: IVector3): Quaternion | null;
646
+ /**
647
+ * lookForwardAccordingToThisUp
648
+ */
649
+ static lookForwardAccordingToThisUp(forward: IVector3, up: IVector3): Quaternion;
650
+ /**
651
+ * fromPosition
652
+ */
653
+ static fromPosition(vec: IVector3): Quaternion;
654
+ /**
655
+ * add
656
+ */
657
+ static add(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
658
+ /**
659
+ * addTo
660
+ */
661
+ static addTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
662
+ /**
663
+ * subtract
664
+ */
665
+ static subtract(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
666
+ /**
667
+ * subtractTo
668
+ */
669
+ static subtractTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
670
+ /**
671
+ * multiply
672
+ */
673
+ static multiply(l_quat: IQuaternion, r_quat: IQuaternion): Quaternion;
674
+ /**
675
+ * multiplyTo
676
+ */
677
+ static multiplyTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
678
+ /**
679
+ * multiplyNumber
680
+ */
681
+ static multiplyNumber(quat: IQuaternion, value: number): Quaternion;
682
+ /**
683
+ * multiplyNumberTo
684
+ */
685
+ static multiplyNumberTo(quat: IQuaternion, value: number, out: IMutableQuaternion): IMutableQuaternion;
686
+ /**
687
+ * divideNumber
688
+ */
689
+ static divideNumber(quat: IQuaternion, value: number): Quaternion;
690
+ /**
691
+ * divideNumberTo
692
+ */
693
+ static divideNumberTo(quat: IQuaternion, value: number, out: IMutableQuaternion): IMutableQuaternion;
694
+ /**
695
+ * normalize
696
+ */
697
+ static normalize(vec: IQuaternion): Quaternion;
698
+ /**
699
+ * normalizeTo
700
+ */
701
+ static normalizeTo(vec: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
702
+ /**
703
+ * fromToRotation
704
+ */
705
+ static fromToRotation(from: IVector3, to: IVector3): Quaternion;
706
+ /**
707
+ * fromToRotationTo
708
+ */
709
+ static fromToRotationTo(from: IVector3, to: IVector3, out: IMutableQuaternion): IMutableQuaternion;
710
+ /**
711
+ * Creates a quaternion that directly uses the given Float32Array (no copy).
712
+ */
713
+ static fromFloat32Array(array: Float32Array): Quaternion;
714
+ /**
715
+ * fromCopyArray4
716
+ */
717
+ static fromCopyArray4(array: Array4<number>): Quaternion;
718
+ /**
719
+ * fromCopyArray
720
+ */
721
+ static fromCopyArray(array: Array<number>): Quaternion;
722
+ /**
723
+ * fromCopy4
724
+ */
725
+ static fromCopy4(x: number, y: number, z: number, w: number): Quaternion;
726
+ /**
727
+ * fromCopyQuaternion
728
+ */
729
+ static fromCopyQuaternion(quat: IQuaternion): Quaternion;
730
+ /**
731
+ * fromCopyVector4
732
+ */
733
+ static fromCopyVector4(vec: IVector4): Quaternion;
734
+ /**
735
+ * fromCopyLogQuaternion
736
+ */
737
+ static fromCopyLogQuaternion(x: ILogQuaternion): Quaternion;
738
+ /**
739
+ * fromAxisAngle
740
+ */
741
+ static fromAxisAngle(axis: IVector3, rad: number): Quaternion;
742
+ /**
743
+ * fromAxisAngleTo
744
+ */
745
+ static fromAxisAngleTo(axis: IVector3, rad: number, out: IMutableQuaternion): IMutableQuaternion;
746
+ /**
747
+ * getQuaternionAngle
748
+ */
749
+ static getQuaternionAngle(q: IQuaternion): number;
750
+ /**
751
+ * clampRotation
752
+ */
753
+ static clampRotation(quat: IQuaternion, thetaMax: number): IQuaternion;
754
+ }
755
+ /**
756
+ * Immutable quaternion with 64-bit float components.
757
+ */
758
+ export declare class QuaternionD extends Quaternion_<Float64ArrayConstructor> {
759
+ /** The typed array constructor used for newly created quaternions. */
760
+ protected static readonly _type: FloatTypedArrayConstructor;
761
+ /**
762
+ * Creates a new QuaternionD instance.
763
+ * @param v - The typed array containing the quaternion components
764
+ */
765
+ constructor(v: TypedArray);
766
+ /**
767
+ * identity
768
+ */
769
+ static identity(): QuaternionD;
770
+ /**
771
+ * dummy
772
+ */
773
+ static dummy(): QuaternionD;
774
+ /**
775
+ * invert
776
+ */
777
+ static invert(quat: IQuaternion): QuaternionD;
778
+ /**
779
+ * invertTo
780
+ */
781
+ static invertTo(quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
782
+ /**
783
+ * qlerp
784
+ */
785
+ static qlerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): QuaternionD;
786
+ /**
787
+ * qlerpTo
788
+ */
789
+ static qlerpTo(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number, out: IMutableQuaternion): IMutableQuaternion;
790
+ /**
791
+ * lerp
792
+ */
793
+ static lerp(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number): QuaternionD;
794
+ /**
795
+ * lerpTo
796
+ */
797
+ static lerpTo(l_quat: IQuaternion, r_quat: IQuaternion, ratio: number, out: IMutableQuaternion): IMutableQuaternion;
798
+ /**
799
+ * tryAxisAngle
800
+ */
801
+ static tryAxisAngle(vec: IVector3, radian: number): QuaternionD | null;
802
+ /**
803
+ * axisAngle
804
+ */
805
+ static axisAngle(vec: IVector3, radian: number): QuaternionD;
806
+ /**
807
+ * tryFromMatrix
808
+ */
809
+ static tryFromMatrix(mat: IMatrix44): QuaternionD | null;
810
+ /**
811
+ * fromMatrix
812
+ */
813
+ static fromMatrix(mat: IMatrix44): QuaternionD;
814
+ /**
815
+ * tryFromMatrixTo
816
+ */
817
+ static tryFromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): boolean;
818
+ /**
819
+ * fromMatrixTo
820
+ */
821
+ static fromMatrixTo(mat: IMatrix44, out: IMutableQuaternion): IMutableQuaternion;
822
+ /**
823
+ * lookFromTo
824
+ */
825
+ static lookFromTo(fromDirection: IVector3, toDirection: IVector3): IMutableQuaternion;
826
+ /**
827
+ * tryLookForward
828
+ */
829
+ static tryLookForward(forward: IVector3): QuaternionD | null;
830
+ /**
831
+ * lookForward
832
+ */
833
+ static lookForward(forward: IVector3): QuaternionD;
834
+ /**
835
+ * tryLookForwardAccordingToThisUp
836
+ */
837
+ static tryLookForwardAccordingToThisUp(forward: IVector3, up: IVector3): QuaternionD | null;
838
+ /**
839
+ * lookForwardAccordingToThisUp
840
+ */
841
+ static lookForwardAccordingToThisUp(forward: IVector3, up: IVector3): QuaternionD;
842
+ /**
843
+ * fromPosition
844
+ */
845
+ static fromPosition(vec: IVector3): QuaternionD;
846
+ /**
847
+ * add
848
+ */
849
+ static add(l_quat: IQuaternion, r_quat: IQuaternion): QuaternionD;
850
+ /**
851
+ * addTo
852
+ */
853
+ static addTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
854
+ /**
855
+ * subtract
856
+ */
857
+ static subtract(l_quat: IQuaternion, r_quat: IQuaternion): QuaternionD;
858
+ /**
859
+ * subtractTo
860
+ */
861
+ static subtractTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
862
+ /**
863
+ * multiply
864
+ */
865
+ static multiply(l_quat: IQuaternion, r_quat: IQuaternion): QuaternionD;
866
+ /**
867
+ * multiplyTo
868
+ */
869
+ static multiplyTo(l_quat: IQuaternion, r_quat: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
870
+ /**
871
+ * multiplyNumber
872
+ */
873
+ static multiplyNumber(quat: IQuaternion, value: number): QuaternionD;
874
+ /**
875
+ * multiplyNumberTo
876
+ */
877
+ static multiplyNumberTo(quat: IQuaternion, value: number, out: IMutableQuaternion): IMutableQuaternion;
878
+ /**
879
+ * divideNumber
880
+ */
881
+ static divideNumber(quat: IQuaternion, value: number): QuaternionD;
882
+ /**
883
+ * divideNumberTo
884
+ */
885
+ static divideNumberTo(quat: IQuaternion, value: number, out: IMutableQuaternion): IMutableQuaternion;
886
+ /**
887
+ * normalize
888
+ */
889
+ static normalize(vec: IQuaternion): QuaternionD;
890
+ /**
891
+ * normalizeTo
892
+ */
893
+ static normalizeTo(vec: IQuaternion, out: IMutableQuaternion): IMutableQuaternion;
894
+ /**
895
+ * fromToRotation
896
+ */
897
+ static fromToRotation(from: IVector3, to: IVector3): QuaternionD;
898
+ /**
899
+ * fromToRotationTo
900
+ */
901
+ static fromToRotationTo(from: IVector3, to: IVector3, out: IMutableQuaternion): IMutableQuaternion;
902
+ /**
903
+ * Creates a quaternion that directly uses the given Float64Array (no copy).
904
+ */
905
+ static fromFloat64Array(array: Float64Array): QuaternionD;
906
+ /**
907
+ * fromCopyArray4
908
+ */
909
+ static fromCopyArray4(array: Array4<number>): QuaternionD;
910
+ /**
911
+ * fromCopyArray
912
+ */
913
+ static fromCopyArray(array: Array<number>): QuaternionD;
914
+ /**
915
+ * fromCopy4
916
+ */
917
+ static fromCopy4(x: number, y: number, z: number, w: number): QuaternionD;
918
+ /**
919
+ * fromCopyQuaternion
920
+ */
921
+ static fromCopyQuaternion(quat: IQuaternion): QuaternionD;
922
+ /**
923
+ * fromCopyVector4
924
+ */
925
+ static fromCopyVector4(vec: IVector4): QuaternionD;
926
+ /**
927
+ * fromCopyLogQuaternion
928
+ */
929
+ static fromCopyLogQuaternion(x: ILogQuaternion): QuaternionD;
930
+ /**
931
+ * fromAxisAngle
932
+ */
933
+ static fromAxisAngle(axis: IVector3, rad: number): QuaternionD;
934
+ /**
935
+ * fromAxisAngleTo
936
+ */
937
+ static fromAxisAngleTo(axis: IVector3, rad: number, out: IMutableQuaternion): IMutableQuaternion;
938
+ /**
939
+ * getQuaternionAngle
940
+ */
941
+ static getQuaternionAngle(q: IQuaternion): number;
942
+ /**
943
+ * clampRotation
944
+ */
945
+ static clampRotation(quat: IQuaternion, thetaMax: number): IQuaternion;
946
+ }
947
+ /**
948
+ * Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
949
+ */
950
+ export { Quaternion as QuaternionF };