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
@@ -0,0 +1,31 @@
1
+ import type { RnM2, RnM2Skin } from '../../types/RnM2';
2
+ import { type BoneDataTypeEnum } from '../definitions/BoneDataType';
3
+ /**
4
+ * Checks whether the given three scale components are (almost) uniform.
5
+ * The same criterion is used by SkeletalComponent at runtime (see MathUtil.isUniformScale).
6
+ *
7
+ * @param x - The x component of the scale
8
+ * @param y - The y component of the scale
9
+ * @param z - The z component of the scale
10
+ * @returns True if the scale is uniform
11
+ */
12
+ export declare function isUniformScale(x: number, y: number, z: number): boolean;
13
+ /**
14
+ * Chooses the bone data type for a skin of a glTF model.
15
+ *
16
+ * The skinning result depends on the transforms of the joints, the skinned node and their ancestors,
17
+ * and on the inverse bind matrices. If all of their scales (static values and animations) are uniform,
18
+ * or no scale is specified, Vec4x1 (the most compact format, which supports only uniform scale) is chosen.
19
+ * Otherwise Vec4x2 (which supports non-uniform scale) is chosen.
20
+ * If a non-uniform scale still appears at runtime (e.g. an animation assigned later), SkeletalComponent
21
+ * switches the automatically selected Vec4x1 to Vec4x2.
22
+ *
23
+ * Note: _setupAnimation must have been called before this function so that animation output data is available.
24
+ *
25
+ * @param gltfModel - The glTF model
26
+ * @param skin - The skin to check
27
+ * @param skinnedNodeIndex - The index of the node which has the skin
28
+ * @param inverseBindMatrices - The inverse bind matrices of the skin (column-major, 16 elements per joint)
29
+ * @returns Vec4x1 if all scales are uniform, otherwise Vec4x2
30
+ */
31
+ export declare function detectBoneDataTypeForSkin(gltfModel: RnM2, skin: RnM2Skin, skinnedNodeIndex: number, inverseBindMatrices?: ArrayLike<number>): BoneDataTypeEnum;
@@ -113,6 +113,12 @@ export declare class Gltf2Importer {
113
113
  * @internal
114
114
  */
115
115
  static _loadInner(gltfJson: RnM2, files: GltfFileBuffers, options: GltfLoadOption, uint8arrayOfGlb?: Uint8Array, basePath?: string, callback?: RnPromiseCallback): RnPromise<any[]>;
116
+ /**
117
+ * Normalizes optional glTF collection properties for the internal RnM2
118
+ * processing pipeline. A valid glTF document may omit every collection that
119
+ * it does not use, including buffers for collision-only scenes.
120
+ */
121
+ static _normalizeOptionalArrays(gltfJson: RnM2): void;
116
122
  /**
117
123
  * Processes the glTF JSON content by resolving all internal dependencies.
118
124
  * Sets up object references between scenes, nodes, meshes, materials, textures, etc.
@@ -0,0 +1,58 @@
1
+ import type { KHRImplicitBoxSize, KHRPhysicsMotion, RnM2 } from '../../types';
2
+ import { type ShapeDescriptor } from '../geometry/Shape';
3
+ import type { ISceneGraphEntity } from '../helpers/EntityHelper';
4
+ import { Quaternion } from '../math/Quaternion';
5
+ import { Vector3 } from '../math/Vector3';
6
+ export interface NormalizedKhrBoxCollider {
7
+ nodeIndex: number;
8
+ shapeIndex: number;
9
+ size: KHRImplicitBoxSize;
10
+ dynamicFriction: number;
11
+ restitution: number;
12
+ }
13
+ export interface KhrBoxColliderCollection {
14
+ colliders: NormalizedKhrBoxCollider[];
15
+ warnings: string[];
16
+ }
17
+ export interface NormalizedKhrCollider {
18
+ nodeIndex: number;
19
+ shapeIndex: number;
20
+ descriptor: ShapeDescriptor;
21
+ dynamicFriction: number;
22
+ restitution: number;
23
+ collisionGroup: number;
24
+ collisionMask: number;
25
+ }
26
+ export interface KhrColliderCollection {
27
+ colliders: NormalizedKhrCollider[];
28
+ warnings: string[];
29
+ }
30
+ export interface NormalizedKhrBodyCollider extends NormalizedKhrCollider {
31
+ localPosition: Vector3;
32
+ localRotation: Quaternion;
33
+ /** @internal Index used while resolving the scene-wide filter table. */
34
+ collisionFilterIndex?: number;
35
+ isSensor?: boolean;
36
+ triggerNodeIndex?: number;
37
+ }
38
+ export interface NormalizedKhrRigidBodyGroup {
39
+ bodyNodeIndex: number;
40
+ motion?: KHRPhysicsMotion;
41
+ colliders: NormalizedKhrBodyCollider[];
42
+ }
43
+ export interface KhrRigidBodyGroupCollection {
44
+ groups: NormalizedKhrRigidBodyGroup[];
45
+ warnings: string[];
46
+ }
47
+ /** Resolves collider ownership and body-relative transforms according to the KHR node hierarchy rules. */
48
+ export declare function collectKhrRigidBodyGroups(gltfModel: RnM2): KhrRigidBodyGroupCollection;
49
+ /** Resolves supported static implicit-shape colliders without mutating the glTF model. */
50
+ export declare function collectKhrStaticColliders(gltfModel: RnM2): KhrColliderCollection;
51
+ /** @deprecated Use collectKhrStaticColliders. */
52
+ export declare function collectKhrStaticBoxColliders(gltfModel: RnM2): KhrBoxColliderCollection;
53
+ /**
54
+ * Creates Rapier fixed bodies for supported KHR_physics_rigid_bodies colliders.
55
+ */
56
+ export declare function setupKhrStaticColliders(gltfModel: RnM2, rnEntities: ISceneGraphEntity[]): void;
57
+ /** @deprecated Use setupKhrStaticColliders. */
58
+ export declare function setupKhrStaticBoxColliders(gltfModel: RnM2, rnEntities: ISceneGraphEntity[]): void;
@@ -3,14 +3,14 @@ import type { RnM2Vrma } from '../../types/RnM2Vrma';
3
3
  * A utility class for importing VRMA (VRM Animation) files.
4
4
  *
5
5
  * VRMA is an extension format for VRM that adds animation capabilities,
6
- * allowing for the import and processing of humanoid animation data.
6
+ * allowing for the import and processing of humanoid and expression animation data.
7
7
  * This class provides static methods to import VRMA files from various sources
8
- * and processes the humanoid bone mapping for efficient animation playback.
8
+ * and processes node mappings for efficient animation playback.
9
9
  *
10
10
  * @remarks
11
11
  * This class extends the functionality of Gltf2Importer to handle VRMA-specific
12
12
  * features, particularly the VRMC_vrm_animation extension that contains
13
- * humanoid bone definitions and animation data.
13
+ * humanoid bone and expression definitions.
14
14
  *
15
15
  * @example
16
16
  * ```typescript
@@ -63,4 +63,12 @@ export declare class VrmaImporter {
63
63
  * If no humanoid bones are found, the method returns early without processing.
64
64
  */
65
65
  static readHumanoid(rnm: RnM2Vrma): void;
66
+ /**
67
+ * Creates a reverse mapping from VRMA expression nodes to expression names and their group type.
68
+ * Both preset and custom expressions are included, and multiple expressions may intentionally
69
+ * share the same animation node.
70
+ *
71
+ * @param rnm - The imported VRMA data to augment
72
+ */
73
+ static readExpressions(rnm: RnM2Vrma): void;
66
74
  }
@@ -1,9 +1,11 @@
1
1
  export * from './AnimationAssigner';
2
+ export * from './BoneDataTypeDetector';
2
3
  export * from './DrcPointCloudImporter';
3
4
  export * from './FormatDetector';
4
5
  export * from './Gltf2Importer';
5
6
  export * from './GltfImporter';
6
7
  export * from './ILoaderExtension';
8
+ export * from './KhrPhysicsImporter';
7
9
  export * from './ModelConverter';
8
10
  export * from './RhodoniteImportExtension';
9
11
  export * from './Vrm0xImporter';
@@ -1,3 +1,4 @@
1
+ import type { TypedArray } from '../../types/CommonTypes';
1
2
  import type { IMatrix } from './IMatrix';
2
3
  /**
3
4
  * Abstract base class for matrix implementations.
@@ -9,8 +10,8 @@ import type { IMatrix } from './IMatrix';
9
10
  * @abstract
10
11
  */
11
12
  export declare abstract class AbstractMatrix implements IMatrix {
12
- /** Internal Float32Array storage for matrix elements */
13
- _v: Float32Array;
13
+ /** Internal typed array storage for matrix elements (Float32Array or Float64Array) */
14
+ _v: TypedArray;
14
15
  /**
15
16
  * Gets the matrix element at the specified row and column.
16
17
  *
@@ -1,3 +1,4 @@
1
+ import type { TypedArray } from '../../types/CommonTypes';
1
2
  import type { IQuaternion } from './IQuaternion';
2
3
  import type { IMutableVector3, IVector3 } from './IVector';
3
4
  /**
@@ -146,5 +147,5 @@ export declare abstract class AbstractQuaternion implements IQuaternion {
146
147
  * Internal typed array storage for quaternion components [x, y, z, w].
147
148
  * @protected
148
149
  */
149
- _v: Float32Array;
150
+ _v: TypedArray;
150
151
  }
@@ -11,8 +11,10 @@ import { Quaternion } from './Quaternion';
11
11
  export declare class AnimatedQuaternion extends Quaternion implements IQuaternion, IAnimatedValue {
12
12
  private __animationSamplers;
13
13
  private __firstActiveAnimationTrackName;
14
+ private __firstActiveAnimationSamplerTrackName;
14
15
  private __firstActiveAnimationSampler;
15
16
  private __secondActiveAnimationTrackName?;
17
+ private __secondActiveAnimationSamplerTrackName?;
16
18
  private __secondActiveAnimationSampler?;
17
19
  private __blendingRatio;
18
20
  private __time?;
@@ -101,11 +103,13 @@ export declare class AnimatedQuaternion extends Quaternion implements IQuaternio
101
103
  * @returns The first active animation track name
102
104
  */
103
105
  getFirstActiveAnimationTrackName(): string;
106
+ getFirstActiveAnimationSamplerTrackName(): string;
104
107
  /**
105
108
  * Gets the name of the second active animation track.
106
109
  * @returns The second active animation track name, or undefined if not set
107
110
  */
108
111
  getSecondActiveAnimationTrackName(): string | undefined;
112
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
109
113
  /**
110
114
  * Gets the minimum start time for the specified animation track.
111
115
  * @param trackName - The animation track name
@@ -10,8 +10,10 @@ import { Scalar } from './Scalar';
10
10
  export declare class AnimatedScalar extends Scalar implements IScalar, IAnimatedValue {
11
11
  private __animationSamplers;
12
12
  private __firstActiveAnimationTrackName;
13
+ private __firstActiveAnimationSamplerTrackName;
13
14
  private __firstActiveAnimationSampler;
14
15
  private __secondActiveAnimationTrackName?;
16
+ private __secondActiveAnimationSamplerTrackName?;
15
17
  private __secondActiveAnimationSampler?;
16
18
  private __blendingRatio;
17
19
  private __time?;
@@ -80,11 +82,13 @@ export declare class AnimatedScalar extends Scalar implements IScalar, IAnimated
80
82
  * @returns The name of the first active animation track
81
83
  */
82
84
  getFirstActiveAnimationTrackName(): string;
85
+ getFirstActiveAnimationSamplerTrackName(): string;
83
86
  /**
84
87
  * Gets the name of the second active animation track.
85
88
  * @returns The name of the second active animation track, or undefined if not set
86
89
  */
87
90
  getSecondActiveAnimationTrackName(): string | undefined;
91
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
88
92
  /**
89
93
  * Gets the minimum start time from the input keyframes of the specified animation track.
90
94
  * @param trackName - The name of the animation track
@@ -10,8 +10,10 @@ import { Vector2 } from './Vector2';
10
10
  export declare class AnimatedVector2 extends Vector2 implements IVector2, IAnimatedValue {
11
11
  private __animationSamplers;
12
12
  private __firstActiveAnimationTrackName;
13
+ private __firstActiveAnimationSamplerTrackName;
13
14
  private __firstActiveAnimationSampler;
14
15
  private __secondActiveAnimationTrackName?;
16
+ private __secondActiveAnimationSamplerTrackName?;
15
17
  private __secondActiveAnimationSampler?;
16
18
  private __blendingRatio;
17
19
  private __time?;
@@ -92,11 +94,13 @@ export declare class AnimatedVector2 extends Vector2 implements IVector2, IAnima
92
94
  * @returns The name of the first active animation track
93
95
  */
94
96
  getFirstActiveAnimationTrackName(): string;
97
+ getFirstActiveAnimationSamplerTrackName(): string;
95
98
  /**
96
99
  * Gets the name of the second (secondary) active animation track.
97
100
  * @returns The name of the second active animation track, or undefined if not set
98
101
  */
99
102
  getSecondActiveAnimationTrackName(): string | undefined;
103
+ getSecondActiveAnimationSamplerTrackName(): string | undefined;
100
104
  /**
101
105
  * Gets the minimum start time for a specific animation track.
102
106
  * @param trackName - The name of the animation track
@@ -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 };