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
@@ -20,8 +20,10 @@ import { Vector3 } from './Vector3';
20
20
  export declare class AnimatedVector3 extends Vector3 implements IVector3, IAnimatedValue {
21
21
  private __animationSamplers;
22
22
  private __firstActiveAnimationTrackName;
23
+ private __firstActiveAnimationSamplerTrackName;
23
24
  private __firstActiveAnimationSampler;
24
25
  private __secondActiveAnimationTrackName?;
26
+ private __secondActiveAnimationSamplerTrackName?;
25
27
  private __secondActiveAnimationSampler?;
26
28
  private __blendingRatio;
27
29
  private __time?;
@@ -128,12 +130,14 @@ export declare class AnimatedVector3 extends Vector3 implements IVector3, IAnima
128
130
  * @returns The name of the first active animation track
129
131
  */
130
132
  getFirstActiveAnimationTrackName(): string;
133
+ getFirstActiveAnimationSamplerTrackName(): string;
131
134
  /**
132
135
  * Gets the name of the second (secondary) active animation track.
133
136
  *
134
137
  * @returns The name of the second active animation track, or undefined if not set
135
138
  */
136
139
  getSecondActiveAnimationTrackName(): string | undefined;
140
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
137
141
  /**
138
142
  * Gets the minimum start time from the input data of the specified animation track.
139
143
  *
@@ -18,8 +18,10 @@ import { Vector4 } from './Vector4';
18
18
  export declare class AnimatedVector4 extends Vector4 implements IVector4, IAnimatedValue {
19
19
  private __animationSamplers;
20
20
  private __firstActiveAnimationTrackName;
21
+ private __firstActiveAnimationSamplerTrackName;
21
22
  private __firstActiveAnimationSampler;
22
23
  private __secondActiveAnimationTrackName?;
24
+ private __secondActiveAnimationSamplerTrackName?;
23
25
  private __secondActiveAnimationSampler?;
24
26
  private __blendingRatio;
25
27
  private __time?;
@@ -120,12 +122,14 @@ export declare class AnimatedVector4 extends Vector4 implements IVector4, IAnima
120
122
  * @returns The name of the first active animation track
121
123
  */
122
124
  getFirstActiveAnimationTrackName(): string;
125
+ getFirstActiveAnimationSamplerTrackName(): string;
123
126
  /**
124
127
  * Gets the name of the second (secondary) active animation track.
125
128
  *
126
129
  * @returns The name of the second active animation track, or undefined if not set
127
130
  */
128
131
  getSecondActiveAnimationTrackName(): string | undefined;
132
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
129
133
  /**
130
134
  * Gets the minimum start time of the specified animation track.
131
135
  *
@@ -9,8 +9,10 @@ import { VectorN } from './VectorN';
9
9
  export declare class AnimatedVectorN extends VectorN implements IAnimatedValue {
10
10
  private __animationSamplers;
11
11
  private __firstActiveAnimationTrackName;
12
+ private __firstActiveAnimationSamplerTrackName;
12
13
  private __firstActiveAnimationSampler;
13
14
  private __secondActiveAnimationTrackName?;
15
+ private __secondActiveAnimationSamplerTrackName?;
14
16
  private __secondActiveAnimationSampler?;
15
17
  private __blendingRatio;
16
18
  private __time?;
@@ -72,11 +74,13 @@ export declare class AnimatedVectorN extends VectorN implements IAnimatedValue {
72
74
  * @returns The name of the first active animation track
73
75
  */
74
76
  getFirstActiveAnimationTrackName(): string;
77
+ getFirstActiveAnimationSamplerTrackName(): string;
75
78
  /**
76
79
  * Gets the name of the second active animation track.
77
80
  * @returns The name of the second active animation track, or undefined if not set
78
81
  */
79
82
  getSecondActiveAnimationTrackName(): string | undefined;
83
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
80
84
  /**
81
85
  * Gets the minimum start time for a specific animation track.
82
86
  * @param trackName - The name of the animation track
@@ -19,11 +19,23 @@ export interface IAnimatedValue {
19
19
  * @returns The name of the first active animation track
20
20
  */
21
21
  getFirstActiveAnimationTrackName(): AnimationTrackName;
22
+ /**
23
+ * Gets the track name of the sampler that is actually bound as the first animation.
24
+ * This can differ from the requested active track when that track has no sampler.
25
+ * @returns The track name of the currently evaluated first sampler
26
+ */
27
+ getFirstActiveAnimationSamplerTrackName(): AnimationTrackName;
22
28
  /**
23
29
  * Gets the currently active second animation track name.
24
30
  * @returns The name of the second active animation track, or undefined if not set
25
31
  */
26
32
  getSecondActiveAnimationTrackName(): AnimationTrackName | undefined;
33
+ /**
34
+ * Gets the track name of the sampler that is actually bound as the second animation.
35
+ * This can differ from the requested active track when that track has no sampler.
36
+ * @returns The track name of the currently evaluated second sampler, or undefined if none is bound
37
+ */
38
+ getSecondActiveAnimationSamplerTrackName(): AnimationTrackName | undefined;
27
39
  /**
28
40
  * Gets the minimum start input time for a specified animation track.
29
41
  * @param trackName - The name of the animation track
@@ -6,8 +6,8 @@ import type { IMutableVector2, IMutableVector3, IMutableVector4, IVector, IVecto
6
6
  * Provides read-only access to matrix data and basic mathematical operations.
7
7
  */
8
8
  export interface IMatrix {
9
- /** Internal typed array storing matrix data in column-major order */
10
- _v: Float32Array;
9
+ /** Internal typed array storing matrix data in column-major order (Float32Array or Float64Array) */
10
+ _v: TypedArray;
11
11
  /** Returns the class name of the matrix implementation */
12
12
  readonly className: string;
13
13
  /**
@@ -10,8 +10,8 @@ import type { Vector3 } from './Vector3';
10
10
  export interface IQuaternion {
11
11
  /** The class name identifier */
12
12
  readonly className: string;
13
- /** Internal Float32Array storage for quaternion components */
14
- _v: Float32Array;
13
+ /** Internal typed array storage for quaternion components (Float32Array or Float64Array) */
14
+ _v: TypedArray;
15
15
  /** The x component (i quaternion basis) */
16
16
  readonly x: number;
17
17
  /** The y component (j quaternion basis) */
@@ -287,8 +287,8 @@ export interface IMutableQuaternion extends IQuaternion {
287
287
  export interface ILogQuaternion {
288
288
  /** The class name identifier */
289
289
  readonly className: string;
290
- /** Internal Float32Array storage for logarithmic quaternion components */
291
- readonly _v: Float32Array;
290
+ /** Internal typed array storage for logarithmic quaternion components (Float32Array or Float64Array) */
291
+ readonly _v: TypedArray;
292
292
  /** The x component of the logarithmic quaternion */
293
293
  readonly x: number;
294
294
  /** The y component of the logarithmic quaternion */
@@ -1,19 +1,26 @@
1
- import type { Array3 } from '../../types/CommonTypes';
1
+ import type { Array3, FloatTypedArrayConstructor, TypedArray } from '../../types/CommonTypes';
2
2
  import type { ILogQuaternion, IQuaternion } from './IQuaternion';
3
3
  import type { IVector3 } from './IVector';
4
- import { Quaternion } from './Quaternion';
5
4
  /**
6
- * Represents a logarithm of a quaternion, which provides a more compact representation
7
- * for quaternion interpolation and mathematical operations. A log quaternion stores
8
- * only the x, y, z components as the w component is implicitly 1.
5
+ * Generic base class for logarithms of quaternions.
6
+ *
7
+ * A log quaternion provides a more compact representation for quaternion
8
+ * interpolation and mathematical operations. It stores only the x, y, z
9
+ * components, as the w component is implicitly 1.
10
+ *
11
+ * @template T - The typed array constructor (Float32Array or Float64Array)
12
+ * @internal
9
13
  */
10
- export declare class LogQuaternion implements ILogQuaternion {
11
- _v: Float32Array;
14
+ export declare class LogQuaternion_<T extends FloatTypedArrayConstructor> implements ILogQuaternion {
15
+ _v: TypedArray;
12
16
  /**
13
- * Creates a new LogQuaternion instance.
14
- * @param x - Float32Array containing the x, y, z components
17
+ * Creates a new LogQuaternion_ instance.
18
+ * @param v - Typed array containing the x, y, z components
19
+ * @param _options - Configuration object containing the typed array constructor
15
20
  */
16
- constructor(x: Float32Array);
21
+ constructor(v: TypedArray, _options: {
22
+ type: T;
23
+ });
17
24
  /**
18
25
  * Gets the x component of the log quaternion.
19
26
  * @returns The x component value
@@ -35,53 +42,118 @@ export declare class LogQuaternion implements ILogQuaternion {
35
42
  */
36
43
  get w(): number;
37
44
  /**
38
- * Creates a LogQuaternion from an existing Float32Array.
39
- * @param array - Float32Array containing the x, y, z components
40
- * @returns A new LogQuaternion instance
45
+ * Gets the class name identifier.
46
+ * @returns The string 'LogQuaternion'
41
47
  */
42
- static fromFloat32Array(array: Float32Array): LogQuaternion;
48
+ get className(): string;
43
49
  /**
44
- * Creates a LogQuaternion from a 3-element array by copying the values.
50
+ * Creates a log quaternion that directly uses the given typed array (no copy).
51
+ * @param array - Typed array containing the x, y, z components
52
+ * @param type - The typed array constructor to use
53
+ * @returns A new log quaternion
54
+ */
55
+ static _fromTypedArray(array: TypedArray, type: FloatTypedArrayConstructor): ILogQuaternion;
56
+ /**
57
+ * Creates a log quaternion from a 3-element array by copying the values.
45
58
  * @param array - Array of 3 numbers representing x, y, z components
46
- * @returns A new Quaternion instance (note: this should return LogQuaternion)
59
+ * @param type - The typed array constructor to use
60
+ * @returns A new log quaternion
47
61
  */
48
- static fromCopyArray3(array: Array3<number>): Quaternion;
62
+ static _fromCopyArray3(array: Array3<number>, type: FloatTypedArrayConstructor): ILogQuaternion;
49
63
  /**
50
- * Creates a LogQuaternion from an array by copying the first 3 values.
64
+ * Creates a log quaternion from an array by copying the first 3 values.
51
65
  * @param array - Array of numbers (only first 3 elements are used)
52
- * @returns A new Quaternion instance (note: this should return LogQuaternion)
66
+ * @param type - The typed array constructor to use
67
+ * @returns A new log quaternion
53
68
  */
54
- static fromCopyArray(array: Array<number>): Quaternion;
69
+ static _fromCopyArray(array: Array<number>, type: FloatTypedArrayConstructor): ILogQuaternion;
55
70
  /**
56
- * Creates a LogQuaternion from individual x, y, z component values.
71
+ * Creates a log quaternion from individual x, y, z component values.
57
72
  * @param x - The x component
58
73
  * @param y - The y component
59
74
  * @param z - The z component
60
- * @returns A new Quaternion instance (note: this should return LogQuaternion)
75
+ * @param type - The typed array constructor to use
76
+ * @returns A new log quaternion
61
77
  */
62
- static fromCopy3(x: number, y: number, z: number): Quaternion;
78
+ static _fromCopy3(x: number, y: number, z: number, type: FloatTypedArrayConstructor): ILogQuaternion;
63
79
  /**
64
- * Creates a LogQuaternion by copying from another LogQuaternion.
65
- * @param quat - The source LogQuaternion to copy from
66
- * @returns A new Quaternion instance (note: this should return LogQuaternion)
80
+ * Creates a log quaternion from a 3D vector by copying its components.
81
+ * @param vec - The source vector to copy from
82
+ * @param type - The typed array constructor to use
83
+ * @returns A new log quaternion
67
84
  */
68
- static fromCopyLogQuaternion(quat: ILogQuaternion): Quaternion;
85
+ static _fromCopyVector3(vec: IVector3, type: FloatTypedArrayConstructor): ILogQuaternion;
69
86
  /**
70
- * Creates a LogQuaternion from a 3D vector by copying its components.
71
- * @param vec - The source IVector3 to copy from
72
- * @returns A new Quaternion instance (note: this should return LogQuaternion)
87
+ * Creates a log quaternion by copying from another log quaternion.
88
+ * @param quat - The source log quaternion to copy from
89
+ * @param type - The typed array constructor to use
90
+ * @returns A new log quaternion
73
91
  */
74
- static fromCopyVector4(vec: IVector3): Quaternion;
92
+ static _fromCopyLogQuaternion(quat: ILogQuaternion, type: FloatTypedArrayConstructor): ILogQuaternion;
75
93
  /**
76
94
  * Converts a regular quaternion to its logarithmic form.
77
- * Uses the formula: log(q) = (θ/sin(θ)) * (x, y, z) where θ = acos(w)
78
- * @param x - The source quaternion to convert
79
- * @returns A new LogQuaternion representing the logarithm of the input quaternion
95
+ *
96
+ * Uses the formula `log(q) = (θ / sin(θ)) * (x, y, z)` where `θ = acos(w)`.
97
+ * When θ is 0 (identity rotation) the result is a zero log quaternion. When
98
+ * θ is close to π the logarithm is not representable and a zero log
99
+ * quaternion is returned instead of `Infinity`/`NaN`.
100
+ *
101
+ * @param quat - The source quaternion to convert
102
+ * @param type - The typed array constructor to use
103
+ * @returns A new log quaternion representing the logarithm of the input quaternion
80
104
  */
81
- static fromCopyQuaternion(x: IQuaternion): LogQuaternion;
105
+ static _fromCopyQuaternion(quat: IQuaternion, type: FloatTypedArrayConstructor): ILogQuaternion;
106
+ }
107
+ /**
108
+ * Logarithm of a quaternion with 32-bit float components.
109
+ */
110
+ export declare class LogQuaternion extends LogQuaternion_<Float32ArrayConstructor> {
82
111
  /**
83
- * Gets the class name identifier.
84
- * @returns The string 'LogQuaternion'
112
+ * Creates a new LogQuaternion instance.
113
+ * @param v - The typed array containing the x, y, z components
85
114
  */
86
- get className(): string;
115
+ constructor(v: TypedArray);
116
+ /** Creates a log quaternion that directly uses the given Float32Array (no copy). */
117
+ static fromFloat32Array(array: Float32Array): LogQuaternion;
118
+ /** Creates a log quaternion from a 3-element array by copying the values. */
119
+ static fromCopyArray3(array: Array3<number>): LogQuaternion;
120
+ /** Creates a log quaternion from an array by copying the first 3 values. */
121
+ static fromCopyArray(array: Array<number>): LogQuaternion;
122
+ /** Creates a log quaternion from individual x, y, z component values. */
123
+ static fromCopy3(x: number, y: number, z: number): LogQuaternion;
124
+ /** Creates a log quaternion from a 3D vector by copying its components. */
125
+ static fromCopyVector3(vec: IVector3): LogQuaternion;
126
+ /** Creates a log quaternion by copying from another log quaternion. */
127
+ static fromCopyLogQuaternion(quat: ILogQuaternion): LogQuaternion;
128
+ /** Converts a regular quaternion to its logarithmic form. */
129
+ static fromCopyQuaternion(quat: IQuaternion): LogQuaternion;
87
130
  }
131
+ /**
132
+ * Logarithm of a quaternion with 64-bit float components.
133
+ * Use this implementation when higher numerical precision is required.
134
+ */
135
+ export declare class LogQuaternionD extends LogQuaternion_<Float64ArrayConstructor> {
136
+ /**
137
+ * Creates a new LogQuaternionD instance.
138
+ * @param v - The typed array containing the x, y, z components
139
+ */
140
+ constructor(v: TypedArray);
141
+ /** Creates a log quaternion that directly uses the given Float64Array (no copy). */
142
+ static fromFloat64Array(array: Float64Array): LogQuaternionD;
143
+ /** Creates a log quaternion from a 3-element array by copying the values. */
144
+ static fromCopyArray3(array: Array3<number>): LogQuaternionD;
145
+ /** Creates a log quaternion from an array by copying the first 3 values. */
146
+ static fromCopyArray(array: Array<number>): LogQuaternionD;
147
+ /** Creates a log quaternion from individual x, y, z component values. */
148
+ static fromCopy3(x: number, y: number, z: number): LogQuaternionD;
149
+ /** Creates a log quaternion from a 3D vector by copying its components. */
150
+ static fromCopyVector3(vec: IVector3): LogQuaternionD;
151
+ /** Creates a log quaternion by copying from another log quaternion. */
152
+ static fromCopyLogQuaternion(quat: ILogQuaternion): LogQuaternionD;
153
+ /** Converts a regular quaternion to its logarithmic form. */
154
+ static fromCopyQuaternion(quat: IQuaternion): LogQuaternionD;
155
+ }
156
+ /**
157
+ * Alias for the 32-bit (Float32Array) implementation, making the precision explicit.
158
+ */
159
+ export { LogQuaternion as LogQuaternionF };
@@ -13,6 +13,37 @@ declare function radianToDegree(rad: number): number;
13
13
  * @returns The angle in radians
14
14
  */
15
15
  declare function degreeToRadian(deg: number): number;
16
+ /**
17
+ * Encode a quaternion (x, y, z, w) into a 64-bit log-quaternion.
18
+ * Returns [lo, hi] as unsigned 32-bit integers.
19
+ */
20
+ export declare function encodeLogQuat(qx: number, qy: number, qz: number, qw: number): number[];
21
+ /**
22
+ * Checks whether a determinant should be treated as zero.
23
+ *
24
+ * A plain `det === 0` test only catches exactly singular matrices. In practice
25
+ * a matrix whose determinant is tiny compared with its scale is just as
26
+ * dangerous, because its inverse amplifies rounding errors into garbage.
27
+ *
28
+ * @param det - The determinant of the matrix
29
+ * @param scale - The product of the row norms of the matrix (Hadamard bound)
30
+ * @param epsilon - The relative tolerance (defaults to the Float32 threshold)
31
+ * @returns True if the matrix should be considered singular
32
+ */
33
+ declare function isSingularDet(det: number, scale: number, epsilon?: number): boolean;
34
+ /**
35
+ * Returns the relative singularity tolerance for a typed array element size.
36
+ * @param bytesPerElement - 4 for Float32Array, 8 for Float64Array
37
+ * @returns The relative tolerance to use
38
+ */
39
+ declare function getSingularEpsilon(bytesPerElement: number): number;
40
+ /**
41
+ * Converts a 32-bit floating point number to a 16-bit half-precision float.
42
+ * This implementation is based on the OpenEXR half-precision format with additional rounding.
43
+ * Implementation reference: https://gamedev.stackexchange.com/questions/17326/conversion-of-a-number-from-single-precision-floating-point-representation-to-a/17410#17410
44
+ * @returns A function that converts a number to half-precision float representation
45
+ */
46
+ declare const toHalfFloat: () => ((val: number) => number);
16
47
  /**
17
48
  * Checks whether a number is a power of two.
18
49
  * @param x - The number to check
@@ -37,6 +68,29 @@ declare function isPowerOfTwoTexture(width: Size, height: Size): boolean;
37
68
  * @returns A 2-element array containing the packed values
38
69
  */
39
70
  declare function packNormalizedVec4ToVec2(x: number, y: number, z: number, w: number, criteria: number): number[];
71
+ declare function packSnormVec4ToUVec2(x: number, y: number, z: number, w: number): number[];
72
+ /**
73
+ * Checks whether the given three scale components are (almost) uniform.
74
+ * The signs are ignored (only the magnitudes are compared).
75
+ *
76
+ * @param x - The x component of the scale
77
+ * @param y - The y component of the scale
78
+ * @param z - The z component of the scale
79
+ * @returns True if the scale is uniform
80
+ */
81
+ declare function isUniformScale(x: number, y: number, z: number): boolean;
82
+ /**
83
+ * Encodes the magnitude of a uniform scale for the Vec4x1 bone data type.
84
+ *
85
+ * The scale is stored as log2(scale) / 16 in a snorm16 value, and shaders decode it with exp2(value * 16).
86
+ * The relative error is therefore constant (at most about 1.7e-4) over 2^-16 .. 2^16, and 1.0 is exact.
87
+ * Scales out of the range are clamped by the snorm packing: a zero scale (often used to hide a part of a mesh)
88
+ * becomes 2^-16, which keeps the mesh invisible while keeping the skinning matrix invertible for normals.
89
+ *
90
+ * @param scale - The magnitude of the uniform scale (>= 0)
91
+ * @returns The value to be packed as snorm16 (it may be out of [-1, 1]; the packing clamps it)
92
+ */
93
+ declare function encodeVec4x1Scale(scale: number): number;
40
94
  /**
41
95
  * Calculates the cumulative distribution function (CDF) for a Gaussian distribution.
42
96
  * @param x - The value at which to evaluate the CDF
@@ -131,10 +185,18 @@ declare function computeGaussianDistributionRatioWhoseSumIsOne({ kernelSize, var
131
185
  export declare const MathUtil: Readonly<{
132
186
  radianToDegree: typeof radianToDegree;
133
187
  degreeToRadian: typeof degreeToRadian;
134
- toHalfFloat: () => ((val: number) => number);
188
+ encodeLogQuat: typeof encodeLogQuat;
189
+ isSingularDet: typeof isSingularDet;
190
+ getSingularEpsilon: typeof getSingularEpsilon;
191
+ SINGULAR_EPSILON: 0.000001;
192
+ SINGULAR_EPSILON_FLOAT64: 1e-12;
193
+ toHalfFloat: typeof toHalfFloat;
135
194
  isPowerOfTwo: typeof isPowerOfTwo;
136
195
  isPowerOfTwoTexture: typeof isPowerOfTwoTexture;
137
196
  packNormalizedVec4ToVec2: typeof packNormalizedVec4ToVec2;
197
+ packSnormVec4ToUVec2: typeof packSnormVec4ToUVec2;
198
+ isUniformScale: typeof isUniformScale;
199
+ encodeVec4x1Scale: typeof encodeVec4x1Scale;
138
200
  convertToStringAsGLSLFloat: typeof convertToStringAsGLSLFloat;
139
201
  nearZeroToZero: typeof nearZeroToZero;
140
202
  gaussianCdf: typeof gaussianCdf;