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.
- package/README.md +32 -2
- package/VERSION-FILE +1 -1
- package/dist/esm/effekseer/main.d.ts +3 -1
- package/dist/esm/foundation/components/Animation/AnimationComponent.d.ts +15 -1
- package/dist/esm/foundation/components/Animation/AnimationStateRepository.d.ts +26 -10
- package/dist/esm/foundation/components/AnimationState/AnimationStateComponent.d.ts +14 -0
- package/dist/esm/foundation/components/CharacterController/CharacterAnimationController.d.ts +63 -0
- package/dist/esm/foundation/components/CharacterController/CharacterControllerComponent.d.ts +67 -0
- package/dist/esm/foundation/components/CharacterController/ICharacterControllerEntity.d.ts +4 -0
- package/dist/esm/foundation/components/CharacterController/createCharacterControllerEntity.d.ts +4 -0
- package/dist/esm/foundation/components/CharacterController/index.d.ts +4 -0
- package/dist/esm/foundation/components/ComponentTypes.d.ts +6 -0
- package/dist/esm/foundation/components/Physics/PhysicsComponent.d.ts +27 -0
- package/dist/esm/foundation/components/SceneGraph/SceneGraphComponent.d.ts +30 -0
- package/dist/esm/foundation/components/Shape/IShapeEntity.d.ts +4 -0
- package/dist/esm/foundation/components/Shape/ShapeComponent.d.ts +43 -0
- package/dist/esm/foundation/components/Shape/createShapeEntity.d.ts +3 -0
- package/dist/esm/foundation/components/Shape/index.d.ts +3 -0
- package/dist/esm/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
- package/dist/esm/foundation/components/Transform/TransformComponent.d.ts +2 -3
- package/dist/esm/foundation/components/Trigger/ITriggerEntity.d.ts +4 -0
- package/dist/esm/foundation/components/Trigger/TriggerComponent.d.ts +58 -0
- package/dist/esm/foundation/components/Trigger/index.d.ts +2 -0
- package/dist/esm/foundation/components/Vrm/VrmComponent.d.ts +16 -1
- package/dist/esm/foundation/components/WellKnownComponentTIDs.d.ts +4 -1
- package/dist/esm/foundation/components/index.d.ts +3 -0
- package/dist/esm/foundation/core/Component.d.ts +63 -3
- package/dist/esm/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
- package/dist/esm/foundation/core/Config.d.ts +8 -7
- package/dist/esm/foundation/core/Entity.d.ts +15 -0
- package/dist/esm/foundation/definitions/BoneDataType.d.ts +12 -1
- package/dist/esm/foundation/definitions/PhysicsShapeType.d.ts +1 -0
- package/dist/esm/foundation/definitions/ProcessApproach.d.ts +8 -4
- package/dist/esm/foundation/exporter/Gltf2ExporterOps.d.ts +2 -0
- package/dist/esm/foundation/geometry/Shape.d.ts +35 -0
- package/dist/esm/foundation/geometry/index.d.ts +1 -0
- package/dist/esm/foundation/geometry/shapes/Cylinder.d.ts +16 -0
- package/dist/esm/foundation/geometry/shapes/index.d.ts +1 -0
- package/dist/esm/foundation/gizmos/ShapeGizmo.d.ts +22 -0
- package/dist/esm/foundation/gizmos/index.d.ts +1 -0
- package/dist/esm/foundation/helpers/EntityHelper.d.ts +6 -0
- package/dist/esm/foundation/helpers/MeshHelper.d.ts +275 -15
- package/dist/esm/foundation/importer/AnimationAssigner.d.ts +62 -3
- package/dist/esm/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
- package/dist/esm/foundation/importer/Gltf2Importer.d.ts +6 -0
- package/dist/esm/foundation/importer/KhrPhysicsImporter.d.ts +58 -0
- package/dist/esm/foundation/importer/VrmaImporter.d.ts +11 -3
- package/dist/esm/foundation/importer/index.d.ts +2 -0
- package/dist/esm/foundation/math/AbstractMatrix.d.ts +3 -2
- package/dist/esm/foundation/math/AbstractQuaternion.d.ts +2 -1
- package/dist/esm/foundation/math/AnimatedQuaternion.d.ts +4 -0
- package/dist/esm/foundation/math/AnimatedScalar.d.ts +4 -0
- package/dist/esm/foundation/math/AnimatedVector2.d.ts +4 -0
- package/dist/esm/foundation/math/AnimatedVector3.d.ts +4 -0
- package/dist/esm/foundation/math/AnimatedVector4.d.ts +4 -0
- package/dist/esm/foundation/math/AnimatedVectorN.d.ts +4 -0
- package/dist/esm/foundation/math/IAnimatedValue.d.ts +12 -0
- package/dist/esm/foundation/math/IMatrix.d.ts +2 -2
- package/dist/esm/foundation/math/IQuaternion.d.ts +4 -4
- package/dist/esm/foundation/math/LogQuaternion.d.ts +110 -38
- package/dist/esm/foundation/math/MathUtil.d.ts +63 -1
- package/dist/esm/foundation/math/Matrix22.d.ts +176 -30
- package/dist/esm/foundation/math/Matrix33.d.ts +206 -38
- package/dist/esm/foundation/math/Matrix44.d.ts +222 -39
- package/dist/esm/foundation/math/MutableMatrix22.d.ts +125 -130
- package/dist/esm/foundation/math/MutableMatrix33.d.ts +148 -162
- package/dist/esm/foundation/math/MutableMatrix44.d.ts +159 -183
- package/dist/esm/foundation/math/MutableQuaternion.d.ts +241 -132
- package/dist/esm/foundation/math/MutableScalar.d.ts +11 -12
- package/dist/esm/foundation/math/MutableVector2.d.ts +30 -31
- package/dist/esm/foundation/math/MutableVector3.d.ts +28 -26
- package/dist/esm/foundation/math/MutableVector4.d.ts +37 -37
- package/dist/esm/foundation/math/Quaternion.d.ts +529 -36
- package/dist/esm/foundation/math/Scalar.d.ts +13 -14
- package/dist/esm/foundation/math/Vector2.d.ts +38 -38
- package/dist/esm/foundation/math/Vector3.d.ts +55 -54
- package/dist/esm/foundation/math/Vector4.d.ts +54 -55
- package/dist/esm/foundation/misc/MiscUtil.d.ts +79 -16
- package/dist/esm/foundation/misc/Time.d.ts +10 -1
- package/dist/esm/foundation/physics/CharacterControllerStrategy.d.ts +65 -0
- package/dist/esm/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +17 -1
- package/dist/esm/foundation/physics/PhysicsProperty.d.ts +43 -0
- package/dist/esm/foundation/physics/PhysicsStrategy.d.ts +15 -0
- package/dist/esm/foundation/physics/PhysicsWorldQuery.d.ts +65 -0
- package/dist/esm/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +58 -0
- package/dist/esm/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +157 -19
- package/dist/esm/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.d.ts +11 -0
- package/dist/esm/foundation/physics/Rapier/index.d.ts +2 -0
- package/dist/esm/foundation/physics/ShapeTransformResolver.d.ts +19 -0
- package/dist/esm/foundation/physics/index.d.ts +2 -0
- package/dist/esm/index.js +728 -723
- package/dist/esm/types/AnimationTypes.d.ts +1 -1
- package/dist/esm/types/KHR_implicit_shapes.d.ts +47 -0
- package/dist/esm/types/KHR_physics_rigid_bodies.d.ts +54 -0
- package/dist/esm/types/VRMC.d.ts +12 -12
- package/dist/esm/types/VRMC_vrm_animation.d.ts +5 -0
- package/dist/esm/types/glTF2.d.ts +8 -0
- package/dist/esm/types/index.d.ts +2 -0
- package/dist/esm/webgl/main.d.ts +2 -1
- package/dist/esm/webgl/textureLoader/KTX2TextureLoader.d.ts +12 -0
- package/dist/esmdev/effekseer/main.d.ts +3 -1
- package/dist/esmdev/foundation/components/Animation/AnimationComponent.d.ts +15 -1
- package/dist/esmdev/foundation/components/Animation/AnimationStateRepository.d.ts +26 -10
- package/dist/esmdev/foundation/components/AnimationState/AnimationStateComponent.d.ts +14 -0
- package/dist/esmdev/foundation/components/CharacterController/CharacterAnimationController.d.ts +63 -0
- package/dist/esmdev/foundation/components/CharacterController/CharacterControllerComponent.d.ts +67 -0
- package/dist/esmdev/foundation/components/CharacterController/ICharacterControllerEntity.d.ts +4 -0
- package/dist/esmdev/foundation/components/CharacterController/createCharacterControllerEntity.d.ts +4 -0
- package/dist/esmdev/foundation/components/CharacterController/index.d.ts +4 -0
- package/dist/esmdev/foundation/components/ComponentTypes.d.ts +6 -0
- package/dist/esmdev/foundation/components/Physics/PhysicsComponent.d.ts +27 -0
- package/dist/esmdev/foundation/components/SceneGraph/SceneGraphComponent.d.ts +30 -0
- package/dist/esmdev/foundation/components/Shape/IShapeEntity.d.ts +4 -0
- package/dist/esmdev/foundation/components/Shape/ShapeComponent.d.ts +43 -0
- package/dist/esmdev/foundation/components/Shape/createShapeEntity.d.ts +3 -0
- package/dist/esmdev/foundation/components/Shape/index.d.ts +3 -0
- package/dist/esmdev/foundation/components/Skeletal/SkeletalComponent.d.ts +138 -45
- package/dist/esmdev/foundation/components/Transform/TransformComponent.d.ts +2 -3
- package/dist/esmdev/foundation/components/Trigger/ITriggerEntity.d.ts +4 -0
- package/dist/esmdev/foundation/components/Trigger/TriggerComponent.d.ts +58 -0
- package/dist/esmdev/foundation/components/Trigger/index.d.ts +2 -0
- package/dist/esmdev/foundation/components/Vrm/VrmComponent.d.ts +16 -1
- package/dist/esmdev/foundation/components/WellKnownComponentTIDs.d.ts +4 -1
- package/dist/esmdev/foundation/components/index.d.ts +3 -0
- package/dist/esmdev/foundation/core/Component.d.ts +63 -3
- package/dist/esmdev/foundation/core/ComponentMemoryRegistry.d.ts +59 -1
- package/dist/esmdev/foundation/core/Config.d.ts +8 -7
- package/dist/esmdev/foundation/core/Entity.d.ts +15 -0
- package/dist/esmdev/foundation/definitions/BoneDataType.d.ts +12 -1
- package/dist/esmdev/foundation/definitions/PhysicsShapeType.d.ts +1 -0
- package/dist/esmdev/foundation/definitions/ProcessApproach.d.ts +8 -4
- package/dist/esmdev/foundation/exporter/Gltf2ExporterOps.d.ts +2 -0
- package/dist/esmdev/foundation/geometry/Shape.d.ts +35 -0
- package/dist/esmdev/foundation/geometry/index.d.ts +1 -0
- package/dist/esmdev/foundation/geometry/shapes/Cylinder.d.ts +16 -0
- package/dist/esmdev/foundation/geometry/shapes/index.d.ts +1 -0
- package/dist/esmdev/foundation/gizmos/ShapeGizmo.d.ts +22 -0
- package/dist/esmdev/foundation/gizmos/index.d.ts +1 -0
- package/dist/esmdev/foundation/helpers/EntityHelper.d.ts +6 -0
- package/dist/esmdev/foundation/helpers/MeshHelper.d.ts +275 -15
- package/dist/esmdev/foundation/importer/AnimationAssigner.d.ts +62 -3
- package/dist/esmdev/foundation/importer/BoneDataTypeDetector.d.ts +31 -0
- package/dist/esmdev/foundation/importer/Gltf2Importer.d.ts +6 -0
- package/dist/esmdev/foundation/importer/KhrPhysicsImporter.d.ts +58 -0
- package/dist/esmdev/foundation/importer/VrmaImporter.d.ts +11 -3
- package/dist/esmdev/foundation/importer/index.d.ts +2 -0
- package/dist/esmdev/foundation/math/AbstractMatrix.d.ts +3 -2
- package/dist/esmdev/foundation/math/AbstractQuaternion.d.ts +2 -1
- package/dist/esmdev/foundation/math/AnimatedQuaternion.d.ts +4 -0
- package/dist/esmdev/foundation/math/AnimatedScalar.d.ts +4 -0
- package/dist/esmdev/foundation/math/AnimatedVector2.d.ts +4 -0
- package/dist/esmdev/foundation/math/AnimatedVector3.d.ts +4 -0
- package/dist/esmdev/foundation/math/AnimatedVector4.d.ts +4 -0
- package/dist/esmdev/foundation/math/AnimatedVectorN.d.ts +4 -0
- package/dist/esmdev/foundation/math/IAnimatedValue.d.ts +12 -0
- package/dist/esmdev/foundation/math/IMatrix.d.ts +2 -2
- package/dist/esmdev/foundation/math/IQuaternion.d.ts +4 -4
- package/dist/esmdev/foundation/math/LogQuaternion.d.ts +110 -38
- package/dist/esmdev/foundation/math/MathUtil.d.ts +63 -1
- package/dist/esmdev/foundation/math/Matrix22.d.ts +176 -30
- package/dist/esmdev/foundation/math/Matrix33.d.ts +206 -38
- package/dist/esmdev/foundation/math/Matrix44.d.ts +222 -39
- package/dist/esmdev/foundation/math/MutableMatrix22.d.ts +125 -130
- package/dist/esmdev/foundation/math/MutableMatrix33.d.ts +148 -162
- package/dist/esmdev/foundation/math/MutableMatrix44.d.ts +159 -183
- package/dist/esmdev/foundation/math/MutableQuaternion.d.ts +241 -132
- package/dist/esmdev/foundation/math/MutableScalar.d.ts +11 -12
- package/dist/esmdev/foundation/math/MutableVector2.d.ts +30 -31
- package/dist/esmdev/foundation/math/MutableVector3.d.ts +28 -26
- package/dist/esmdev/foundation/math/MutableVector4.d.ts +37 -37
- package/dist/esmdev/foundation/math/Quaternion.d.ts +529 -36
- package/dist/esmdev/foundation/math/Scalar.d.ts +13 -14
- package/dist/esmdev/foundation/math/Vector2.d.ts +38 -38
- package/dist/esmdev/foundation/math/Vector3.d.ts +55 -54
- package/dist/esmdev/foundation/math/Vector4.d.ts +54 -55
- package/dist/esmdev/foundation/misc/MiscUtil.d.ts +79 -16
- package/dist/esmdev/foundation/misc/Time.d.ts +10 -1
- package/dist/esmdev/foundation/physics/CharacterControllerStrategy.d.ts +65 -0
- package/dist/esmdev/foundation/physics/Oimo/OimoPhysicsStrategy.d.ts +17 -1
- package/dist/esmdev/foundation/physics/PhysicsProperty.d.ts +43 -0
- package/dist/esmdev/foundation/physics/PhysicsStrategy.d.ts +15 -0
- package/dist/esmdev/foundation/physics/PhysicsWorldQuery.d.ts +65 -0
- package/dist/esmdev/foundation/physics/Rapier/RapierCharacterControllerStrategy.d.ts +58 -0
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsStrategy.d.ts +157 -19
- package/dist/esmdev/foundation/physics/Rapier/RapierPhysicsWorldQueryStrategy.d.ts +11 -0
- package/dist/esmdev/foundation/physics/Rapier/index.d.ts +2 -0
- package/dist/esmdev/foundation/physics/ShapeTransformResolver.d.ts +19 -0
- package/dist/esmdev/foundation/physics/index.d.ts +2 -0
- package/dist/esmdev/index.js +35168 -27712
- package/dist/esmdev/types/AnimationTypes.d.ts +1 -1
- package/dist/esmdev/types/KHR_implicit_shapes.d.ts +47 -0
- package/dist/esmdev/types/KHR_physics_rigid_bodies.d.ts +54 -0
- package/dist/esmdev/types/VRMC.d.ts +12 -12
- package/dist/esmdev/types/VRMC_vrm_animation.d.ts +5 -0
- package/dist/esmdev/types/glTF2.d.ts +8 -0
- package/dist/esmdev/types/index.d.ts +2 -0
- package/dist/esmdev/webgl/main.d.ts +2 -1
- package/dist/esmdev/webgl/textureLoader/KTX2TextureLoader.d.ts +12 -0
- package/package.json +25 -23
|
@@ -5,6 +5,7 @@ import type { AnimationStateComponent } from '../components/AnimationState/Anima
|
|
|
5
5
|
import type { BlendShapeComponent } from '../components/BlendShape/BlendShapeComponent';
|
|
6
6
|
import type { CameraComponent } from '../components/Camera/CameraComponent';
|
|
7
7
|
import type { CameraControllerComponent } from '../components/CameraController/CameraControllerComponent';
|
|
8
|
+
import type { CharacterControllerComponent } from '../components/CharacterController/CharacterControllerComponent';
|
|
8
9
|
import type { ConstraintComponent } from '../components/Constraint/ConstraintComponent';
|
|
9
10
|
import type { LightComponent } from '../components/Light/LightComponent';
|
|
10
11
|
import type { MeshComponent } from '../components/Mesh/MeshComponent';
|
|
@@ -12,8 +13,10 @@ import type { MeshRendererComponent } from '../components/MeshRenderer/MeshRende
|
|
|
12
13
|
import type { PhysicsComponent } from '../components/Physics/PhysicsComponent';
|
|
13
14
|
import type { RaymarchingComponent } from '../components/Raymarching/RaymarchingComponent';
|
|
14
15
|
import type { SceneGraphComponent } from '../components/SceneGraph/SceneGraphComponent';
|
|
16
|
+
import type { ShapeComponent } from '../components/Shape/ShapeComponent';
|
|
15
17
|
import type { SkeletalComponent } from '../components/Skeletal/SkeletalComponent';
|
|
16
18
|
import type { TransformComponent } from '../components/Transform/TransformComponent';
|
|
19
|
+
import type { TriggerComponent } from '../components/Trigger/TriggerComponent';
|
|
17
20
|
import type { VrmComponent } from '../components/Vrm/VrmComponent';
|
|
18
21
|
import type { Engine } from '../system/Engine';
|
|
19
22
|
import type { Component } from './Component';
|
|
@@ -92,6 +95,12 @@ export interface IEntity extends IRnObject {
|
|
|
92
95
|
* @returns The PhysicsComponent if present, undefined otherwise
|
|
93
96
|
*/
|
|
94
97
|
tryToGetPhysics(): PhysicsComponent | undefined;
|
|
98
|
+
/** Attempts to retrieve the CharacterControllerComponent from this entity. */
|
|
99
|
+
tryToGetCharacterController(): CharacterControllerComponent | undefined;
|
|
100
|
+
/** Attempts to retrieve the ShapeComponent from this entity. */
|
|
101
|
+
tryToGetShape(): ShapeComponent | undefined;
|
|
102
|
+
/** Attempts to retrieve the TriggerComponent from this entity. */
|
|
103
|
+
tryToGetTrigger(): TriggerComponent | undefined;
|
|
95
104
|
/**
|
|
96
105
|
* Attempts to retrieve the SceneGraphComponent from this entity.
|
|
97
106
|
* @returns The SceneGraphComponent if present, undefined otherwise
|
|
@@ -315,6 +324,12 @@ export declare class Entity extends RnObject implements IEntity {
|
|
|
315
324
|
* @returns The PhysicsComponent if this entity has one, undefined otherwise
|
|
316
325
|
*/
|
|
317
326
|
tryToGetPhysics(): PhysicsComponent | undefined;
|
|
327
|
+
/** Attempts to retrieve the CharacterControllerComponent from this entity. */
|
|
328
|
+
tryToGetCharacterController(): CharacterControllerComponent | undefined;
|
|
329
|
+
/** Attempts to retrieve the ShapeComponent from this entity. */
|
|
330
|
+
tryToGetShape(): ShapeComponent | undefined;
|
|
331
|
+
/** Attempts to retrieve the TriggerComponent from this entity. */
|
|
332
|
+
tryToGetTrigger(): TriggerComponent | undefined;
|
|
318
333
|
/**
|
|
319
334
|
* Attempts to retrieve the SceneGraphComponent from this entity.
|
|
320
335
|
*
|
|
@@ -2,12 +2,23 @@ import { type EnumIO } from '../misc/EnumIO';
|
|
|
2
2
|
export type BoneDataTypeEnum = EnumIO;
|
|
3
3
|
declare function from(index: number): BoneDataTypeEnum;
|
|
4
4
|
declare function fromString(str: string): BoneDataTypeEnum;
|
|
5
|
+
/**
|
|
6
|
+
* Returns how many vec4 slots one joint occupies in the GPU bone data array.
|
|
7
|
+
*
|
|
8
|
+
* - Mat43x1: 3 (a 4x3 matrix)
|
|
9
|
+
* - Vec4x2: 2 (translation + scale, with a log-quaternion packed into the w components)
|
|
10
|
+
* - Vec4x1: 1 (log-quaternion + quantized translation/uniform scale)
|
|
11
|
+
*
|
|
12
|
+
* @param boneDataType - The bone data type
|
|
13
|
+
* @returns The number of vec4 slots per joint
|
|
14
|
+
*/
|
|
15
|
+
declare function getVec4CountPerJoint(boneDataType: BoneDataTypeEnum): number;
|
|
5
16
|
export declare const BoneDataType: Readonly<{
|
|
6
17
|
Mat43x1: EnumIO;
|
|
7
18
|
Vec4x2: EnumIO;
|
|
8
|
-
Vec4x2Old: EnumIO;
|
|
9
19
|
Vec4x1: EnumIO;
|
|
10
20
|
from: typeof from;
|
|
11
21
|
fromString: typeof fromString;
|
|
22
|
+
getVec4CountPerJoint: typeof getVec4CountPerJoint;
|
|
12
23
|
}>;
|
|
13
24
|
export {};
|
|
@@ -2,6 +2,7 @@ import { type EnumIO } from '../misc/EnumIO';
|
|
|
2
2
|
export type PhysicsShapeTypeEnum = EnumIO;
|
|
3
3
|
declare function from(index: number): PhysicsShapeTypeEnum;
|
|
4
4
|
declare function fromString(str: string): PhysicsShapeTypeEnum;
|
|
5
|
+
/** @deprecated Use ShapeDescriptor and ShapeComponent for new code. */
|
|
5
6
|
export declare const PhysicsShape: Readonly<{
|
|
6
7
|
Sphere: EnumIO;
|
|
7
8
|
Box: EnumIO;
|
|
@@ -8,15 +8,19 @@ export declare class ProcessApproachClass extends EnumClass implements EnumIO {
|
|
|
8
8
|
}
|
|
9
9
|
export type ProcessApproachEnum = ProcessApproachClass;
|
|
10
10
|
declare function from(index: number): ProcessApproachEnum | undefined;
|
|
11
|
+
declare const isDataTextureApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
12
|
+
declare const isUniformApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
13
|
+
declare const isWebGpuApproach: (processApproach: ProcessApproachEnum) => boolean;
|
|
14
|
+
declare const isWebGL2Approach: (processApproach: ProcessApproachEnum) => boolean;
|
|
11
15
|
export declare const ProcessApproach: Readonly<{
|
|
12
|
-
isDataTextureApproach:
|
|
13
|
-
isUniformApproach:
|
|
14
|
-
isWebGpuApproach:
|
|
16
|
+
isDataTextureApproach: typeof isDataTextureApproach;
|
|
17
|
+
isUniformApproach: typeof isUniformApproach;
|
|
18
|
+
isWebGpuApproach: typeof isWebGpuApproach;
|
|
15
19
|
None: ProcessApproachClass;
|
|
16
20
|
Uniform: ProcessApproachClass;
|
|
17
21
|
DataTexture: ProcessApproachClass;
|
|
18
22
|
WebGPU: ProcessApproachClass;
|
|
19
23
|
from: typeof from;
|
|
20
|
-
isWebGL2Approach:
|
|
24
|
+
isWebGL2Approach: typeof isWebGL2Approach;
|
|
21
25
|
}>;
|
|
22
26
|
export {};
|
|
@@ -54,6 +54,8 @@ export declare function accumulateBufferViewByteLength(bufferViewByteLengthAccum
|
|
|
54
54
|
* @throws Error if the path name is invalid
|
|
55
55
|
*/
|
|
56
56
|
export declare function convertToGltfAnimationPathName(path: AnimationPathName): Gltf2AnimationPathName;
|
|
57
|
+
/** Returns whether an animation path only has meaning inside Rhodonite at runtime. */
|
|
58
|
+
export declare function isRuntimeOnlyAnimationPath(path: AnimationPathName): boolean;
|
|
57
59
|
/**
|
|
58
60
|
* Aligns accessor byte offset to 4-byte boundaries.
|
|
59
61
|
*
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { IQuaternion, IVector3 } from '../math';
|
|
2
|
+
export type BoxShapeDescriptor = {
|
|
3
|
+
readonly type: 'box';
|
|
4
|
+
readonly size: IVector3;
|
|
5
|
+
};
|
|
6
|
+
export type SphereShapeDescriptor = {
|
|
7
|
+
readonly type: 'sphere';
|
|
8
|
+
readonly radius: number;
|
|
9
|
+
};
|
|
10
|
+
export type CylinderShapeDescriptor = {
|
|
11
|
+
readonly type: 'cylinder';
|
|
12
|
+
/** Total height along the local Y axis. */
|
|
13
|
+
readonly height: number;
|
|
14
|
+
readonly radiusBottom: number;
|
|
15
|
+
readonly radiusTop: number;
|
|
16
|
+
};
|
|
17
|
+
export type CapsuleShapeDescriptor = {
|
|
18
|
+
readonly type: 'capsule';
|
|
19
|
+
/** Distance between the centers of the two capping spheres. */
|
|
20
|
+
readonly height: number;
|
|
21
|
+
readonly radiusBottom: number;
|
|
22
|
+
readonly radiusTop: number;
|
|
23
|
+
};
|
|
24
|
+
export type ShapeDescriptor = BoxShapeDescriptor | SphereShapeDescriptor | CylinderShapeDescriptor | CapsuleShapeDescriptor;
|
|
25
|
+
export type ShapeLocalTransform = {
|
|
26
|
+
readonly position?: IVector3;
|
|
27
|
+
readonly rotation?: IQuaternion;
|
|
28
|
+
};
|
|
29
|
+
export type ShapeInstance = {
|
|
30
|
+
readonly shape: ShapeDescriptor;
|
|
31
|
+
readonly localPosition: IVector3;
|
|
32
|
+
readonly localRotation: IQuaternion;
|
|
33
|
+
};
|
|
34
|
+
/** Creates or validates an immutable, shareable shape descriptor. */
|
|
35
|
+
export declare function normalizeShapeDescriptor(descriptor: ShapeDescriptor): ShapeDescriptor;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Count } from '../../../types/CommonTypes';
|
|
2
|
+
import type { IAnyPrimitiveDescriptor } from '../Primitive';
|
|
3
|
+
import { IShape } from './IShape';
|
|
4
|
+
/** Descriptor for a capped cylinder or truncated cone aligned with the Y axis. */
|
|
5
|
+
export interface CylinderDescriptor extends IAnyPrimitiveDescriptor {
|
|
6
|
+
radiusBottom?: number;
|
|
7
|
+
radiusTop?: number;
|
|
8
|
+
height?: number;
|
|
9
|
+
radialSegments?: Count;
|
|
10
|
+
includeCaps?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** A centered, capped cylinder that also supports different top and bottom radii. */
|
|
13
|
+
export declare class Cylinder extends IShape {
|
|
14
|
+
generate(_desc?: CylinderDescriptor): void;
|
|
15
|
+
private __appendCap;
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ShapeComponent } from '../components/Shape/ShapeComponent';
|
|
2
|
+
import type { ISceneGraphEntity } from '../helpers/EntityHelper';
|
|
3
|
+
import type { Engine } from '../system/Engine';
|
|
4
|
+
import { Gizmo } from './Gizmo';
|
|
5
|
+
/** Displays every analytic shape stored in a ShapeComponent. */
|
|
6
|
+
export declare class ShapeGizmo extends Gizmo {
|
|
7
|
+
protected __topEntity?: ISceneGraphEntity;
|
|
8
|
+
private readonly __shapeComponent;
|
|
9
|
+
private __material?;
|
|
10
|
+
private __shapeEntities;
|
|
11
|
+
constructor(engine: Engine, shapeComponent: ShapeComponent);
|
|
12
|
+
get isSetup(): boolean;
|
|
13
|
+
/** Root entity to register in a dedicated or existing gizmo render pass. */
|
|
14
|
+
get topEntity(): ISceneGraphEntity | undefined;
|
|
15
|
+
_setup(): void;
|
|
16
|
+
_update(): void;
|
|
17
|
+
rebuild(): void;
|
|
18
|
+
_destroy(): void;
|
|
19
|
+
private __populateShapes;
|
|
20
|
+
private __addShape;
|
|
21
|
+
private __addMesh;
|
|
22
|
+
}
|
|
@@ -3,6 +3,7 @@ import type { IAnimationStateEntityMethods } from '../components/AnimationState'
|
|
|
3
3
|
import type { IBlendShapeEntityMethods } from '../components/BlendShape/IBlendShapeEntity';
|
|
4
4
|
import type { ICameraEntityMethods } from '../components/Camera/ICameraEntity';
|
|
5
5
|
import type { ICameraControllerEntityMethods } from '../components/CameraController/ICameraControllerEntity';
|
|
6
|
+
import type { ICharacterControllerEntityMethods } from '../components/CharacterController/ICharacterControllerEntity';
|
|
6
7
|
import type { IConstraintEntityMethods } from '../components/Constraint/IConstraintEntity';
|
|
7
8
|
import type { ILightEntityMethods } from '../components/Light/ILightEntity';
|
|
8
9
|
import type { IMeshEntityMethods } from '../components/Mesh/IMeshEntity';
|
|
@@ -10,6 +11,7 @@ import type { IMeshRendererEntityMethods } from '../components/MeshRenderer/IMes
|
|
|
10
11
|
import type { IPhysicsEntityMethods } from '../components/Physics/IPhysicsEntity';
|
|
11
12
|
import type { IRaymarchingEntityMethods } from '../components/Raymarching/IRaymarchingEntity';
|
|
12
13
|
import type { ISceneGraphEntityMethods } from '../components/SceneGraph/ISceneGraphEntity';
|
|
14
|
+
import type { IShapeEntityMethods } from '../components/Shape/IShapeEntity';
|
|
13
15
|
import type { ISkeletalEntityMethods } from '../components/Skeletal/ISkeletalEntity';
|
|
14
16
|
import type { ITransformEntityMethods } from '../components/Transform/ITransformEntity';
|
|
15
17
|
import type { IEntity } from '../core/Entity';
|
|
@@ -54,6 +56,10 @@ export type ILightEntity = ISceneGraphEntity & ILightEntityMethods;
|
|
|
54
56
|
* Extends scene graph entity with physics methods.
|
|
55
57
|
*/
|
|
56
58
|
export type IPhysicsEntity = ISceneGraphEntity & IPhysicsEntityMethods;
|
|
59
|
+
/** An entity controlled by a kinematic character controller. */
|
|
60
|
+
export type ICharacterControllerEntity = ISceneGraphEntity & ICharacterControllerEntityMethods;
|
|
61
|
+
/** An entity carrying one or more lightweight analytic shapes. */
|
|
62
|
+
export type IShapeEntity = ISceneGraphEntity & IShapeEntityMethods;
|
|
57
63
|
/**
|
|
58
64
|
* An entity that supports blend shape animation.
|
|
59
65
|
* Combines mesh entity with blend shape capabilities.
|
|
@@ -2,6 +2,7 @@ import type { AxisDescriptor } from '../geometry/shapes/Axis';
|
|
|
2
2
|
import { type CapsuleDescriptor } from '../geometry/shapes/Capsule';
|
|
3
3
|
import { type ConeDescriptor } from '../geometry/shapes/Cone';
|
|
4
4
|
import { type CubeDescriptor } from '../geometry/shapes/Cube';
|
|
5
|
+
import { type CylinderDescriptor } from '../geometry/shapes/Cylinder';
|
|
5
6
|
import { type GridDescriptor } from '../geometry/shapes/Grid';
|
|
6
7
|
import type { IShape } from '../geometry/shapes/IShape';
|
|
7
8
|
import { type JointDescriptor } from '../geometry/shapes/Joint';
|
|
@@ -10,6 +11,266 @@ import { type PlaneDescriptor } from '../geometry/shapes/Plane';
|
|
|
10
11
|
import { type RingDescriptor } from '../geometry/shapes/Ring';
|
|
11
12
|
import { type SphereDescriptor } from '../geometry/shapes/Sphere';
|
|
12
13
|
import type { Engine } from '../system/Engine';
|
|
14
|
+
import type { IMeshEntity } from './EntityHelper';
|
|
15
|
+
/**
|
|
16
|
+
* Creates a plane mesh entity with configurable orientation.
|
|
17
|
+
*
|
|
18
|
+
* @param engine - The engine instance
|
|
19
|
+
* @param desc - Configuration object for the plane
|
|
20
|
+
* @param desc.direction - The orientation of the plane ('xz', 'xy', or 'yz'). Defaults to 'xz'
|
|
21
|
+
* @returns A mesh entity representing the plane
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```typescript
|
|
25
|
+
* // Create a horizontal plane (default)
|
|
26
|
+
* const horizontalPlane = createPlane();
|
|
27
|
+
*
|
|
28
|
+
* // Create a vertical plane facing forward
|
|
29
|
+
* const verticalPlane = createPlane({ direction: 'xy' });
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
declare const createPlane: (engine: Engine, desc?: PlaneDescriptor & {
|
|
33
|
+
direction?: 'xz' | 'xy' | 'yz';
|
|
34
|
+
}) => IMeshEntity;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a line mesh entity.
|
|
37
|
+
*
|
|
38
|
+
* @param engine - The engine instance
|
|
39
|
+
* @param desc - Configuration object for the line geometry
|
|
40
|
+
* @returns A mesh entity representing the line
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* ```typescript
|
|
44
|
+
* const line = createLine({
|
|
45
|
+
* startPoint: Vector3.fromCopy3(0, 0, 0),
|
|
46
|
+
* endPoint: Vector3.fromCopy3(1, 1, 1)
|
|
47
|
+
* });
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
declare const createLine: (engine: Engine, desc?: LineDescriptor) => IMeshEntity;
|
|
51
|
+
/**
|
|
52
|
+
* Creates a grid mesh entity for visual reference.
|
|
53
|
+
*
|
|
54
|
+
* @param engine - The engine instance
|
|
55
|
+
* @param desc - Configuration object for the grid geometry
|
|
56
|
+
* @returns A mesh entity representing the grid
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```typescript
|
|
60
|
+
* const grid = createGrid({
|
|
61
|
+
* size: 10,
|
|
62
|
+
* divisions: 20
|
|
63
|
+
* });
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
declare const createGrid: (engine: Engine, desc?: GridDescriptor) => IMeshEntity;
|
|
67
|
+
/**
|
|
68
|
+
* Creates a cone mesh entity.
|
|
69
|
+
*
|
|
70
|
+
* @param engine - The engine instance
|
|
71
|
+
* @param desc - Configuration object for the cone geometry
|
|
72
|
+
* @returns A mesh entity representing the cone
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* const cone = createCone({
|
|
77
|
+
* radius: 0.2,
|
|
78
|
+
* height: 0.5,
|
|
79
|
+
* includeBase: false,
|
|
80
|
+
* });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
declare const createCone: (engine: Engine, desc?: ConeDescriptor) => IMeshEntity;
|
|
84
|
+
/** Creates a centered cylinder or truncated-cone mesh entity. */
|
|
85
|
+
declare const createCylinder: (engine: Engine, desc?: CylinderDescriptor) => IMeshEntity;
|
|
86
|
+
/**
|
|
87
|
+
* Creates a cube mesh entity with optional physics simulation.
|
|
88
|
+
*
|
|
89
|
+
* @param engine - The engine instance
|
|
90
|
+
* @param desc - Configuration object for the cube geometry and physics properties
|
|
91
|
+
* @returns A mesh entity representing the cube, with physics component if specified
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```typescript
|
|
95
|
+
* // Create a simple cube
|
|
96
|
+
* const cube = createCube({ widthVector: Vector3.fromCopy3(2, 2, 2) });
|
|
97
|
+
*
|
|
98
|
+
* // Create a cube with physics
|
|
99
|
+
* const physicsCube = createCube({
|
|
100
|
+
* widthVector: Vector3.fromCopy3(1, 1, 1),
|
|
101
|
+
* physics: {
|
|
102
|
+
* use: true,
|
|
103
|
+
* move: true,
|
|
104
|
+
* density: 1.0,
|
|
105
|
+
* friction: 0.5,
|
|
106
|
+
* restitution: 0.3
|
|
107
|
+
* }
|
|
108
|
+
* });
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
declare const createCube: (engine: Engine, desc?: CubeDescriptor) => IMeshEntity;
|
|
112
|
+
/**
|
|
113
|
+
* Creates multiple cube mesh entities efficiently by sharing the same mesh geometry.
|
|
114
|
+
* This is more performance-friendly than creating individual cubes when you need many instances.
|
|
115
|
+
*
|
|
116
|
+
* @param numberToCreate - The number of cube entities to create
|
|
117
|
+
* @param desc - Configuration object for the cube geometry and physics properties
|
|
118
|
+
* @returns An array of mesh entities representing the cubes
|
|
119
|
+
*
|
|
120
|
+
* @example
|
|
121
|
+
* ```typescript
|
|
122
|
+
* // Create 100 cubes for instancing
|
|
123
|
+
* const cubes = createCubes(100, {
|
|
124
|
+
* widthVector: Vector3.fromCopy3(0.5, 0.5, 0.5),
|
|
125
|
+
* physics: { use: true, move: true }
|
|
126
|
+
* });
|
|
127
|
+
*
|
|
128
|
+
* // Position them individually
|
|
129
|
+
* cubes.forEach((cube, index) => {
|
|
130
|
+
* cube.localPosition = Vector3.fromCopy3(index % 10, 0, Math.floor(index / 10));
|
|
131
|
+
* });
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
declare const createCubes: (engine: Engine, numberToCreate: number, desc?: CubeDescriptor) => IMeshEntity[];
|
|
135
|
+
/**
|
|
136
|
+
* Creates a sphere mesh entity with optional physics simulation.
|
|
137
|
+
*
|
|
138
|
+
* @param engine - The engine instance
|
|
139
|
+
* @param desc - Configuration object for the sphere geometry and physics properties
|
|
140
|
+
* @returns A mesh entity representing the sphere, with physics component if specified
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```typescript
|
|
144
|
+
* // Create a simple sphere
|
|
145
|
+
* const sphere = createSphere({ radius: 2.0 });
|
|
146
|
+
*
|
|
147
|
+
* // Create a sphere with physics
|
|
148
|
+
* const physicsSphere = createSphere({
|
|
149
|
+
* radius: 1.0,
|
|
150
|
+
* physics: {
|
|
151
|
+
* use: true,
|
|
152
|
+
* move: true,
|
|
153
|
+
* density: 0.8,
|
|
154
|
+
* friction: 0.4,
|
|
155
|
+
* restitution: 0.9
|
|
156
|
+
* }
|
|
157
|
+
* });
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
declare const createSphere: (engine: Engine, desc?: SphereDescriptor) => IMeshEntity;
|
|
161
|
+
/**
|
|
162
|
+
* Creates multiple sphere mesh entities efficiently by sharing the same mesh geometry.
|
|
163
|
+
* This is more performance-friendly than creating individual spheres when you need many instances.
|
|
164
|
+
*
|
|
165
|
+
* @param numberToCreate - The number of sphere entities to create
|
|
166
|
+
* @param desc - Configuration object for the sphere geometry and physics properties
|
|
167
|
+
* @returns An array of mesh entities representing the spheres
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```typescript
|
|
171
|
+
* // Create 50 spheres for a particle system
|
|
172
|
+
* const spheres = createSpheres(50, {
|
|
173
|
+
* radius: 0.2,
|
|
174
|
+
* physics: { use: true, move: true, density: 0.5 }
|
|
175
|
+
* });
|
|
176
|
+
*
|
|
177
|
+
* // Scatter them randomly
|
|
178
|
+
* spheres.forEach(sphere => {
|
|
179
|
+
* sphere.localPosition = Vector3.fromCopy3(
|
|
180
|
+
* Math.random() * 10 - 5,
|
|
181
|
+
* Math.random() * 10,
|
|
182
|
+
* Math.random() * 10 - 5
|
|
183
|
+
* );
|
|
184
|
+
* });
|
|
185
|
+
* ```
|
|
186
|
+
*/
|
|
187
|
+
declare const createSpheres: (engine: Engine, numberToCreate: number, desc?: SphereDescriptor) => IMeshEntity[];
|
|
188
|
+
/**
|
|
189
|
+
* Creates a joint mesh entity for skeletal animation or mechanical connections.
|
|
190
|
+
*
|
|
191
|
+
* @param engine - The engine instance
|
|
192
|
+
* @param desc - Configuration object for the joint geometry
|
|
193
|
+
* @returns A mesh entity representing the joint
|
|
194
|
+
*
|
|
195
|
+
* @example
|
|
196
|
+
* ```typescript
|
|
197
|
+
* const joint = createJoint({
|
|
198
|
+
* radius: 0.1,
|
|
199
|
+
* length: 2.0
|
|
200
|
+
* });
|
|
201
|
+
* ```
|
|
202
|
+
*/
|
|
203
|
+
declare const createJoint: (engine: Engine, desc?: JointDescriptor) => IMeshEntity;
|
|
204
|
+
/**
|
|
205
|
+
* Creates an axis mesh entity for coordinate system visualization.
|
|
206
|
+
* Typically displays X, Y, and Z axes with different colors.
|
|
207
|
+
*
|
|
208
|
+
* @param engine - The engine instance
|
|
209
|
+
* @param desc - Configuration object for the axis geometry
|
|
210
|
+
* @returns A mesh entity representing the coordinate axes
|
|
211
|
+
*
|
|
212
|
+
* @example
|
|
213
|
+
* ```typescript
|
|
214
|
+
* const worldAxis = createAxis({
|
|
215
|
+
* length: 5.0,
|
|
216
|
+
* thickness: 0.1
|
|
217
|
+
* });
|
|
218
|
+
* ```
|
|
219
|
+
*/
|
|
220
|
+
declare const createAxis: (engine: Engine, desc?: AxisDescriptor) => IMeshEntity;
|
|
221
|
+
/**
|
|
222
|
+
* Creates a ring (annulus) mesh entity.
|
|
223
|
+
*
|
|
224
|
+
* @param engine - The engine instance
|
|
225
|
+
* @param desc - Configuration object for the ring geometry
|
|
226
|
+
* @param desc.radius - The radius of the ring (center to middle of band). Defaults to 1
|
|
227
|
+
* @param desc.thickness - The thickness of the ring band. Defaults to 0.1
|
|
228
|
+
* @param desc.segments - Number of segments forming the circumference. Defaults to 64
|
|
229
|
+
* @param desc.axis - The axis perpendicular to the ring plane ('x', 'y', or 'z'). Defaults to 'y'
|
|
230
|
+
* @returns A mesh entity representing the ring
|
|
231
|
+
*
|
|
232
|
+
* @example
|
|
233
|
+
* ```typescript
|
|
234
|
+
* // Create a horizontal ring (default, in XZ plane)
|
|
235
|
+
* const ring = createRing({ radius: 2, thickness: 0.2 });
|
|
236
|
+
*
|
|
237
|
+
* // Create a vertical ring in YZ plane
|
|
238
|
+
* const verticalRing = createRing({
|
|
239
|
+
* radius: 1.5,
|
|
240
|
+
* thickness: 0.1,
|
|
241
|
+
* segments: 32,
|
|
242
|
+
* axis: 'x'
|
|
243
|
+
* });
|
|
244
|
+
* ```
|
|
245
|
+
*/
|
|
246
|
+
declare const createRing: (engine: Engine, desc?: RingDescriptor) => IMeshEntity;
|
|
247
|
+
/**
|
|
248
|
+
* Creates a capsule mesh entity.
|
|
249
|
+
* A capsule is a cylinder with hemispherical caps at both ends.
|
|
250
|
+
*
|
|
251
|
+
* @param engine - The engine instance
|
|
252
|
+
* @param desc - Configuration object for the capsule geometry
|
|
253
|
+
* @param desc.radius - The radius of the capsule (hemispheres and cylinder). Defaults to 0.5
|
|
254
|
+
* @param desc.height - The height of the cylinder part (distance between hemisphere centers). Defaults to 1
|
|
255
|
+
* @param desc.widthSegments - Number of horizontal segments. Defaults to 16
|
|
256
|
+
* @param desc.heightSegments - Number of vertical segments for each hemisphere. Defaults to 8
|
|
257
|
+
* @returns A mesh entity representing the capsule
|
|
258
|
+
*
|
|
259
|
+
* @example
|
|
260
|
+
* ```typescript
|
|
261
|
+
* // Create a simple capsule
|
|
262
|
+
* const capsule = createCapsule({ radius: 0.5, height: 2.0 });
|
|
263
|
+
*
|
|
264
|
+
* // Create a detailed capsule
|
|
265
|
+
* const detailedCapsule = createCapsule({
|
|
266
|
+
* radius: 0.3,
|
|
267
|
+
* height: 1.5,
|
|
268
|
+
* widthSegments: 24,
|
|
269
|
+
* heightSegments: 12
|
|
270
|
+
* });
|
|
271
|
+
* ```
|
|
272
|
+
*/
|
|
273
|
+
declare const createCapsule: (engine: Engine, desc?: CapsuleDescriptor) => IMeshEntity;
|
|
13
274
|
/**
|
|
14
275
|
* Creates a mesh entity from a primitive shape.
|
|
15
276
|
* This is a utility function used internally by other creation methods.
|
|
@@ -25,22 +286,21 @@ import type { Engine } from '../system/Engine';
|
|
|
25
286
|
* const entity = createShape(customPrimitive);
|
|
26
287
|
* ```
|
|
27
288
|
*/
|
|
28
|
-
declare function createShape(engine: Engine, primitive: IShape):
|
|
289
|
+
declare function createShape(engine: Engine, primitive: IShape): IMeshEntity;
|
|
29
290
|
export declare const MeshHelper: Readonly<{
|
|
30
|
-
createPlane:
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
createRing: (engine: Engine, desc?: RingDescriptor) => import("./EntityHelper").IMeshEntity;
|
|
291
|
+
createPlane: typeof createPlane;
|
|
292
|
+
createLine: typeof createLine;
|
|
293
|
+
createGrid: typeof createGrid;
|
|
294
|
+
createCone: typeof createCone;
|
|
295
|
+
createCylinder: typeof createCylinder;
|
|
296
|
+
createCube: typeof createCube;
|
|
297
|
+
createCubes: typeof createCubes;
|
|
298
|
+
createSphere: typeof createSphere;
|
|
299
|
+
createSpheres: typeof createSpheres;
|
|
300
|
+
createCapsule: typeof createCapsule;
|
|
301
|
+
createJoint: typeof createJoint;
|
|
302
|
+
createAxis: typeof createAxis;
|
|
303
|
+
createRing: typeof createRing;
|
|
44
304
|
createShape: typeof createShape;
|
|
45
305
|
}>;
|
|
46
306
|
export {};
|
|
@@ -1,11 +1,37 @@
|
|
|
1
|
-
import type { RnM2Vrma } from '../../types';
|
|
1
|
+
import type { AnimationTrackName, RnM2Vrma } from '../../types';
|
|
2
2
|
import type { RnM2 } from '../../types/RnM2';
|
|
3
3
|
import type { VRM } from '../../types/VRM';
|
|
4
4
|
import type { Vrm0x } from '../../types/VRM0x';
|
|
5
5
|
import type { Vrm1 } from '../../types/VRM1';
|
|
6
|
+
import type { CharacterAnimationMapping, CharacterAnimationSemantic } from '../components/CharacterController/CharacterAnimationController';
|
|
6
7
|
import type { ISceneGraphEntity } from '../helpers/EntityHelper';
|
|
7
8
|
import type { Engine } from '../system/Engine';
|
|
8
9
|
type RetargetMode = 'none' | 'global' | 'absolute';
|
|
10
|
+
/** Controls how a VRMA's hips translation is handled during retargeting. */
|
|
11
|
+
export type VrmaRootMotionPolicy = 'preserve' | 'ignoreHipsTranslation';
|
|
12
|
+
/** Optional behavior for a single VRMA assignment. */
|
|
13
|
+
export interface VrmaAnimationAssignmentOptions {
|
|
14
|
+
/**
|
|
15
|
+
* Whether translation channels that target the humanoid hips are retargeted.
|
|
16
|
+
* Defaults to `preserve` for compatibility with the existing VRMA assignment API.
|
|
17
|
+
*/
|
|
18
|
+
rootMotion?: VrmaRootMotionPolicy;
|
|
19
|
+
}
|
|
20
|
+
/** VRMA files to assign to one or more character controller semantic motion states. */
|
|
21
|
+
export type CharacterVrmaAnimationSet = Readonly<Partial<Record<CharacterAnimationSemantic, RnM2Vrma>>>;
|
|
22
|
+
/** Optional behavior for assigning a character VRMA set. */
|
|
23
|
+
export interface CharacterVrmaAnimationAssignmentOptions {
|
|
24
|
+
/**
|
|
25
|
+
* Defaults to `ignoreHipsTranslation` so the physics character controller remains
|
|
26
|
+
* the sole authority for the character's world position.
|
|
27
|
+
*/
|
|
28
|
+
rootMotion?: VrmaRootMotionPolicy;
|
|
29
|
+
}
|
|
30
|
+
/** The controller mapping and concrete tracks created from a character VRMA set. */
|
|
31
|
+
export interface CharacterVrmaAnimationAssignmentResult {
|
|
32
|
+
mapping: CharacterAnimationMapping;
|
|
33
|
+
trackNames: Readonly<Partial<Record<CharacterAnimationSemantic, readonly AnimationTrackName[]>>>;
|
|
34
|
+
}
|
|
9
35
|
export declare class AnimationAssigner {
|
|
10
36
|
private readonly __engine;
|
|
11
37
|
constructor(__engine: Engine);
|
|
@@ -23,14 +49,28 @@ export declare class AnimationAssigner {
|
|
|
23
49
|
assignAnimation(rootEntity: ISceneGraphEntity, gltfModel: RnM2, vrmModel: VRM | Vrm1 | Vrm0x, isSameSkeleton: boolean, retargetMode: RetargetMode): ISceneGraphEntity;
|
|
24
50
|
/**
|
|
25
51
|
* Assigns animation data from a VRMA (VRM Animation) model to a root entity.
|
|
26
|
-
* This method
|
|
52
|
+
* This method handles humanoid retargeting and expression-weight animation.
|
|
27
53
|
*
|
|
28
54
|
* @param rootEntity - The root entity of the model to which animation will be assigned
|
|
29
55
|
* @param vrmaModel - The VRMA model containing animation data and humanoid bone mappings
|
|
30
56
|
* @param postfixToTrackName - Optional postfix to append to animation track names for identification
|
|
57
|
+
* @param options - Optional root-motion behavior. Existing callers preserve hips translation by default.
|
|
31
58
|
* @returns An array of animation track names that were created
|
|
32
59
|
*/
|
|
33
|
-
assignAnimationWithVrma(rootEntity: ISceneGraphEntity, vrmaModel: RnM2Vrma, postfixToTrackName?: string): string[];
|
|
60
|
+
assignAnimationWithVrma(rootEntity: ISceneGraphEntity, vrmaModel: RnM2Vrma, postfixToTrackName?: string, options?: VrmaAnimationAssignmentOptions): string[];
|
|
61
|
+
/**
|
|
62
|
+
* Retargets the supplied semantic character motions and returns a mapping that can be
|
|
63
|
+
* passed directly to {@link CharacterAnimationController}.
|
|
64
|
+
*
|
|
65
|
+
* Every source track receives a stable semantic suffix, so unnamed or identically named
|
|
66
|
+
* animations in separate VRMA files do not collide. The suffix is scoped to the target root
|
|
67
|
+
* entity so tracks from multiple characters also remain distinct. Each supplied semantic VRMA
|
|
68
|
+
* must create exactly one track; omitted semantics use `CharacterAnimationController` fallback
|
|
69
|
+
* behavior. The default root-motion policy keeps
|
|
70
|
+
* hips translation out of the target skeleton, leaving position and collision resolution to
|
|
71
|
+
* the physics character controller.
|
|
72
|
+
*/
|
|
73
|
+
assignCharacterAnimationsWithVrma(rootEntity: ISceneGraphEntity, vrmaAnimations: CharacterVrmaAnimationSet, options?: CharacterVrmaAnimationAssignmentOptions): CharacterVrmaAnimationAssignmentResult;
|
|
34
74
|
/**
|
|
35
75
|
* Resets animation tracks and restores entities to their rest pose.
|
|
36
76
|
* This method recursively processes all child entities.
|
|
@@ -62,6 +102,25 @@ export declare class AnimationAssigner {
|
|
|
62
102
|
* @returns The corresponding entity in the target skeleton, or undefined if not found
|
|
63
103
|
*/
|
|
64
104
|
private __getCorrespondingEntityWithVrma;
|
|
105
|
+
private __getVrmaHumanoidBoneNameMap;
|
|
106
|
+
private __getVrmaExpressionNamesMap;
|
|
107
|
+
private __setVrmaExpressionAnimation;
|
|
108
|
+
/**
|
|
109
|
+
* Adds zero-valued samplers for expression paths that are absent from some assigned VRMA tracks.
|
|
110
|
+
*
|
|
111
|
+
* Animation track activation is switched across every channel at once. Without a sampler for the
|
|
112
|
+
* newly active track, AnimatedScalar keeps its previous sampler and the previous clip's expression
|
|
113
|
+
* can remain active.
|
|
114
|
+
*/
|
|
115
|
+
private __fillMissingVrmaExpressionTracks;
|
|
116
|
+
private __captureActiveSamplerBindingsByPostfix;
|
|
117
|
+
private __restoreActiveSamplerBindings;
|
|
118
|
+
private __getFirstActiveAnimationTrackName;
|
|
119
|
+
private __findAnimationComponentInHierarchy;
|
|
120
|
+
private __getSecondActiveAnimationTrackName;
|
|
121
|
+
private __getFirstAnimationTrackName;
|
|
122
|
+
private __hasAnimationTrackName;
|
|
123
|
+
private __validateCharacterVrmaAnimationSet;
|
|
65
124
|
/**
|
|
66
125
|
* Determines whether a given node represents the hips bone in the humanoid skeleton.
|
|
67
126
|
* This is used for special handling of hip translation animations.
|