@haiyue/extensions 0.1.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/LICENSE +21 -0
- package/README.md +30 -0
- package/dist/animation/Animation2DComponent.d.ts +46 -0
- package/dist/animation/Animation2DExtensionRegistry.d.ts +27 -0
- package/dist/animation/Animation2DRenderSystem.d.ts +89 -0
- package/dist/animation/Animation2DRuntime.d.ts +99 -0
- package/dist/animation/Animation2DStateMachine.d.ts +13 -0
- package/dist/animation/Animation2DStateMachineComponent.d.ts +54 -0
- package/dist/animation/Animation2DStateMachineRuntime.d.ts +30 -0
- package/dist/animation/Animation2DStateMachineSystem.d.ts +14 -0
- package/dist/animation/Animation2DStateMachineVisualRuntime.d.ts +27 -0
- package/dist/animation/Animation2DSystem.d.ts +14 -0
- package/dist/animation/AnimationAssetLoader.d.ts +9 -0
- package/dist/animation/AnimationAudioClip.d.ts +26 -0
- package/dist/animation/AnimationPathTessellator.d.ts +52 -0
- package/dist/animation/AnimationTextRasterizer.d.ts +21 -0
- package/dist/animation/AnimationVisual2D.d.ts +68 -0
- package/dist/animation/HyaAnimation2DClipAdapter.d.ts +16 -0
- package/dist/animation/Particle2DDescriptorAdapter.d.ts +5 -0
- package/dist/animation/runtime/mixer/Action.d.ts +150 -0
- package/dist/animation/runtime/mixer/Mixer.d.ts +54 -0
- package/dist/animation/runtime/mixer/PoseBuffer.d.ts +23 -0
- package/dist/animation/runtime/mixer/Sampler.d.ts +17 -0
- package/dist/animation/runtime/mixer/Types.d.ts +101 -0
- package/dist/animation/runtime/mixer/index.d.ts +6 -0
- package/dist/animation-state-machine/AnimationStateMachine.d.ts +111 -0
- package/dist/animation-state-machine/AnimationStateMachineChannels.d.ts +23 -0
- package/dist/animation-state-machine/runtime/Animation2DStateMachineMixerAdapter.d.ts +51 -0
- package/dist/animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.d.ts +14 -0
- package/dist/animation-state-machine/runtime/AnimationStateMachineCompiler.d.ts +109 -0
- package/dist/animation-state-machine/runtime/AnimationStateMachineController.d.ts +103 -0
- package/dist/animation-state-machine/runtime/AnimationStateMachineMixerPort.d.ts +35 -0
- package/dist/animation-state-machine/runtime/index.d.ts +7 -0
- package/dist/animation.d.ts +15 -0
- package/dist/animation.js +1171 -0
- package/dist/animation3d/Animation3DAction.d.ts +46 -0
- package/dist/animation3d/Animation3DBinding.d.ts +85 -0
- package/dist/animation3d/Animation3DClip.d.ts +20 -0
- package/dist/animation3d/Animation3DError.d.ts +13 -0
- package/dist/animation3d/Animation3DMixer.d.ts +27 -0
- package/dist/animation3d/Animation3DPose.d.ts +40 -0
- package/dist/animation3d/Animation3DPoseBuffer.d.ts +24 -0
- package/dist/animation3d/Animation3DResource.d.ts +28 -0
- package/dist/animation3d/Animation3DStateMachine.d.ts +95 -0
- package/dist/animation3d/Animation3DStateMachineRuntime.d.ts +70 -0
- package/dist/animation3d/Animation3DTrack.d.ts +19 -0
- package/dist/animation3d/hya/HyaAnimation3DRuntime.d.ts +73 -0
- package/dist/animation3d/hya/HyaAnimation3DStateMachineRuntime.d.ts +65 -0
- package/dist/animation3d/hya/HyaAnimation3DTypes.d.ts +170 -0
- package/dist/animation3d/hya/index.d.ts +4 -0
- package/dist/animation3d/index.d.ts +14 -0
- package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.d.ts +81 -0
- package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.d.ts +39 -0
- package/dist/animation3d/runtime/integration/index.d.ts +2 -0
- package/dist/animation3d/runtime/mixer/Action.d.ts +150 -0
- package/dist/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.d.ts +6 -0
- package/dist/animation3d/runtime/mixer/Mixer.d.ts +59 -0
- package/dist/animation3d/runtime/mixer/PoseBuffer.d.ts +1 -0
- package/dist/animation3d/runtime/mixer/TrackSampler.d.ts +24 -0
- package/dist/animation3d/runtime/mixer/index.d.ts +4 -0
- package/dist/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.d.ts +1 -0
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.d.ts +1 -0
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineController.d.ts +1 -0
- package/dist/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.d.ts +1 -0
- package/dist/animation3d/runtime/state-machine/index.d.ts +6 -0
- package/dist/animation3d.d.ts +5 -0
- package/dist/animation3d.js +1708 -0
- package/dist/benchmark.d.ts +30 -0
- package/dist/benchmark.js +119 -0
- package/dist/canvas-text/CanvasText2DRenderSystem.d.ts +24 -0
- package/dist/canvas-text/CanvasTextComponent.d.ts +18 -0
- package/dist/canvas-text.d.ts +4 -0
- package/dist/canvas-text.js +276 -0
- package/dist/chunks/2d-ui-animation-2d.generated-D4aHzFU2.js +4 -0
- package/dist/chunks/2d-ui-canvas-text-2d.generated-C0Eaej2m.js +4 -0
- package/dist/chunks/2d-ui-spine2d.generated-CUUi8xjl.js +4 -0
- package/dist/chunks/2d-ui-tilemap2d.generated-gebw4mX7.js +4 -0
- package/dist/chunks/Animation2DStateMachine-9IonguNa.js +3245 -0
- package/dist/chunks/AnimationStateMachineController-BIcAh-sT.js +1438 -0
- package/dist/chunks/GltfAnimation3DAdapter-Cu3rQQsW.js +2240 -0
- package/dist/chunks/GltfAnimationRuntime-CRHsLycN.js +631 -0
- package/dist/chunks/RenderSystem2DBase-DDT61dAu.js +227 -0
- package/dist/chunks/Spine2DRuntime-D9M9LAQR.js +3056 -0
- package/dist/chunks/SpineAssetParser-BSDmPge1.js +378 -0
- package/dist/chunks/gltfLoader-Dm22jLYB.js +2085 -0
- package/dist/chunks/pluginUtils-CvwroRMd.js +33 -0
- package/dist/experimental-gltf-worker.d.ts +4 -0
- package/dist/experimental-gltf-worker.js +138 -0
- package/dist/experimental-spine-worker.d.ts +4 -0
- package/dist/experimental-spine-worker.js +110 -0
- package/dist/gltf/GltfAccessorReader.d.ts +7 -0
- package/dist/gltf/GltfAnimation3DAdapter.d.ts +47 -0
- package/dist/gltf/GltfAnimationRuntime.d.ts +10 -0
- package/dist/gltf/GltfAssetWorkerClient.d.ts +20 -0
- package/dist/gltf/GltfCompatibilityReport.d.ts +70 -0
- package/dist/gltf/GltfConservativeBounds.d.ts +18 -0
- package/dist/gltf/GltfDracoDecoder.d.ts +4 -0
- package/dist/gltf/GltfExtensionAdapter.d.ts +54 -0
- package/dist/gltf/GltfLoaderContract.d.ts +249 -0
- package/dist/gltf/GltfLoaderErrors.d.ts +4 -0
- package/dist/gltf/GltfMaterialDescriptor.d.ts +23 -0
- package/dist/gltf/GltfMaterialEncoder.d.ts +20 -0
- package/dist/gltf/GltfMaterialLoader.d.ts +6 -0
- package/dist/gltf/GltfModelComponent.d.ts +72 -0
- package/dist/gltf/GltfModelSystem.d.ts +37 -0
- package/dist/gltf/GltfPlugin.d.ts +6 -0
- package/dist/gltf/GltfSchema.d.ts +225 -0
- package/dist/gltf/GltfUvSemanticPlanner.d.ts +33 -0
- package/dist/gltf/gltfLoader.d.ts +9 -0
- package/dist/gltf-animation3d.d.ts +3 -0
- package/dist/gltf-animation3d.js +8 -0
- package/dist/gltf-worker-runtime.d.ts +7 -0
- package/dist/gltf-worker-runtime.js +6981 -0
- package/dist/gltf.d.ts +12 -0
- package/dist/gltf.js +517 -0
- package/dist/grid/Grid2DComponent.d.ts +25 -0
- package/dist/grid.d.ts +2 -0
- package/dist/grid.js +56 -0
- package/dist/hya-state-machine.d.ts +7 -0
- package/dist/hya-state-machine.js +2934 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +7 -0
- package/dist/internal/2d-ui-shader-artifact.js +870 -0
- package/dist/plugins/pluginUtils.d.ts +20 -0
- package/dist/plugins.d.ts +6 -0
- package/dist/shaders/generated/2d-ui-artifact.generated.d.ts +658 -0
- package/dist/spine/Spine2DComponent.d.ts +116 -0
- package/dist/spine/Spine2DGpuRenderer.d.ts +65 -0
- package/dist/spine/Spine2DRenderSystem.d.ts +27 -0
- package/dist/spine/Spine2DRuntime.d.ts +103 -0
- package/dist/spine/SpineAnimationBoneTimelines.d.ts +8 -0
- package/dist/spine/SpineAssetParser.d.ts +18 -0
- package/dist/spine/SpineAssetWorkerClient.d.ts +19 -0
- package/dist/spine/SpineAssetWorkerContract.d.ts +6 -0
- package/dist/spine/SpineAtlasParser.d.ts +21 -0
- package/dist/spine/SpineFloatBuilder.d.ts +15 -0
- package/dist/spine/SpinePathConstraintSolver.d.ts +32 -0
- package/dist/spine/SpinePlugin.d.ts +8 -0
- package/dist/spine/SpineSkeletonRuntime.d.ts +185 -0
- package/dist/spine/SpineSlotAnimation.d.ts +17 -0
- package/dist/spine/SpineTimelineRuntime.d.ts +25 -0
- package/dist/spine/SpineVertexBuilder.d.ts +61 -0
- package/dist/spine.d.ts +7 -0
- package/dist/spine.js +578 -0
- package/dist/tilemap/Tilemap2DComponent.d.ts +110 -0
- package/dist/tilemap/Tilemap2DRenderSystem.d.ts +11 -0
- package/dist/tilemap/Tilemap2DRenderer.d.ts +24 -0
- package/dist/tilemap/TilemapPlugin.d.ts +8 -0
- package/dist/tilemap.d.ts +6 -0
- package/dist/tilemap.js +535 -0
- package/dist/tween/Tween2DComponent.d.ts +70 -0
- package/dist/tween/Tween2DSystem.d.ts +12 -0
- package/dist/tween.d.ts +4 -0
- package/dist/tween.js +138 -0
- package/dist/utils/RenderSystem2DBase.d.ts +42 -0
- package/dist/utils/arrayAccess.d.ts +4 -0
- package/dist/utils/camera2d.d.ts +12 -0
- package/dist/utils/render2dGpu.d.ts +32 -0
- package/package.json +124 -0
- package/src/animation/Animation2DComponent.ts +135 -0
- package/src/animation/Animation2DExtensionRegistry.ts +52 -0
- package/src/animation/Animation2DRenderSystem.ts +1026 -0
- package/src/animation/Animation2DRuntime.ts +1326 -0
- package/src/animation/Animation2DStateMachine.ts +39 -0
- package/src/animation/Animation2DStateMachineComponent.ts +228 -0
- package/src/animation/Animation2DStateMachineRuntime.ts +141 -0
- package/src/animation/Animation2DStateMachineSystem.ts +60 -0
- package/src/animation/Animation2DStateMachineVisualRuntime.ts +282 -0
- package/src/animation/Animation2DSystem.ts +72 -0
- package/src/animation/AnimationAssetLoader.ts +84 -0
- package/src/animation/AnimationAudioClip.ts +140 -0
- package/src/animation/AnimationPathTessellator.ts +691 -0
- package/src/animation/AnimationTextRasterizer.ts +340 -0
- package/src/animation/AnimationVisual2D.ts +153 -0
- package/src/animation/HyaAnimation2DClipAdapter.ts +845 -0
- package/src/animation/Particle2DDescriptorAdapter.ts +35 -0
- package/src/animation/runtime/mixer/Action.ts +876 -0
- package/src/animation/runtime/mixer/Mixer.ts +505 -0
- package/src/animation/runtime/mixer/PoseBuffer.ts +105 -0
- package/src/animation/runtime/mixer/Sampler.ts +252 -0
- package/src/animation/runtime/mixer/Types.ts +138 -0
- package/src/animation/runtime/mixer/index.ts +31 -0
- package/src/animation-state-machine/AnimationStateMachine.ts +146 -0
- package/src/animation-state-machine/AnimationStateMachineChannels.ts +116 -0
- package/src/animation-state-machine/runtime/Animation2DStateMachineMixerAdapter.ts +197 -0
- package/src/animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.ts +503 -0
- package/src/animation-state-machine/runtime/AnimationStateMachineCompiler.ts +763 -0
- package/src/animation-state-machine/runtime/AnimationStateMachineController.ts +987 -0
- package/src/animation-state-machine/runtime/AnimationStateMachineMixerPort.ts +54 -0
- package/src/animation-state-machine/runtime/index.ts +47 -0
- package/src/animation.ts +33 -0
- package/src/animation3d/Animation3DAction.ts +73 -0
- package/src/animation3d/Animation3DBinding.ts +116 -0
- package/src/animation3d/Animation3DClip.ts +22 -0
- package/src/animation3d/Animation3DError.ts +34 -0
- package/src/animation3d/Animation3DMixer.ts +82 -0
- package/src/animation3d/Animation3DPose.ts +100 -0
- package/src/animation3d/Animation3DPoseBuffer.ts +85 -0
- package/src/animation3d/Animation3DResource.ts +49 -0
- package/src/animation3d/Animation3DStateMachine.ts +126 -0
- package/src/animation3d/Animation3DStateMachineRuntime.ts +191 -0
- package/src/animation3d/Animation3DTrack.ts +29 -0
- package/src/animation3d/hya/HyaAnimation3DRuntime.ts +756 -0
- package/src/animation3d/hya/HyaAnimation3DStateMachineRuntime.ts +618 -0
- package/src/animation3d/hya/HyaAnimation3DTypes.ts +168 -0
- package/src/animation3d/hya/index.ts +10 -0
- package/src/animation3d/index.ts +76 -0
- package/src/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.ts +325 -0
- package/src/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.ts +158 -0
- package/src/animation3d/runtime/integration/index.ts +9 -0
- package/src/animation3d/runtime/mixer/Action.ts +833 -0
- package/src/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.ts +26 -0
- package/src/animation3d/runtime/mixer/Mixer.ts +562 -0
- package/src/animation3d/runtime/mixer/PoseBuffer.ts +1 -0
- package/src/animation3d/runtime/mixer/TrackSampler.ts +399 -0
- package/src/animation3d/runtime/mixer/index.ts +8 -0
- package/src/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.ts +4 -0
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.ts +1 -0
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineController.ts +1 -0
- package/src/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.ts +1 -0
- package/src/animation3d/runtime/state-machine/index.ts +45 -0
- package/src/animation3d.ts +5 -0
- package/src/benchmark.ts +168 -0
- package/src/canvas-text/CanvasText2DRenderSystem.ts +292 -0
- package/src/canvas-text/CanvasTextComponent.ts +47 -0
- package/src/canvas-text.ts +4 -0
- package/src/experimental-gltf-worker.ts +18 -0
- package/src/experimental-spine-worker.ts +9 -0
- package/src/gltf/GltfAccessorReader.ts +271 -0
- package/src/gltf/GltfAnimation3DAdapter.ts +680 -0
- package/src/gltf/GltfAnimationRuntime.ts +392 -0
- package/src/gltf/GltfAssetWorkerClient.ts +136 -0
- package/src/gltf/GltfCompatibilityReport.ts +214 -0
- package/src/gltf/GltfConservativeBounds.ts +219 -0
- package/src/gltf/GltfDracoDecoder.ts +251 -0
- package/src/gltf/GltfExtensionAdapter.ts +340 -0
- package/src/gltf/GltfLoaderContract.ts +333 -0
- package/src/gltf/GltfLoaderErrors.ts +59 -0
- package/src/gltf/GltfMaterialDescriptor.ts +134 -0
- package/src/gltf/GltfMaterialEncoder.ts +173 -0
- package/src/gltf/GltfMaterialLoader.ts +293 -0
- package/src/gltf/GltfModelComponent.ts +115 -0
- package/src/gltf/GltfModelSystem.ts +208 -0
- package/src/gltf/GltfPlugin.ts +84 -0
- package/src/gltf/GltfSchema.ts +229 -0
- package/src/gltf/GltfUvSemanticPlanner.ts +166 -0
- package/src/gltf/gltfLoader.ts +910 -0
- package/src/gltf-animation3d.ts +10 -0
- package/src/gltf-worker-runtime.ts +10 -0
- package/src/gltf.ts +56 -0
- package/src/grid/Grid2DComponent.ts +69 -0
- package/src/grid.ts +2 -0
- package/src/hya-state-machine.ts +19 -0
- package/src/index.ts +2 -0
- package/src/plugins/pluginUtils.ts +50 -0
- package/src/plugins.ts +6 -0
- package/src/shaders/generated/2d-ui-animation-2d.generated.wgsl +242 -0
- package/src/shaders/generated/2d-ui-artifact.generated.ts +867 -0
- package/src/shaders/generated/2d-ui-canvas-text-2d.generated.wgsl +38 -0
- package/src/shaders/generated/2d-ui-spine2d.generated.wgsl +41 -0
- package/src/shaders/generated/2d-ui-tilemap2d.generated.wgsl +36 -0
- package/src/spine/Spine2DComponent.ts +168 -0
- package/src/spine/Spine2DGpuRenderer.ts +449 -0
- package/src/spine/Spine2DRenderSystem.ts +199 -0
- package/src/spine/Spine2DRuntime.ts +1529 -0
- package/src/spine/SpineAnimationBoneTimelines.ts +30 -0
- package/src/spine/SpineAssetParser.ts +20 -0
- package/src/spine/SpineAssetWorkerClient.ts +112 -0
- package/src/spine/SpineAssetWorkerContract.ts +4 -0
- package/src/spine/SpineAtlasParser.ts +127 -0
- package/src/spine/SpineFloatBuilder.ts +66 -0
- package/src/spine/SpinePathConstraintSolver.ts +582 -0
- package/src/spine/SpinePlugin.ts +76 -0
- package/src/spine/SpineSkeletonRuntime.ts +521 -0
- package/src/spine/SpineSlotAnimation.ts +195 -0
- package/src/spine/SpineTimelineRuntime.ts +453 -0
- package/src/spine/SpineVertexBuilder.ts +686 -0
- package/src/spine.ts +7 -0
- package/src/tilemap/Tilemap2DComponent.ts +232 -0
- package/src/tilemap/Tilemap2DRenderSystem.ts +58 -0
- package/src/tilemap/Tilemap2DRenderer.ts +289 -0
- package/src/tilemap/TilemapPlugin.ts +75 -0
- package/src/tilemap.ts +6 -0
- package/src/tween/Tween2DComponent.ts +83 -0
- package/src/tween/Tween2DSystem.ts +78 -0
- package/src/tween.ts +4 -0
- package/src/types/earcut.d.ts +7 -0
- package/src/types/wgsl.d.ts +4 -0
- package/src/utils/RenderSystem2DBase.ts +164 -0
- package/src/utils/arrayAccess.ts +17 -0
- package/src/utils/camera2d.ts +68 -0
- package/src/utils/render2dGpu.ts +132 -0
- package/test/fixtures/gltf/animation-characterization.gltf +344 -0
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
import type { Scene } from '@haiyue/engine';
|
|
2
|
+
import type { ParticleEmitter3DOptions } from '@haiyue/engine/components';
|
|
3
|
+
import type { PbrMaterial } from '@haiyue/engine/material';
|
|
4
|
+
import type { LoadedGltfModel, LoadGltfOptions } from '../../gltf/GltfLoaderContract';
|
|
5
|
+
import type { Animation3DActionOptions } from '../Animation3DAction';
|
|
6
|
+
import type { Animation3DBinding } from '../Animation3DBinding';
|
|
7
|
+
import type { Animation3DEvent } from '../Animation3DClip';
|
|
8
|
+
import type { Animation3DStateMachineDefinition } from '../Animation3DStateMachine';
|
|
9
|
+
export interface HyaAnimation3DResource {
|
|
10
|
+
readonly id: string;
|
|
11
|
+
readonly type: 'image' | 'audio' | 'binary';
|
|
12
|
+
readonly uri: string;
|
|
13
|
+
readonly mimeType?: string;
|
|
14
|
+
readonly integrity?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface HyaAnimation3DMaterialDescriptor {
|
|
17
|
+
readonly id: string;
|
|
18
|
+
readonly name: string;
|
|
19
|
+
readonly baseColorFactor: readonly [number, number, number, number];
|
|
20
|
+
readonly metallicFactor: number;
|
|
21
|
+
readonly roughnessFactor: number;
|
|
22
|
+
readonly emissiveFactor: readonly [number, number, number];
|
|
23
|
+
readonly alphaMode: 'opaque' | 'mask' | 'blend';
|
|
24
|
+
readonly alphaCutoff?: number;
|
|
25
|
+
readonly doubleSided: boolean;
|
|
26
|
+
readonly baseColorTexture?: string;
|
|
27
|
+
readonly normalTexture?: string;
|
|
28
|
+
readonly metallicRoughnessTexture?: string;
|
|
29
|
+
readonly emissiveTexture?: string;
|
|
30
|
+
}
|
|
31
|
+
export interface HyaAnimation3DTransformDescriptor {
|
|
32
|
+
readonly translation: readonly [number, number, number];
|
|
33
|
+
readonly rotation: readonly [number, number, number, number];
|
|
34
|
+
readonly scale: readonly [number, number, number];
|
|
35
|
+
}
|
|
36
|
+
export type HyaAnimation3DCameraProjection = Readonly<{
|
|
37
|
+
kind: 'perspective';
|
|
38
|
+
fovYRadians: number;
|
|
39
|
+
near: number;
|
|
40
|
+
far: number;
|
|
41
|
+
}> | Readonly<{
|
|
42
|
+
kind: 'orthographic';
|
|
43
|
+
orthoHeight: number;
|
|
44
|
+
near: number;
|
|
45
|
+
far: number;
|
|
46
|
+
}>;
|
|
47
|
+
export type HyaAnimation3DComponentDescriptor = Readonly<{
|
|
48
|
+
id: string;
|
|
49
|
+
kind: 'camera3d';
|
|
50
|
+
projection: HyaAnimation3DCameraProjection;
|
|
51
|
+
}> | Readonly<{
|
|
52
|
+
id: string;
|
|
53
|
+
kind: 'primitive3d';
|
|
54
|
+
primitive: 'box' | 'sphere' | 'plane' | 'cylinder' | 'cone';
|
|
55
|
+
materialId: string;
|
|
56
|
+
}> | Readonly<{
|
|
57
|
+
id: string;
|
|
58
|
+
kind: 'model3d';
|
|
59
|
+
resource: string;
|
|
60
|
+
materialOverrides?: readonly Readonly<{
|
|
61
|
+
slot: string;
|
|
62
|
+
materialId: string;
|
|
63
|
+
}>[];
|
|
64
|
+
}> | Readonly<{
|
|
65
|
+
id: string;
|
|
66
|
+
kind: 'particle3d';
|
|
67
|
+
descriptor: ParticleEmitter3DOptions & Readonly<{
|
|
68
|
+
textureResource?: string;
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
export interface HyaAnimation3DNodeDescriptor {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly name: string;
|
|
74
|
+
readonly parent?: string;
|
|
75
|
+
readonly start?: number;
|
|
76
|
+
readonly duration?: number;
|
|
77
|
+
readonly transform: HyaAnimation3DTransformDescriptor;
|
|
78
|
+
readonly components: readonly HyaAnimation3DComponentDescriptor[];
|
|
79
|
+
}
|
|
80
|
+
export interface HyaAnimation3DClipDescriptor {
|
|
81
|
+
readonly format: 'haiyue-animation3d-clip@1';
|
|
82
|
+
readonly id: string;
|
|
83
|
+
readonly name: string;
|
|
84
|
+
readonly duration: number;
|
|
85
|
+
readonly tracks: readonly Readonly<{
|
|
86
|
+
id: string;
|
|
87
|
+
binding: Animation3DBinding;
|
|
88
|
+
interpolation: 'step' | 'linear' | 'cubic-spline';
|
|
89
|
+
times: ArrayLike<number>;
|
|
90
|
+
values: ArrayLike<number>;
|
|
91
|
+
}>[];
|
|
92
|
+
readonly events: readonly Animation3DEvent[];
|
|
93
|
+
}
|
|
94
|
+
/** Runtime port implemented by the validated animation-spec payload. */
|
|
95
|
+
export interface HyaAnimation3DPayload {
|
|
96
|
+
readonly format: 'haiyue-animation-3d@1';
|
|
97
|
+
readonly mode: 'native-3d';
|
|
98
|
+
readonly viewport: Readonly<{
|
|
99
|
+
width: number;
|
|
100
|
+
height: number;
|
|
101
|
+
}>;
|
|
102
|
+
readonly materials: readonly HyaAnimation3DMaterialDescriptor[];
|
|
103
|
+
readonly nodes: readonly HyaAnimation3DNodeDescriptor[];
|
|
104
|
+
readonly clips: readonly HyaAnimation3DClipDescriptor[];
|
|
105
|
+
readonly stateMachine?: Animation3DStateMachineDefinition | null;
|
|
106
|
+
}
|
|
107
|
+
export interface HyaAnimation3DRuntimeOptions {
|
|
108
|
+
readonly scene: Scene;
|
|
109
|
+
/** Payload returned by animation-spec native3d validation. */
|
|
110
|
+
readonly payload: HyaAnimation3DPayload;
|
|
111
|
+
readonly resources: readonly HyaAnimation3DResource[];
|
|
112
|
+
readonly signal?: AbortSignal;
|
|
113
|
+
readonly useAuthoredCamera?: boolean;
|
|
114
|
+
readonly addPreviewLights?: boolean;
|
|
115
|
+
readonly loadModel?: (uri: string, options: LoadGltfOptions) => Promise<LoadedGltfModel>;
|
|
116
|
+
readonly disposeModel?: (model: LoadedGltfModel) => void;
|
|
117
|
+
readonly resolveTexture?: (resource: HyaAnimation3DResource, material: PbrMaterial | null) => ParticleEmitter3DOptions['textureSource'] | null;
|
|
118
|
+
}
|
|
119
|
+
export interface HyaAnimation3DPlayOptions extends Animation3DActionOptions {
|
|
120
|
+
readonly fadeFrom?: HyaAnimation3DActionGroup;
|
|
121
|
+
readonly fadeDuration?: number;
|
|
122
|
+
readonly warp?: boolean;
|
|
123
|
+
}
|
|
124
|
+
export interface HyaAnimation3DActionGroup {
|
|
125
|
+
readonly id: string;
|
|
126
|
+
readonly clipId: string;
|
|
127
|
+
readonly actionCount: number;
|
|
128
|
+
readonly playing: boolean;
|
|
129
|
+
play(): this;
|
|
130
|
+
stop(): this;
|
|
131
|
+
reset(): this;
|
|
132
|
+
}
|
|
133
|
+
export interface HyaAnimation3DRuntimeDiagnostics {
|
|
134
|
+
readonly state: 'active' | 'destroyed';
|
|
135
|
+
readonly entityCount: number;
|
|
136
|
+
readonly materialCount: number;
|
|
137
|
+
readonly modelCount: number;
|
|
138
|
+
readonly actionGroupCount: number;
|
|
139
|
+
readonly ownerResidualCount: number;
|
|
140
|
+
}
|
|
141
|
+
export interface HyaAnimation3DStateMachineLayerSnapshot {
|
|
142
|
+
readonly layerId: string;
|
|
143
|
+
readonly currentStateId: string;
|
|
144
|
+
readonly currentTime: number;
|
|
145
|
+
readonly transitionId: string | null;
|
|
146
|
+
readonly sourceStateId: string | null;
|
|
147
|
+
readonly destinationStateId: string | null;
|
|
148
|
+
readonly transitionProgress: number;
|
|
149
|
+
}
|
|
150
|
+
/** Stable parameter/query port for the runtime's unique state-machine clock. */
|
|
151
|
+
export interface HyaAnimation3DStateMachineController {
|
|
152
|
+
readonly status: 'active' | 'destroyed';
|
|
153
|
+
readonly layerSnapshots: readonly HyaAnimation3DStateMachineLayerSnapshot[];
|
|
154
|
+
getLayerSnapshot(layerId: string): HyaAnimation3DStateMachineLayerSnapshot;
|
|
155
|
+
setFloat(name: string, value: number): this;
|
|
156
|
+
setInteger(name: string, value: number): this;
|
|
157
|
+
setBoolean(name: string, value: boolean): this;
|
|
158
|
+
setTrigger(name: string): this;
|
|
159
|
+
resetTrigger(name: string): this;
|
|
160
|
+
getParameter(name: string): number | boolean;
|
|
161
|
+
}
|
|
162
|
+
/** Stable lifecycle and diagnostic view of the HYA state-machine owner. */
|
|
163
|
+
export interface HyaAnimation3DStateMachineRuntimeControl {
|
|
164
|
+
readonly controller: HyaAnimation3DStateMachineController;
|
|
165
|
+
readonly time: number;
|
|
166
|
+
readonly liveActionCount: number;
|
|
167
|
+
readonly liveBindingCount: number;
|
|
168
|
+
readonly sideEffectOwnerCount: number;
|
|
169
|
+
reset(): void;
|
|
170
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { HyaAnimation3DRuntime, createHyaAnimation3DRuntime } from './HyaAnimation3DRuntime';
|
|
2
|
+
export { HyaAnimation3DStateMachineRuntime, } from './HyaAnimation3DStateMachineRuntime';
|
|
3
|
+
export type { HyaAnimation3DParticleCue, HyaAnimation3DStateMachinePartition, HyaAnimation3DStateMachineRuntimeOptions, } from './HyaAnimation3DStateMachineRuntime';
|
|
4
|
+
export type * from './HyaAnimation3DTypes';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type { Animation3DBinding, Animation3DBindingMask, Animation3DBindingResolver, Animation3DBindingTarget, Animation3DFixedValueSize, Animation3DFixedValueType, Animation3DMorphWeightsBinding, Animation3DPropertyBinding, Animation3DResolvedBinding, Animation3DRotationBinding, Animation3DScaleBinding, Animation3DTranslationBinding, Animation3DValueType, } from './Animation3DBinding.js';
|
|
2
|
+
export type { Animation3DInterpolation, Animation3DTrack, Animation3DTrackFor, } from './Animation3DTrack.js';
|
|
3
|
+
export type { Animation3DClip, Animation3DEvent, } from './Animation3DClip.js';
|
|
4
|
+
export type { Animation3DMutablePose, Animation3DPose, Animation3DPoseChannel, Animation3DPoseEvent, } from './Animation3DPose.js';
|
|
5
|
+
export { Animation3DPoseApplier } from './Animation3DPose.js';
|
|
6
|
+
export { Animation3DPoseBuffer } from './Animation3DPoseBuffer.js';
|
|
7
|
+
export type { Animation3DAction, Animation3DActionOptions, Animation3DActionStatus, Animation3DBlendMode, Animation3DLoopMode, } from './Animation3DAction.js';
|
|
8
|
+
export { Animation3DMixer } from './Animation3DMixer.js';
|
|
9
|
+
export type { Animation3DMixerState } from './Animation3DMixer.js';
|
|
10
|
+
export { Animation3DError } from './Animation3DError.js';
|
|
11
|
+
export type { Animation3DErrorCode, Animation3DErrorDetails, } from './Animation3DError.js';
|
|
12
|
+
export type { Animation3DBlend1DChild, Animation3DBlend1DMotion, Animation3DBlend2DChild, Animation3DBlend2DMotion, Animation3DClipMotion, Animation3DMotionDefinition, Animation3DParameterDefinition, Animation3DStateDefinition, Animation3DStateMachineDefinition, Animation3DStateMachineLayer, Animation3DTransitionCondition, Animation3DTransitionDefinition, Animation3DTransitionInterruption, } from './Animation3DStateMachine.js';
|
|
13
|
+
export { Animation3DStateMachineController, Animation3DStateMachineValidationError, compileAnimation3DStateMachineDefinition, validateAnimation3DStateMachineDefinition, } from './Animation3DStateMachineRuntime.js';
|
|
14
|
+
export type { Animation3DCompiledStateMachine, Animation3DStateMachineClipResolver, Animation3DStateMachineControllerOptions, Animation3DStateMachineControllerStatus, Animation3DStateMachineLayerSnapshot, Animation3DStateMachineValidationCode, Animation3DStateMachineValidationIssue, } from './Animation3DStateMachineRuntime.js';
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { Animation3DClip } from '../../Animation3DClip.js';
|
|
2
|
+
import type { Animation3DMutablePose } from '../../Animation3DPose.js';
|
|
3
|
+
import type { AnimationStateMachineActionOptions, AnimationStateMachineMixerPort } from '../../../animation-state-machine/runtime/AnimationStateMachineMixerPort.js';
|
|
4
|
+
import { Animation3DActionRuntime } from '../mixer/Action.js';
|
|
5
|
+
import { Animation3DMixerRuntime } from '../mixer/Mixer.js';
|
|
6
|
+
/**
|
|
7
|
+
* Resolves the serializable clip ids stored in state-machine definitions.
|
|
8
|
+
* Returned clips remain resolver/caller-owned.
|
|
9
|
+
*/
|
|
10
|
+
export interface Animation3DStateMachineClipResolver {
|
|
11
|
+
resolve(clipId: string): Animation3DClip | null;
|
|
12
|
+
}
|
|
13
|
+
export declare class Animation3DStateMachineActionRuntimeHandle {
|
|
14
|
+
readonly duration: number;
|
|
15
|
+
readonly clipId: string;
|
|
16
|
+
readonly layerId: string;
|
|
17
|
+
readonly stateId: string;
|
|
18
|
+
readonly action: Animation3DActionRuntime;
|
|
19
|
+
targetTime: number;
|
|
20
|
+
appliedTime: number;
|
|
21
|
+
playing: boolean;
|
|
22
|
+
destroyed: boolean;
|
|
23
|
+
pendingDestroy: boolean;
|
|
24
|
+
private readonly _actionCheckpoint;
|
|
25
|
+
private _checkpointTargetTime;
|
|
26
|
+
private _checkpointAppliedTime;
|
|
27
|
+
private _checkpointPlaying;
|
|
28
|
+
constructor(clipId: string, options: AnimationStateMachineActionOptions, action: Animation3DActionRuntime);
|
|
29
|
+
captureTransactionState(): void;
|
|
30
|
+
restoreTransactionState(): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Adapts the dimension-neutral state-machine port to the real 3D mixer.
|
|
34
|
+
*
|
|
35
|
+
* The controller owns every action playhead. The adapter applies its absolute
|
|
36
|
+
* times to actions while a synchronized mixer frame is open; it never calls
|
|
37
|
+
* mixer.update(), so the mixer clock cannot advance the same actions again.
|
|
38
|
+
*/
|
|
39
|
+
export declare class Animation3DStateMachineMixerAdapter implements AnimationStateMachineMixerPort<Animation3DStateMachineActionRuntimeHandle> {
|
|
40
|
+
readonly mixer: Animation3DMixerRuntime;
|
|
41
|
+
readonly clipResolver: Animation3DStateMachineClipResolver;
|
|
42
|
+
private readonly _handles;
|
|
43
|
+
private readonly _transactionHandles;
|
|
44
|
+
private readonly _transactionCreated;
|
|
45
|
+
private readonly _transactionPendingDestroy;
|
|
46
|
+
private readonly _actionIdPrefix;
|
|
47
|
+
private _nextActionId;
|
|
48
|
+
private _transactionNextActionId;
|
|
49
|
+
private _frameOut;
|
|
50
|
+
private _controllerTransactionActive;
|
|
51
|
+
private _destroyed;
|
|
52
|
+
constructor(mixer: Animation3DMixerRuntime, clipResolver: Animation3DStateMachineClipResolver);
|
|
53
|
+
get liveActionCount(): number;
|
|
54
|
+
createAction(clipId: string, options: AnimationStateMachineActionOptions): Animation3DStateMachineActionRuntimeHandle;
|
|
55
|
+
play(action: Animation3DStateMachineActionRuntimeHandle): void;
|
|
56
|
+
stop(action: Animation3DStateMachineActionRuntimeHandle): void;
|
|
57
|
+
fade(action: Animation3DStateMachineActionRuntimeHandle, _targetWeight: number, _durationSeconds: number): void;
|
|
58
|
+
setWeight(action: Animation3DStateMachineActionRuntimeHandle, weight: number): void;
|
|
59
|
+
setTime(action: Animation3DStateMachineActionRuntimeHandle, timeSeconds: number): void;
|
|
60
|
+
setTimeScale(action: Animation3DStateMachineActionRuntimeHandle, timeScale: number): void;
|
|
61
|
+
destroyAction(action: Animation3DStateMachineActionRuntimeHandle): void;
|
|
62
|
+
/** @internal Called by the shared controller transaction boundary. */
|
|
63
|
+
beginControllerTransaction(): void;
|
|
64
|
+
/** @internal Makes deferred action destruction observable atomically. */
|
|
65
|
+
commitControllerTransaction(): void;
|
|
66
|
+
/** @internal Removes new actions and restores exact event/playhead state. */
|
|
67
|
+
rollbackControllerTransaction(): void;
|
|
68
|
+
beginFrame(out: Animation3DMutablePose): void;
|
|
69
|
+
endFrame(out: Animation3DMutablePose): void;
|
|
70
|
+
cancelFrame(out: Animation3DMutablePose): void;
|
|
71
|
+
/**
|
|
72
|
+
* Releases adapter-created actions only. The mixer, clips, and clip resolver
|
|
73
|
+
* are externally owned and are never destroyed by this adapter.
|
|
74
|
+
*/
|
|
75
|
+
destroy(): void;
|
|
76
|
+
private _applyTime;
|
|
77
|
+
private _destroyHandleNow;
|
|
78
|
+
private _clearControllerTransaction;
|
|
79
|
+
private _requireActive;
|
|
80
|
+
private _requireHandle;
|
|
81
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Animation3DMutablePose, Animation3DPose } from '../../Animation3DPose.js';
|
|
2
|
+
import { Animation3DStateMachineController, type Animation3DStateMachineControllerOptions } from '../state-machine/Animation3DStateMachineController.js';
|
|
3
|
+
import type { CompiledAnimation3DStateMachine } from '../state-machine/Animation3DStateMachineCompiler.js';
|
|
4
|
+
import { Animation3DMixerRuntime } from '../mixer/Mixer.js';
|
|
5
|
+
import { Animation3DStateMachineMixerAdapter, type Animation3DStateMachineActionRuntimeHandle, type Animation3DStateMachineClipResolver } from './Animation3DStateMachineMixerAdapter.js';
|
|
6
|
+
export type Animation3DStateMachineMixerIntegrationState = 'active' | 'destroyed';
|
|
7
|
+
/**
|
|
8
|
+
* Closed-loop runtime for a compiled state machine and the real 3D mixer.
|
|
9
|
+
*
|
|
10
|
+
* The state-machine controller is the unique playback-clock owner. A frame
|
|
11
|
+
* advances the controller once, synchronizes absolute action playheads, then
|
|
12
|
+
* asks the mixer to evaluate without advancing any action time.
|
|
13
|
+
*/
|
|
14
|
+
export declare class Animation3DStateMachineMixerIntegration {
|
|
15
|
+
readonly mixer: Animation3DMixerRuntime;
|
|
16
|
+
readonly adapter: Animation3DStateMachineMixerAdapter;
|
|
17
|
+
readonly controller: Animation3DStateMachineController<Animation3DStateMachineActionRuntimeHandle>;
|
|
18
|
+
private _state;
|
|
19
|
+
private _time;
|
|
20
|
+
private _transactionOut;
|
|
21
|
+
private readonly _beginControllerUpdate;
|
|
22
|
+
private readonly _completeControllerUpdate;
|
|
23
|
+
constructor(compiled: CompiledAnimation3DStateMachine, mixer: Animation3DMixerRuntime, clipResolver: Animation3DStateMachineClipResolver, controllerOptions?: Animation3DStateMachineControllerOptions);
|
|
24
|
+
get state(): Animation3DStateMachineMixerIntegrationState;
|
|
25
|
+
get time(): number;
|
|
26
|
+
update(deltaSeconds: number, out: Animation3DMutablePose): Animation3DPose;
|
|
27
|
+
/**
|
|
28
|
+
* Re-evaluates the current controller-owned time without advancing it.
|
|
29
|
+
*/
|
|
30
|
+
evaluate(out: Animation3DMutablePose): Animation3DPose;
|
|
31
|
+
reset(out: Animation3DMutablePose): Animation3DPose;
|
|
32
|
+
/**
|
|
33
|
+
* Stops and removes every controller action. External mixer/clip resources
|
|
34
|
+
* remain caller-owned. Repeated calls are safe.
|
|
35
|
+
*/
|
|
36
|
+
destroy(): void;
|
|
37
|
+
private _requireActive;
|
|
38
|
+
private _requireTransactionOut;
|
|
39
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export { Animation3DStateMachineActionRuntimeHandle, Animation3DStateMachineMixerAdapter, type Animation3DStateMachineClipResolver, } from './Animation3DStateMachineMixerAdapter.js';
|
|
2
|
+
export { Animation3DStateMachineMixerIntegration, type Animation3DStateMachineMixerIntegrationState, } from './Animation3DStateMachineMixerIntegration.js';
|
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
import type { Animation3DBinding, Animation3DBindingMask } from '../../Animation3DBinding.js';
|
|
2
|
+
import type { Animation3DAction, Animation3DActionOptions, Animation3DActionStatus, Animation3DBlendMode, Animation3DLoopMode } from '../../Animation3DAction.js';
|
|
3
|
+
import type { Animation3DClip } from '../../Animation3DClip.js';
|
|
4
|
+
import type { Animation3DMutablePose } from '../../Animation3DPose.js';
|
|
5
|
+
import type { Animation3DTrack } from '../../Animation3DTrack.js';
|
|
6
|
+
import { Animation3DTrackSampler } from './TrackSampler.js';
|
|
7
|
+
export interface Animation3DActionOwner {
|
|
8
|
+
readonly time: number;
|
|
9
|
+
assertActive(): void;
|
|
10
|
+
}
|
|
11
|
+
export interface Animation3DActionTrackRuntime {
|
|
12
|
+
readonly track: Animation3DTrack;
|
|
13
|
+
readonly sampler: Animation3DTrackSampler;
|
|
14
|
+
readonly reference: Float32Array;
|
|
15
|
+
}
|
|
16
|
+
/** @internal Reusable exact state used by controller-owned frame transactions. */
|
|
17
|
+
export interface Animation3DActionSynchronizedState {
|
|
18
|
+
status: Animation3DActionStatus;
|
|
19
|
+
enabled: boolean;
|
|
20
|
+
paused: boolean;
|
|
21
|
+
time: number;
|
|
22
|
+
rawTime: number;
|
|
23
|
+
timeScale: number;
|
|
24
|
+
weight: number;
|
|
25
|
+
loop: Animation3DLoopMode;
|
|
26
|
+
repetitions: number;
|
|
27
|
+
clampWhenFinished: boolean;
|
|
28
|
+
blendMode: Animation3DBlendMode;
|
|
29
|
+
mask: Animation3DBindingMask | null;
|
|
30
|
+
startTime: number | null;
|
|
31
|
+
eventsStarted: boolean;
|
|
32
|
+
fadeActive: boolean;
|
|
33
|
+
fadeStart: number;
|
|
34
|
+
fadeEnd: number;
|
|
35
|
+
fadeFrom: number;
|
|
36
|
+
fadeTo: number;
|
|
37
|
+
fadeValue: number;
|
|
38
|
+
warpActive: boolean;
|
|
39
|
+
warpStart: number;
|
|
40
|
+
warpEnd: number;
|
|
41
|
+
warpFrom: number;
|
|
42
|
+
warpTo: number;
|
|
43
|
+
warpValue: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Mutable mixer-owned playback state for one immutable clip.
|
|
47
|
+
*/
|
|
48
|
+
export declare class Animation3DActionRuntime implements Animation3DAction {
|
|
49
|
+
readonly id: string;
|
|
50
|
+
readonly clip: Animation3DClip;
|
|
51
|
+
readonly runtimeTracks: readonly Animation3DActionTrackRuntime[];
|
|
52
|
+
private readonly _owner;
|
|
53
|
+
private readonly _runtimeEvents;
|
|
54
|
+
private _valid;
|
|
55
|
+
private _status;
|
|
56
|
+
private _enabled;
|
|
57
|
+
private _paused;
|
|
58
|
+
private _time;
|
|
59
|
+
private _rawTime;
|
|
60
|
+
private _timeScale;
|
|
61
|
+
private _weight;
|
|
62
|
+
private _loop;
|
|
63
|
+
private _repetitions;
|
|
64
|
+
private _clampWhenFinished;
|
|
65
|
+
private _blendMode;
|
|
66
|
+
private _mask;
|
|
67
|
+
private _startTime;
|
|
68
|
+
private _eventsStarted;
|
|
69
|
+
private _fadeActive;
|
|
70
|
+
private _fadeStart;
|
|
71
|
+
private _fadeEnd;
|
|
72
|
+
private _fadeFrom;
|
|
73
|
+
private _fadeTo;
|
|
74
|
+
private _fadeValue;
|
|
75
|
+
private _warpActive;
|
|
76
|
+
private _warpStart;
|
|
77
|
+
private _warpEnd;
|
|
78
|
+
private _warpFrom;
|
|
79
|
+
private _warpTo;
|
|
80
|
+
private _warpValue;
|
|
81
|
+
constructor(owner: Animation3DActionOwner, clip: Animation3DClip, id: string, options?: Animation3DActionOptions);
|
|
82
|
+
get status(): Animation3DActionStatus;
|
|
83
|
+
get enabled(): boolean;
|
|
84
|
+
set enabled(value: boolean);
|
|
85
|
+
get paused(): boolean;
|
|
86
|
+
set paused(value: boolean);
|
|
87
|
+
get time(): number;
|
|
88
|
+
set time(value: number);
|
|
89
|
+
get timeScale(): number;
|
|
90
|
+
set timeScale(value: number);
|
|
91
|
+
get weight(): number;
|
|
92
|
+
set weight(value: number);
|
|
93
|
+
get loop(): Animation3DLoopMode;
|
|
94
|
+
set loop(value: Animation3DLoopMode);
|
|
95
|
+
get repetitions(): number;
|
|
96
|
+
set repetitions(value: number);
|
|
97
|
+
get clampWhenFinished(): boolean;
|
|
98
|
+
set clampWhenFinished(value: boolean);
|
|
99
|
+
get blendMode(): Animation3DBlendMode;
|
|
100
|
+
set blendMode(value: Animation3DBlendMode);
|
|
101
|
+
get mask(): Animation3DBindingMask | null;
|
|
102
|
+
set mask(value: Animation3DBindingMask | null);
|
|
103
|
+
get effectiveTimeScale(): number;
|
|
104
|
+
get effectiveWeight(): number;
|
|
105
|
+
play(): this;
|
|
106
|
+
stop(): this;
|
|
107
|
+
reset(): this;
|
|
108
|
+
startAt(mixerTimeSeconds: number): this;
|
|
109
|
+
fadeIn(durationSeconds: number): this;
|
|
110
|
+
fadeOut(durationSeconds: number): this;
|
|
111
|
+
crossFadeFrom(source: Animation3DAction, durationSeconds: number, warp?: boolean): this;
|
|
112
|
+
crossFadeTo(destination: Animation3DAction, durationSeconds: number, warp?: boolean): this;
|
|
113
|
+
stopFading(): this;
|
|
114
|
+
acceptsBinding(binding: Animation3DBinding): boolean;
|
|
115
|
+
canContribute(): boolean;
|
|
116
|
+
/** @internal Allocated once by an integration handle and reused every frame. */
|
|
117
|
+
createSynchronizedState(): Animation3DActionSynchronizedState;
|
|
118
|
+
/** @internal Captures every field changed by controller synchronization. */
|
|
119
|
+
captureSynchronizedState(out: Animation3DActionSynchronizedState): void;
|
|
120
|
+
/** @internal Restores event cursors as well as the sampled playhead. */
|
|
121
|
+
restoreSynchronizedState(state: Animation3DActionSynchronizedState): void;
|
|
122
|
+
/**
|
|
123
|
+
* Sets an unwrapped controller-owned playhead without emitting events.
|
|
124
|
+
* Integration adapters use this for initial destination offsets before play.
|
|
125
|
+
*/
|
|
126
|
+
seekSynchronizedTime(timeSeconds: number): void;
|
|
127
|
+
/**
|
|
128
|
+
* Moves to an absolute controller-owned playhead and emits every crossed
|
|
129
|
+
* clip event exactly once. This does not advance the mixer clock.
|
|
130
|
+
*/
|
|
131
|
+
synchronizeTime(timeSeconds: number, out: Animation3DMutablePose): void;
|
|
132
|
+
advance(mixerDelta: number, previousMixerTime: number, currentMixerTime: number, out: Animation3DMutablePose): void;
|
|
133
|
+
invalidate(): void;
|
|
134
|
+
private _clampSynchronizedTime;
|
|
135
|
+
private _setSampleTime;
|
|
136
|
+
private _emitCrossedEvents;
|
|
137
|
+
private _emitStartingEvents;
|
|
138
|
+
private _emitOnceEvents;
|
|
139
|
+
private _emitRepeatEvents;
|
|
140
|
+
private _emitPingPongEvents;
|
|
141
|
+
private _emitPingPongTraversal;
|
|
142
|
+
private _scheduleFade;
|
|
143
|
+
private _scheduleWarp;
|
|
144
|
+
private _fadeFactor;
|
|
145
|
+
private _warpFactor;
|
|
146
|
+
private _finishTransitions;
|
|
147
|
+
private _requireSibling;
|
|
148
|
+
private _resetSamplerCursors;
|
|
149
|
+
private _assertValid;
|
|
150
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { Animation3DMixer } from '../../Animation3DMixer.js';
|
|
2
|
+
import type { Animation3DMixerRuntime } from './Mixer.js';
|
|
3
|
+
/** @internal Connects the public facade to controller-only runtime operations. */
|
|
4
|
+
export declare function registerAnimation3DMixerRuntime(mixer: Animation3DMixer, runtime: Animation3DMixerRuntime): void;
|
|
5
|
+
/** @internal Used only by the state-machine facade integration. */
|
|
6
|
+
export declare function animation3DMixerRuntime(mixer: Animation3DMixer): Animation3DMixerRuntime;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import type { Animation3DBindingResolver } from '../../Animation3DBinding.js';
|
|
2
|
+
import type { Animation3DAction, Animation3DActionOptions } from '../../Animation3DAction.js';
|
|
3
|
+
import type { Animation3DClip } from '../../Animation3DClip.js';
|
|
4
|
+
import type { Animation3DMixerState } from '../../Animation3DMixer.js';
|
|
5
|
+
import type { Animation3DMutablePose, Animation3DPose } from '../../Animation3DPose.js';
|
|
6
|
+
import { type Animation3DActionOwner } from './Action.js';
|
|
7
|
+
/**
|
|
8
|
+
* Contract-compatible Animation3D mixer runtime.
|
|
9
|
+
*
|
|
10
|
+
* Clips remain caller-owned immutable values. The mixer caches only samplers,
|
|
11
|
+
* blend accumulators, and resolver results; it never retains AssetHandles.
|
|
12
|
+
*/
|
|
13
|
+
export declare class Animation3DMixerRuntime implements Animation3DActionOwner {
|
|
14
|
+
readonly resolver: Animation3DBindingResolver;
|
|
15
|
+
private readonly _actions;
|
|
16
|
+
private readonly _actionsById;
|
|
17
|
+
private readonly _accumulators;
|
|
18
|
+
private readonly _accumulatorList;
|
|
19
|
+
private readonly _resolvedBindings;
|
|
20
|
+
private _resolverRevision;
|
|
21
|
+
private _state;
|
|
22
|
+
private _time;
|
|
23
|
+
private _timeScale;
|
|
24
|
+
private _nextActionId;
|
|
25
|
+
private _synchronizedFrameOut;
|
|
26
|
+
private _synchronizedPreviousTime;
|
|
27
|
+
constructor(resolver: Animation3DBindingResolver);
|
|
28
|
+
get state(): Animation3DMixerState;
|
|
29
|
+
get actions(): readonly Animation3DAction[];
|
|
30
|
+
get liveBindingCount(): number;
|
|
31
|
+
get time(): number;
|
|
32
|
+
get timeScale(): number;
|
|
33
|
+
set timeScale(value: number);
|
|
34
|
+
createAction(clip: Animation3DClip, options?: Animation3DActionOptions): Animation3DAction;
|
|
35
|
+
getAction(actionId: string): Animation3DAction | null;
|
|
36
|
+
removeAction(action: Animation3DAction | string): boolean;
|
|
37
|
+
stopAllActions(): this;
|
|
38
|
+
update(deltaSeconds: number, out: Animation3DMutablePose): Animation3DPose;
|
|
39
|
+
evaluate(out: Animation3DMutablePose): Animation3DPose;
|
|
40
|
+
setTime(timeSeconds: number, out: Animation3DMutablePose): Animation3DPose;
|
|
41
|
+
/**
|
|
42
|
+
* Opens an externally-clocked evaluation frame. Ordinary update/evaluate/
|
|
43
|
+
* setTime calls are rejected until the synchronized frame is closed.
|
|
44
|
+
*/
|
|
45
|
+
beginSynchronizedFrame(timeSeconds: number, out: Animation3DMutablePose): void;
|
|
46
|
+
endSynchronizedFrame(out: Animation3DMutablePose): Animation3DPose;
|
|
47
|
+
cancelSynchronizedFrame(out: Animation3DMutablePose): void;
|
|
48
|
+
/** @internal Restores a completed frame when a sibling mixer in one controller transaction fails. */
|
|
49
|
+
rollbackCompletedSynchronizedFrame(timeSeconds: number): void;
|
|
50
|
+
destroy(): void;
|
|
51
|
+
assertActive(): void;
|
|
52
|
+
private _requireIndependentClock;
|
|
53
|
+
private _advanceActions;
|
|
54
|
+
private _evaluateInto;
|
|
55
|
+
private _retainBinding;
|
|
56
|
+
private _releaseBinding;
|
|
57
|
+
private _invalidateResolvedBindingsIfNeeded;
|
|
58
|
+
private _readBase;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Animation3DPoseBuffer } from '../../Animation3DPoseBuffer.js';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { Animation3DTrack } from '../../Animation3DTrack.js';
|
|
2
|
+
/**
|
|
3
|
+
* Stateful, allocation-free sampler for one immutable track.
|
|
4
|
+
*
|
|
5
|
+
* The sampler owns one reusable output buffer and a key cursor optimized for
|
|
6
|
+
* coherent playback. Callers may provide another destination when needed.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Animation3DTrackSampler {
|
|
9
|
+
readonly track: Animation3DTrack;
|
|
10
|
+
readonly valueSize: number;
|
|
11
|
+
readonly output: Float32Array;
|
|
12
|
+
private _cursor;
|
|
13
|
+
constructor(track: Animation3DTrack);
|
|
14
|
+
sample(timeSeconds: number, out?: Float32Array): Float32Array;
|
|
15
|
+
resetCursor(): void;
|
|
16
|
+
private _findInterval;
|
|
17
|
+
private _copyKeyValue;
|
|
18
|
+
private _sampleLinear;
|
|
19
|
+
private _sampleQuaternionLinear;
|
|
20
|
+
private _sampleCubic;
|
|
21
|
+
}
|
|
22
|
+
/** @internal Shared by clip admission and direct sampler construction. */
|
|
23
|
+
export declare function validateAnimation3DTrack(track: Animation3DTrack, clipDuration?: number): void;
|
|
24
|
+
export declare function normalizeQuaternion(value: Float32Array): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { Animation3DActionRuntime, type Animation3DActionOwner, type Animation3DActionTrackRuntime, } from './Action.js';
|
|
2
|
+
export { Animation3DMixerRuntime } from './Mixer.js';
|
|
3
|
+
export { Animation3DPoseBuffer } from './PoseBuffer.js';
|
|
4
|
+
export { Animation3DTrackSampler } from './TrackSampler.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { evaluateAnimation3DBlend1DWeights, evaluateAnimation3DBlend2DWeights, } from '../../../animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../animation-state-machine/runtime/AnimationStateMachineCompiler.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../animation-state-machine/runtime/AnimationStateMachineController.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '../../../animation-state-machine/runtime/AnimationStateMachineMixerPort.js';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { evaluateAnimation3DBlend1DWeights, evaluateAnimation3DBlend2DWeights, } from './Animation3DBlendTreeWeights.js';
|
|
2
|
+
export { Animation3DStateMachineValidationError, compileAnimation3DStateMachine, compileAnimation3DStateMachineDefinition, validateAnimation3DStateMachineDefinition, } from './Animation3DStateMachineCompiler.js';
|
|
3
|
+
export type { Animation3DStateMachineValidationCode, Animation3DStateMachineValidationIssue, CompiledAnimation3DBlend1DChild, CompiledAnimation3DBlend1DMotion, CompiledAnimation3DBlend2DChild, CompiledAnimation3DBlend2DMotion, CompiledAnimation3DClipMotion, CompiledAnimation3DCondition, CompiledAnimation3DConditionOperator, CompiledAnimation3DLayer, CompiledAnimation3DMotion, CompiledAnimation3DParameter, CompiledAnimation3DParameterType, CompiledAnimation3DState, CompiledAnimation3DStateMachine, CompiledAnimation3DTransition, } from './Animation3DStateMachineCompiler.js';
|
|
4
|
+
export { Animation3DStateMachineController, createAnimation3DStateMachineController, } from './Animation3DStateMachineController.js';
|
|
5
|
+
export type { Animation3DStateMachineControllerOptions, Animation3DStateMachineControllerStatus, Animation3DStateMachineLayerSnapshot, } from './Animation3DStateMachineController.js';
|
|
6
|
+
export type { AnimationStateMachineActionHandle, AnimationStateMachineActionOptions, AnimationStateMachineMixerPort, Animation3DStateMachineActionHandle, Animation3DStateMachineActionOptions, Animation3DStateMachineMixerPort, } from './Animation3DStateMachineMixerPort.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/** Stable, source-independent 3D animation runtime. */
|
|
2
|
+
export * from './animation3d/index.js';
|
|
3
|
+
/** Stable HYA adapter for the source-independent 3D runtime. */
|
|
4
|
+
export { HyaAnimation3DRuntime, createHyaAnimation3DRuntime } from './animation3d/hya/HyaAnimation3DRuntime.js';
|
|
5
|
+
export type * from './animation3d/hya/HyaAnimation3DTypes.js';
|