@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.
Files changed (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +30 -0
  3. package/dist/animation/Animation2DComponent.d.ts +46 -0
  4. package/dist/animation/Animation2DExtensionRegistry.d.ts +27 -0
  5. package/dist/animation/Animation2DRenderSystem.d.ts +89 -0
  6. package/dist/animation/Animation2DRuntime.d.ts +99 -0
  7. package/dist/animation/Animation2DStateMachine.d.ts +13 -0
  8. package/dist/animation/Animation2DStateMachineComponent.d.ts +54 -0
  9. package/dist/animation/Animation2DStateMachineRuntime.d.ts +30 -0
  10. package/dist/animation/Animation2DStateMachineSystem.d.ts +14 -0
  11. package/dist/animation/Animation2DStateMachineVisualRuntime.d.ts +27 -0
  12. package/dist/animation/Animation2DSystem.d.ts +14 -0
  13. package/dist/animation/AnimationAssetLoader.d.ts +9 -0
  14. package/dist/animation/AnimationAudioClip.d.ts +26 -0
  15. package/dist/animation/AnimationPathTessellator.d.ts +52 -0
  16. package/dist/animation/AnimationTextRasterizer.d.ts +21 -0
  17. package/dist/animation/AnimationVisual2D.d.ts +68 -0
  18. package/dist/animation/HyaAnimation2DClipAdapter.d.ts +16 -0
  19. package/dist/animation/Particle2DDescriptorAdapter.d.ts +5 -0
  20. package/dist/animation/runtime/mixer/Action.d.ts +150 -0
  21. package/dist/animation/runtime/mixer/Mixer.d.ts +54 -0
  22. package/dist/animation/runtime/mixer/PoseBuffer.d.ts +23 -0
  23. package/dist/animation/runtime/mixer/Sampler.d.ts +17 -0
  24. package/dist/animation/runtime/mixer/Types.d.ts +101 -0
  25. package/dist/animation/runtime/mixer/index.d.ts +6 -0
  26. package/dist/animation-state-machine/AnimationStateMachine.d.ts +111 -0
  27. package/dist/animation-state-machine/AnimationStateMachineChannels.d.ts +23 -0
  28. package/dist/animation-state-machine/runtime/Animation2DStateMachineMixerAdapter.d.ts +51 -0
  29. package/dist/animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.d.ts +14 -0
  30. package/dist/animation-state-machine/runtime/AnimationStateMachineCompiler.d.ts +109 -0
  31. package/dist/animation-state-machine/runtime/AnimationStateMachineController.d.ts +103 -0
  32. package/dist/animation-state-machine/runtime/AnimationStateMachineMixerPort.d.ts +35 -0
  33. package/dist/animation-state-machine/runtime/index.d.ts +7 -0
  34. package/dist/animation.d.ts +15 -0
  35. package/dist/animation.js +1171 -0
  36. package/dist/animation3d/Animation3DAction.d.ts +46 -0
  37. package/dist/animation3d/Animation3DBinding.d.ts +85 -0
  38. package/dist/animation3d/Animation3DClip.d.ts +20 -0
  39. package/dist/animation3d/Animation3DError.d.ts +13 -0
  40. package/dist/animation3d/Animation3DMixer.d.ts +27 -0
  41. package/dist/animation3d/Animation3DPose.d.ts +40 -0
  42. package/dist/animation3d/Animation3DPoseBuffer.d.ts +24 -0
  43. package/dist/animation3d/Animation3DResource.d.ts +28 -0
  44. package/dist/animation3d/Animation3DStateMachine.d.ts +95 -0
  45. package/dist/animation3d/Animation3DStateMachineRuntime.d.ts +70 -0
  46. package/dist/animation3d/Animation3DTrack.d.ts +19 -0
  47. package/dist/animation3d/hya/HyaAnimation3DRuntime.d.ts +73 -0
  48. package/dist/animation3d/hya/HyaAnimation3DStateMachineRuntime.d.ts +65 -0
  49. package/dist/animation3d/hya/HyaAnimation3DTypes.d.ts +170 -0
  50. package/dist/animation3d/hya/index.d.ts +4 -0
  51. package/dist/animation3d/index.d.ts +14 -0
  52. package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.d.ts +81 -0
  53. package/dist/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.d.ts +39 -0
  54. package/dist/animation3d/runtime/integration/index.d.ts +2 -0
  55. package/dist/animation3d/runtime/mixer/Action.d.ts +150 -0
  56. package/dist/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.d.ts +6 -0
  57. package/dist/animation3d/runtime/mixer/Mixer.d.ts +59 -0
  58. package/dist/animation3d/runtime/mixer/PoseBuffer.d.ts +1 -0
  59. package/dist/animation3d/runtime/mixer/TrackSampler.d.ts +24 -0
  60. package/dist/animation3d/runtime/mixer/index.d.ts +4 -0
  61. package/dist/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.d.ts +1 -0
  62. package/dist/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.d.ts +1 -0
  63. package/dist/animation3d/runtime/state-machine/Animation3DStateMachineController.d.ts +1 -0
  64. package/dist/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.d.ts +1 -0
  65. package/dist/animation3d/runtime/state-machine/index.d.ts +6 -0
  66. package/dist/animation3d.d.ts +5 -0
  67. package/dist/animation3d.js +1708 -0
  68. package/dist/benchmark.d.ts +30 -0
  69. package/dist/benchmark.js +119 -0
  70. package/dist/canvas-text/CanvasText2DRenderSystem.d.ts +24 -0
  71. package/dist/canvas-text/CanvasTextComponent.d.ts +18 -0
  72. package/dist/canvas-text.d.ts +4 -0
  73. package/dist/canvas-text.js +276 -0
  74. package/dist/chunks/2d-ui-animation-2d.generated-D4aHzFU2.js +4 -0
  75. package/dist/chunks/2d-ui-canvas-text-2d.generated-C0Eaej2m.js +4 -0
  76. package/dist/chunks/2d-ui-spine2d.generated-CUUi8xjl.js +4 -0
  77. package/dist/chunks/2d-ui-tilemap2d.generated-gebw4mX7.js +4 -0
  78. package/dist/chunks/Animation2DStateMachine-9IonguNa.js +3245 -0
  79. package/dist/chunks/AnimationStateMachineController-BIcAh-sT.js +1438 -0
  80. package/dist/chunks/GltfAnimation3DAdapter-Cu3rQQsW.js +2240 -0
  81. package/dist/chunks/GltfAnimationRuntime-CRHsLycN.js +631 -0
  82. package/dist/chunks/RenderSystem2DBase-DDT61dAu.js +227 -0
  83. package/dist/chunks/Spine2DRuntime-D9M9LAQR.js +3056 -0
  84. package/dist/chunks/SpineAssetParser-BSDmPge1.js +378 -0
  85. package/dist/chunks/gltfLoader-Dm22jLYB.js +2085 -0
  86. package/dist/chunks/pluginUtils-CvwroRMd.js +33 -0
  87. package/dist/experimental-gltf-worker.d.ts +4 -0
  88. package/dist/experimental-gltf-worker.js +138 -0
  89. package/dist/experimental-spine-worker.d.ts +4 -0
  90. package/dist/experimental-spine-worker.js +110 -0
  91. package/dist/gltf/GltfAccessorReader.d.ts +7 -0
  92. package/dist/gltf/GltfAnimation3DAdapter.d.ts +47 -0
  93. package/dist/gltf/GltfAnimationRuntime.d.ts +10 -0
  94. package/dist/gltf/GltfAssetWorkerClient.d.ts +20 -0
  95. package/dist/gltf/GltfCompatibilityReport.d.ts +70 -0
  96. package/dist/gltf/GltfConservativeBounds.d.ts +18 -0
  97. package/dist/gltf/GltfDracoDecoder.d.ts +4 -0
  98. package/dist/gltf/GltfExtensionAdapter.d.ts +54 -0
  99. package/dist/gltf/GltfLoaderContract.d.ts +249 -0
  100. package/dist/gltf/GltfLoaderErrors.d.ts +4 -0
  101. package/dist/gltf/GltfMaterialDescriptor.d.ts +23 -0
  102. package/dist/gltf/GltfMaterialEncoder.d.ts +20 -0
  103. package/dist/gltf/GltfMaterialLoader.d.ts +6 -0
  104. package/dist/gltf/GltfModelComponent.d.ts +72 -0
  105. package/dist/gltf/GltfModelSystem.d.ts +37 -0
  106. package/dist/gltf/GltfPlugin.d.ts +6 -0
  107. package/dist/gltf/GltfSchema.d.ts +225 -0
  108. package/dist/gltf/GltfUvSemanticPlanner.d.ts +33 -0
  109. package/dist/gltf/gltfLoader.d.ts +9 -0
  110. package/dist/gltf-animation3d.d.ts +3 -0
  111. package/dist/gltf-animation3d.js +8 -0
  112. package/dist/gltf-worker-runtime.d.ts +7 -0
  113. package/dist/gltf-worker-runtime.js +6981 -0
  114. package/dist/gltf.d.ts +12 -0
  115. package/dist/gltf.js +517 -0
  116. package/dist/grid/Grid2DComponent.d.ts +25 -0
  117. package/dist/grid.d.ts +2 -0
  118. package/dist/grid.js +56 -0
  119. package/dist/hya-state-machine.d.ts +7 -0
  120. package/dist/hya-state-machine.js +2934 -0
  121. package/dist/index.d.ts +2 -0
  122. package/dist/index.js +7 -0
  123. package/dist/internal/2d-ui-shader-artifact.js +870 -0
  124. package/dist/plugins/pluginUtils.d.ts +20 -0
  125. package/dist/plugins.d.ts +6 -0
  126. package/dist/shaders/generated/2d-ui-artifact.generated.d.ts +658 -0
  127. package/dist/spine/Spine2DComponent.d.ts +116 -0
  128. package/dist/spine/Spine2DGpuRenderer.d.ts +65 -0
  129. package/dist/spine/Spine2DRenderSystem.d.ts +27 -0
  130. package/dist/spine/Spine2DRuntime.d.ts +103 -0
  131. package/dist/spine/SpineAnimationBoneTimelines.d.ts +8 -0
  132. package/dist/spine/SpineAssetParser.d.ts +18 -0
  133. package/dist/spine/SpineAssetWorkerClient.d.ts +19 -0
  134. package/dist/spine/SpineAssetWorkerContract.d.ts +6 -0
  135. package/dist/spine/SpineAtlasParser.d.ts +21 -0
  136. package/dist/spine/SpineFloatBuilder.d.ts +15 -0
  137. package/dist/spine/SpinePathConstraintSolver.d.ts +32 -0
  138. package/dist/spine/SpinePlugin.d.ts +8 -0
  139. package/dist/spine/SpineSkeletonRuntime.d.ts +185 -0
  140. package/dist/spine/SpineSlotAnimation.d.ts +17 -0
  141. package/dist/spine/SpineTimelineRuntime.d.ts +25 -0
  142. package/dist/spine/SpineVertexBuilder.d.ts +61 -0
  143. package/dist/spine.d.ts +7 -0
  144. package/dist/spine.js +578 -0
  145. package/dist/tilemap/Tilemap2DComponent.d.ts +110 -0
  146. package/dist/tilemap/Tilemap2DRenderSystem.d.ts +11 -0
  147. package/dist/tilemap/Tilemap2DRenderer.d.ts +24 -0
  148. package/dist/tilemap/TilemapPlugin.d.ts +8 -0
  149. package/dist/tilemap.d.ts +6 -0
  150. package/dist/tilemap.js +535 -0
  151. package/dist/tween/Tween2DComponent.d.ts +70 -0
  152. package/dist/tween/Tween2DSystem.d.ts +12 -0
  153. package/dist/tween.d.ts +4 -0
  154. package/dist/tween.js +138 -0
  155. package/dist/utils/RenderSystem2DBase.d.ts +42 -0
  156. package/dist/utils/arrayAccess.d.ts +4 -0
  157. package/dist/utils/camera2d.d.ts +12 -0
  158. package/dist/utils/render2dGpu.d.ts +32 -0
  159. package/package.json +124 -0
  160. package/src/animation/Animation2DComponent.ts +135 -0
  161. package/src/animation/Animation2DExtensionRegistry.ts +52 -0
  162. package/src/animation/Animation2DRenderSystem.ts +1026 -0
  163. package/src/animation/Animation2DRuntime.ts +1326 -0
  164. package/src/animation/Animation2DStateMachine.ts +39 -0
  165. package/src/animation/Animation2DStateMachineComponent.ts +228 -0
  166. package/src/animation/Animation2DStateMachineRuntime.ts +141 -0
  167. package/src/animation/Animation2DStateMachineSystem.ts +60 -0
  168. package/src/animation/Animation2DStateMachineVisualRuntime.ts +282 -0
  169. package/src/animation/Animation2DSystem.ts +72 -0
  170. package/src/animation/AnimationAssetLoader.ts +84 -0
  171. package/src/animation/AnimationAudioClip.ts +140 -0
  172. package/src/animation/AnimationPathTessellator.ts +691 -0
  173. package/src/animation/AnimationTextRasterizer.ts +340 -0
  174. package/src/animation/AnimationVisual2D.ts +153 -0
  175. package/src/animation/HyaAnimation2DClipAdapter.ts +845 -0
  176. package/src/animation/Particle2DDescriptorAdapter.ts +35 -0
  177. package/src/animation/runtime/mixer/Action.ts +876 -0
  178. package/src/animation/runtime/mixer/Mixer.ts +505 -0
  179. package/src/animation/runtime/mixer/PoseBuffer.ts +105 -0
  180. package/src/animation/runtime/mixer/Sampler.ts +252 -0
  181. package/src/animation/runtime/mixer/Types.ts +138 -0
  182. package/src/animation/runtime/mixer/index.ts +31 -0
  183. package/src/animation-state-machine/AnimationStateMachine.ts +146 -0
  184. package/src/animation-state-machine/AnimationStateMachineChannels.ts +116 -0
  185. package/src/animation-state-machine/runtime/Animation2DStateMachineMixerAdapter.ts +197 -0
  186. package/src/animation-state-machine/runtime/AnimationStateMachineBlendTreeWeights.ts +503 -0
  187. package/src/animation-state-machine/runtime/AnimationStateMachineCompiler.ts +763 -0
  188. package/src/animation-state-machine/runtime/AnimationStateMachineController.ts +987 -0
  189. package/src/animation-state-machine/runtime/AnimationStateMachineMixerPort.ts +54 -0
  190. package/src/animation-state-machine/runtime/index.ts +47 -0
  191. package/src/animation.ts +33 -0
  192. package/src/animation3d/Animation3DAction.ts +73 -0
  193. package/src/animation3d/Animation3DBinding.ts +116 -0
  194. package/src/animation3d/Animation3DClip.ts +22 -0
  195. package/src/animation3d/Animation3DError.ts +34 -0
  196. package/src/animation3d/Animation3DMixer.ts +82 -0
  197. package/src/animation3d/Animation3DPose.ts +100 -0
  198. package/src/animation3d/Animation3DPoseBuffer.ts +85 -0
  199. package/src/animation3d/Animation3DResource.ts +49 -0
  200. package/src/animation3d/Animation3DStateMachine.ts +126 -0
  201. package/src/animation3d/Animation3DStateMachineRuntime.ts +191 -0
  202. package/src/animation3d/Animation3DTrack.ts +29 -0
  203. package/src/animation3d/hya/HyaAnimation3DRuntime.ts +756 -0
  204. package/src/animation3d/hya/HyaAnimation3DStateMachineRuntime.ts +618 -0
  205. package/src/animation3d/hya/HyaAnimation3DTypes.ts +168 -0
  206. package/src/animation3d/hya/index.ts +10 -0
  207. package/src/animation3d/index.ts +76 -0
  208. package/src/animation3d/runtime/integration/Animation3DStateMachineMixerAdapter.ts +325 -0
  209. package/src/animation3d/runtime/integration/Animation3DStateMachineMixerIntegration.ts +158 -0
  210. package/src/animation3d/runtime/integration/index.ts +9 -0
  211. package/src/animation3d/runtime/mixer/Action.ts +833 -0
  212. package/src/animation3d/runtime/mixer/Animation3DMixerRuntimeStore.ts +26 -0
  213. package/src/animation3d/runtime/mixer/Mixer.ts +562 -0
  214. package/src/animation3d/runtime/mixer/PoseBuffer.ts +1 -0
  215. package/src/animation3d/runtime/mixer/TrackSampler.ts +399 -0
  216. package/src/animation3d/runtime/mixer/index.ts +8 -0
  217. package/src/animation3d/runtime/state-machine/Animation3DBlendTreeWeights.ts +4 -0
  218. package/src/animation3d/runtime/state-machine/Animation3DStateMachineCompiler.ts +1 -0
  219. package/src/animation3d/runtime/state-machine/Animation3DStateMachineController.ts +1 -0
  220. package/src/animation3d/runtime/state-machine/Animation3DStateMachineMixerPort.ts +1 -0
  221. package/src/animation3d/runtime/state-machine/index.ts +45 -0
  222. package/src/animation3d.ts +5 -0
  223. package/src/benchmark.ts +168 -0
  224. package/src/canvas-text/CanvasText2DRenderSystem.ts +292 -0
  225. package/src/canvas-text/CanvasTextComponent.ts +47 -0
  226. package/src/canvas-text.ts +4 -0
  227. package/src/experimental-gltf-worker.ts +18 -0
  228. package/src/experimental-spine-worker.ts +9 -0
  229. package/src/gltf/GltfAccessorReader.ts +271 -0
  230. package/src/gltf/GltfAnimation3DAdapter.ts +680 -0
  231. package/src/gltf/GltfAnimationRuntime.ts +392 -0
  232. package/src/gltf/GltfAssetWorkerClient.ts +136 -0
  233. package/src/gltf/GltfCompatibilityReport.ts +214 -0
  234. package/src/gltf/GltfConservativeBounds.ts +219 -0
  235. package/src/gltf/GltfDracoDecoder.ts +251 -0
  236. package/src/gltf/GltfExtensionAdapter.ts +340 -0
  237. package/src/gltf/GltfLoaderContract.ts +333 -0
  238. package/src/gltf/GltfLoaderErrors.ts +59 -0
  239. package/src/gltf/GltfMaterialDescriptor.ts +134 -0
  240. package/src/gltf/GltfMaterialEncoder.ts +173 -0
  241. package/src/gltf/GltfMaterialLoader.ts +293 -0
  242. package/src/gltf/GltfModelComponent.ts +115 -0
  243. package/src/gltf/GltfModelSystem.ts +208 -0
  244. package/src/gltf/GltfPlugin.ts +84 -0
  245. package/src/gltf/GltfSchema.ts +229 -0
  246. package/src/gltf/GltfUvSemanticPlanner.ts +166 -0
  247. package/src/gltf/gltfLoader.ts +910 -0
  248. package/src/gltf-animation3d.ts +10 -0
  249. package/src/gltf-worker-runtime.ts +10 -0
  250. package/src/gltf.ts +56 -0
  251. package/src/grid/Grid2DComponent.ts +69 -0
  252. package/src/grid.ts +2 -0
  253. package/src/hya-state-machine.ts +19 -0
  254. package/src/index.ts +2 -0
  255. package/src/plugins/pluginUtils.ts +50 -0
  256. package/src/plugins.ts +6 -0
  257. package/src/shaders/generated/2d-ui-animation-2d.generated.wgsl +242 -0
  258. package/src/shaders/generated/2d-ui-artifact.generated.ts +867 -0
  259. package/src/shaders/generated/2d-ui-canvas-text-2d.generated.wgsl +38 -0
  260. package/src/shaders/generated/2d-ui-spine2d.generated.wgsl +41 -0
  261. package/src/shaders/generated/2d-ui-tilemap2d.generated.wgsl +36 -0
  262. package/src/spine/Spine2DComponent.ts +168 -0
  263. package/src/spine/Spine2DGpuRenderer.ts +449 -0
  264. package/src/spine/Spine2DRenderSystem.ts +199 -0
  265. package/src/spine/Spine2DRuntime.ts +1529 -0
  266. package/src/spine/SpineAnimationBoneTimelines.ts +30 -0
  267. package/src/spine/SpineAssetParser.ts +20 -0
  268. package/src/spine/SpineAssetWorkerClient.ts +112 -0
  269. package/src/spine/SpineAssetWorkerContract.ts +4 -0
  270. package/src/spine/SpineAtlasParser.ts +127 -0
  271. package/src/spine/SpineFloatBuilder.ts +66 -0
  272. package/src/spine/SpinePathConstraintSolver.ts +582 -0
  273. package/src/spine/SpinePlugin.ts +76 -0
  274. package/src/spine/SpineSkeletonRuntime.ts +521 -0
  275. package/src/spine/SpineSlotAnimation.ts +195 -0
  276. package/src/spine/SpineTimelineRuntime.ts +453 -0
  277. package/src/spine/SpineVertexBuilder.ts +686 -0
  278. package/src/spine.ts +7 -0
  279. package/src/tilemap/Tilemap2DComponent.ts +232 -0
  280. package/src/tilemap/Tilemap2DRenderSystem.ts +58 -0
  281. package/src/tilemap/Tilemap2DRenderer.ts +289 -0
  282. package/src/tilemap/TilemapPlugin.ts +75 -0
  283. package/src/tilemap.ts +6 -0
  284. package/src/tween/Tween2DComponent.ts +83 -0
  285. package/src/tween/Tween2DSystem.ts +78 -0
  286. package/src/tween.ts +4 -0
  287. package/src/types/earcut.d.ts +7 -0
  288. package/src/types/wgsl.d.ts +4 -0
  289. package/src/utils/RenderSystem2DBase.ts +164 -0
  290. package/src/utils/arrayAccess.ts +17 -0
  291. package/src/utils/camera2d.ts +68 -0
  292. package/src/utils/render2dGpu.ts +132 -0
  293. package/test/fixtures/gltf/animation-characterization.gltf +344 -0
@@ -0,0 +1,46 @@
1
+ import type { Animation3DBindingMask } from './Animation3DBinding';
2
+ import type { Animation3DClip } from './Animation3DClip';
3
+ export type Animation3DLoopMode = 'once' | 'repeat' | 'ping-pong';
4
+ export type Animation3DBlendMode = 'override' | 'additive';
5
+ export type Animation3DActionStatus = 'idle' | 'scheduled' | 'running' | 'paused' | 'finished' | 'stopped';
6
+ export interface Animation3DActionOptions {
7
+ readonly id?: string;
8
+ readonly loop?: Animation3DLoopMode;
9
+ /** Infinity is valid for repeat and ping-pong. */
10
+ readonly repetitions?: number;
11
+ readonly clampWhenFinished?: boolean;
12
+ readonly timeScale?: number;
13
+ readonly weight?: number;
14
+ readonly blendMode?: Animation3DBlendMode;
15
+ readonly mask?: Animation3DBindingMask;
16
+ }
17
+ /**
18
+ * One mutable playback instance of an immutable clip.
19
+ * Actions are mixer-owned and become invalid after removal or mixer destroy.
20
+ */
21
+ export interface Animation3DAction {
22
+ readonly id: string;
23
+ readonly clip: Animation3DClip;
24
+ readonly status: Animation3DActionStatus;
25
+ enabled: boolean;
26
+ paused: boolean;
27
+ time: number;
28
+ timeScale: number;
29
+ weight: number;
30
+ loop: Animation3DLoopMode;
31
+ repetitions: number;
32
+ clampWhenFinished: boolean;
33
+ blendMode: Animation3DBlendMode;
34
+ mask: Animation3DBindingMask | null;
35
+ readonly effectiveTimeScale: number;
36
+ readonly effectiveWeight: number;
37
+ play(): this;
38
+ stop(): this;
39
+ reset(): this;
40
+ startAt(mixerTimeSeconds: number): this;
41
+ fadeIn(durationSeconds: number): this;
42
+ fadeOut(durationSeconds: number): this;
43
+ crossFadeFrom(source: Animation3DAction, durationSeconds: number, warp?: boolean): this;
44
+ crossFadeTo(destination: Animation3DAction, durationSeconds: number, warp?: boolean): this;
45
+ stopFading(): this;
46
+ }
@@ -0,0 +1,85 @@
1
+ /**
2
+ * Logical targets keep authored clips independent from a concrete ECS World.
3
+ * A runtime resolver maps one of these stable references to an actual target.
4
+ */
5
+ export type Animation3DBindingTarget = Readonly<{
6
+ kind: 'node-id';
7
+ nodeId: string;
8
+ }> | Readonly<{
9
+ kind: 'node-path';
10
+ segments: readonly string[];
11
+ }> | Readonly<{
12
+ kind: 'slot';
13
+ slot: string;
14
+ }>;
15
+ export type Animation3DFixedValueType = 'scalar' | 'vec2' | 'vec3' | 'vec4' | 'quaternion';
16
+ export type Animation3DValueType = Animation3DFixedValueType | 'weights';
17
+ export interface Animation3DTranslationBinding {
18
+ readonly id: string;
19
+ readonly target: Animation3DBindingTarget;
20
+ readonly path: 'transform.translation';
21
+ readonly valueType: 'vec3';
22
+ readonly valueSize: 3;
23
+ }
24
+ export interface Animation3DRotationBinding {
25
+ readonly id: string;
26
+ readonly target: Animation3DBindingTarget;
27
+ readonly path: 'transform.rotation';
28
+ readonly valueType: 'quaternion';
29
+ readonly valueSize: 4;
30
+ }
31
+ export interface Animation3DScaleBinding {
32
+ readonly id: string;
33
+ readonly target: Animation3DBindingTarget;
34
+ readonly path: 'transform.scale';
35
+ readonly valueType: 'vec3';
36
+ readonly valueSize: 3;
37
+ }
38
+ export interface Animation3DMorphWeightsBinding {
39
+ readonly id: string;
40
+ readonly target: Animation3DBindingTarget;
41
+ readonly path: 'morph.weights';
42
+ readonly valueType: 'weights';
43
+ /** Positive morph target count. Loaders must reject zero or negative values. */
44
+ readonly valueSize: number;
45
+ }
46
+ export type Animation3DFixedValueSize = {
47
+ readonly scalar: 1;
48
+ readonly vec2: 2;
49
+ readonly vec3: 3;
50
+ readonly vec4: 4;
51
+ readonly quaternion: 4;
52
+ };
53
+ export type Animation3DPropertyBinding = {
54
+ [TValueType in Animation3DFixedValueType]: Readonly<{
55
+ id: string;
56
+ target: Animation3DBindingTarget;
57
+ path: 'property';
58
+ /** Stable component or adapter namespace, never a constructor reference. */
59
+ component: string;
60
+ property: string;
61
+ valueType: TValueType;
62
+ valueSize: Animation3DFixedValueSize[TValueType];
63
+ }>;
64
+ }[Animation3DFixedValueType];
65
+ export type Animation3DBinding = Animation3DTranslationBinding | Animation3DRotationBinding | Animation3DScaleBinding | Animation3DMorphWeightsBinding | Animation3DPropertyBinding;
66
+ export interface Animation3DResolvedBinding<TBinding extends Animation3DBinding = Animation3DBinding> {
67
+ readonly binding: TBinding;
68
+ /** Writes exactly binding.valueSize values into out. */
69
+ read(out: Float32Array): void;
70
+ /** Reads exactly binding.valueSize values from value. */
71
+ write(value: ArrayLike<number>): void;
72
+ }
73
+ /**
74
+ * Resolver revisions invalidate cached resolved bindings after hierarchy or
75
+ * component structure changes.
76
+ */
77
+ export interface Animation3DBindingResolver {
78
+ readonly revision: number;
79
+ resolve<TBinding extends Animation3DBinding>(binding: TBinding): Animation3DResolvedBinding<TBinding> | null;
80
+ }
81
+ export interface Animation3DBindingMask {
82
+ /** Empty or omitted include means all bindings are eligible. */
83
+ readonly include?: readonly string[];
84
+ readonly exclude?: readonly string[];
85
+ }
@@ -0,0 +1,20 @@
1
+ import type { Animation3DTrack } from './Animation3DTrack';
2
+ export interface Animation3DEvent {
3
+ readonly id: string;
4
+ readonly time: number;
5
+ readonly name: string;
6
+ /** Loader-validated, structured-cloneable event data. */
7
+ readonly payload?: Readonly<Record<string, unknown>>;
8
+ }
9
+ /**
10
+ * Immutable, source-format-independent CPU animation resource.
11
+ * Times are seconds; rotations are normalized XYZW quaternions.
12
+ */
13
+ export interface Animation3DClip {
14
+ readonly format: 'haiyue-animation3d-clip@1';
15
+ readonly id: string;
16
+ readonly name: string;
17
+ readonly duration: number;
18
+ readonly tracks: readonly Animation3DTrack[];
19
+ readonly events: readonly Animation3DEvent[];
20
+ }
@@ -0,0 +1,13 @@
1
+ export type Animation3DErrorCode = 'mixer-destroyed' | 'invalid-clip' | 'invalid-track' | 'invalid-action' | 'duplicate-action-id' | 'resolver-miss';
2
+ export type Animation3DErrorDetails = Readonly<Record<string, string | number | boolean | null>>;
3
+ /**
4
+ * Stable domain error for the Animation3D facade.
5
+ *
6
+ * Callers should branch on `code`; messages remain diagnostic and may gain
7
+ * additional context without changing the error contract.
8
+ */
9
+ export declare class Animation3DError extends Error {
10
+ readonly code: Animation3DErrorCode;
11
+ readonly details: Animation3DErrorDetails;
12
+ constructor(code: Animation3DErrorCode, message: string, details?: Animation3DErrorDetails);
13
+ }
@@ -0,0 +1,27 @@
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 { Animation3DMutablePose, Animation3DPose } from './Animation3DPose.js';
5
+ export type Animation3DMixerState = 'active' | 'destroyed';
6
+ /**
7
+ * Public mixer facade. Controller-only clock/transaction hooks remain on the
8
+ * internal runtime and are intentionally absent from this surface.
9
+ */
10
+ export declare class Animation3DMixer {
11
+ #private;
12
+ constructor(resolver: Animation3DBindingResolver);
13
+ get state(): Animation3DMixerState;
14
+ get resolver(): Animation3DBindingResolver;
15
+ get actions(): readonly Animation3DAction[];
16
+ get time(): number;
17
+ get timeScale(): number;
18
+ set timeScale(value: number);
19
+ createAction(clip: Animation3DClip, options?: Animation3DActionOptions): Animation3DAction;
20
+ getAction(actionId: string): Animation3DAction | null;
21
+ removeAction(action: Animation3DAction | string): boolean;
22
+ stopAllActions(): this;
23
+ update(deltaSeconds: number, out: Animation3DMutablePose): Animation3DPose;
24
+ evaluate(out: Animation3DMutablePose): Animation3DPose;
25
+ setTime(timeSeconds: number, out: Animation3DMutablePose): Animation3DPose;
26
+ destroy(): void;
27
+ }
@@ -0,0 +1,40 @@
1
+ import type { Animation3DBinding, Animation3DBindingResolver } from './Animation3DBinding.js';
2
+ import type { Animation3DEvent } from './Animation3DClip.js';
3
+ export interface Animation3DPoseChannel<TBinding extends Animation3DBinding = Animation3DBinding> {
4
+ readonly binding: TBinding;
5
+ /** Exactly binding.valueSize sampled and blended values. */
6
+ readonly value: Readonly<Float32Array>;
7
+ }
8
+ export interface Animation3DPoseEvent {
9
+ readonly actionId: string;
10
+ readonly clipId: string;
11
+ readonly event: Animation3DEvent;
12
+ }
13
+ /**
14
+ * Frame-transient mixer output. Implementations may reuse its arrays on the
15
+ * next evaluate/update call; callers must copy values they need to retain.
16
+ */
17
+ export interface Animation3DPose {
18
+ readonly sequence: number;
19
+ readonly mixerTime: number;
20
+ readonly channels: readonly Animation3DPoseChannel[];
21
+ readonly events: readonly Animation3DPoseEvent[];
22
+ }
23
+ /**
24
+ * Caller-provided scratch target used to keep mixer evaluation allocation-free.
25
+ * reset() begins a new pose and seal() returns the current read-only view.
26
+ */
27
+ export interface Animation3DMutablePose {
28
+ reset(mixerTime: number): void;
29
+ write(binding: Animation3DBinding, value: ArrayLike<number>): void;
30
+ emit(event: Animation3DPoseEvent): void;
31
+ seal(): Animation3DPose;
32
+ }
33
+ /**
34
+ * Applies pose channels through a revision-aware binding resolver cache.
35
+ * Resolver misses fail explicitly and never write to a fallback target.
36
+ */
37
+ export declare class Animation3DPoseApplier {
38
+ constructor(resolver: Animation3DBindingResolver);
39
+ apply(pose: Animation3DPose): void;
40
+ }
@@ -0,0 +1,24 @@
1
+ import type { Animation3DBinding } from './Animation3DBinding.js';
2
+ import type { Animation3DMutablePose, Animation3DPose, Animation3DPoseChannel, Animation3DPoseEvent } from './Animation3DPose.js';
3
+ /**
4
+ * Reusable caller-owned mixer output.
5
+ *
6
+ * Channel records and value arrays are pooled after first use. seal() returns
7
+ * this object as the read-only pose view rather than allocating a snapshot.
8
+ */
9
+ export declare class Animation3DPoseBuffer implements Animation3DMutablePose, Animation3DPose {
10
+ private readonly _channelPool;
11
+ private readonly _channels;
12
+ private readonly _events;
13
+ private _sequence;
14
+ private _mixerTime;
15
+ private _sealed;
16
+ get sequence(): number;
17
+ get mixerTime(): number;
18
+ get channels(): readonly Animation3DPoseChannel[];
19
+ get events(): readonly Animation3DPoseEvent[];
20
+ reset(mixerTime: number): void;
21
+ write(binding: Animation3DBinding, value: ArrayLike<number>): void;
22
+ emit(event: Animation3DPoseEvent): void;
23
+ seal(): Animation3DPose;
24
+ }
@@ -0,0 +1,28 @@
1
+ import type { AssetHandle, AssetJobPriority, AssetOwnerScope } from '@haiyue/engine/assets';
2
+ import type { Animation3DClip } from './Animation3DClip';
3
+ import type { Animation3DStateMachineDefinition } from './Animation3DStateMachine';
4
+ export type Animation3DClipHandle = AssetHandle<Animation3DClip>;
5
+ export type Animation3DStateMachineHandle = AssetHandle<Animation3DStateMachineDefinition>;
6
+ export type Animation3DResourceSource = Readonly<{
7
+ kind: 'url';
8
+ url: string;
9
+ cacheKey?: string;
10
+ }> | Readonly<{
11
+ kind: 'buffer';
12
+ data: ArrayBuffer;
13
+ /** Required because ArrayBuffer identity is not a persistent cache key. */
14
+ cacheKey: string;
15
+ }>;
16
+ export interface Animation3DResourceLoadOptions {
17
+ readonly signal?: AbortSignal;
18
+ readonly owner?: AssetOwnerScope;
19
+ readonly priority?: AssetJobPriority | number;
20
+ }
21
+ /**
22
+ * Contract for an AssetManager-backed loader. Implementations must return a
23
+ * distinct handle per acquisition and make handle.release() idempotent.
24
+ */
25
+ export interface Animation3DResourceLoader {
26
+ loadClip(source: Animation3DResourceSource, options?: Animation3DResourceLoadOptions): Promise<Animation3DClipHandle>;
27
+ loadStateMachine(source: Animation3DResourceSource, options?: Animation3DResourceLoadOptions): Promise<Animation3DStateMachineHandle>;
28
+ }
@@ -0,0 +1,95 @@
1
+ import type { Animation3DBindingMask } from './Animation3DBinding.js';
2
+ import type { Animation3DBlendMode, Animation3DLoopMode } from './Animation3DAction.js';
3
+ export type Animation3DParameterDefinition = Readonly<{
4
+ name: string;
5
+ type: 'float';
6
+ defaultValue: number;
7
+ }> | Readonly<{
8
+ name: string;
9
+ type: 'integer';
10
+ defaultValue: number;
11
+ }> | Readonly<{
12
+ name: string;
13
+ type: 'boolean';
14
+ defaultValue: boolean;
15
+ }> | Readonly<{
16
+ name: string;
17
+ type: 'trigger';
18
+ }>;
19
+ export type Animation3DTransitionCondition = Readonly<{
20
+ parameter: string;
21
+ operator: 'greater' | 'greater-or-equal' | 'less' | 'less-or-equal';
22
+ value: number;
23
+ }> | Readonly<{
24
+ parameter: string;
25
+ operator: 'equal' | 'not-equal';
26
+ value: number | boolean;
27
+ }> | Readonly<{
28
+ parameter: string;
29
+ operator: 'is-true' | 'is-false' | 'triggered';
30
+ }>;
31
+ export interface Animation3DClipMotion {
32
+ readonly kind: 'clip';
33
+ readonly clipId: string;
34
+ }
35
+ export interface Animation3DBlend1DChild {
36
+ readonly threshold: number;
37
+ readonly motion: Animation3DMotionDefinition;
38
+ }
39
+ export interface Animation3DBlend1DMotion {
40
+ readonly kind: 'blend-1d';
41
+ readonly parameter: string;
42
+ readonly children: readonly Animation3DBlend1DChild[];
43
+ }
44
+ export interface Animation3DBlend2DChild {
45
+ readonly position: readonly [number, number];
46
+ readonly motion: Animation3DMotionDefinition;
47
+ }
48
+ export interface Animation3DBlend2DMotion {
49
+ readonly kind: 'blend-2d';
50
+ readonly algorithm: 'cartesian' | 'directional';
51
+ readonly parameterX: string;
52
+ readonly parameterY: string;
53
+ readonly children: readonly Animation3DBlend2DChild[];
54
+ }
55
+ export type Animation3DMotionDefinition = Animation3DClipMotion | Animation3DBlend1DMotion | Animation3DBlend2DMotion;
56
+ export interface Animation3DStateDefinition {
57
+ readonly id: string;
58
+ readonly name: string;
59
+ readonly motion: Animation3DMotionDefinition;
60
+ readonly speed?: number;
61
+ readonly speedParameter?: string;
62
+ readonly loop?: Animation3DLoopMode;
63
+ }
64
+ export type Animation3DTransitionInterruption = 'none' | 'source' | 'destination' | 'source-then-destination' | 'destination-then-source';
65
+ export interface Animation3DTransitionDefinition {
66
+ readonly id: string;
67
+ /** '*' means any state in the same layer. */
68
+ readonly from: string | '*';
69
+ readonly to: string;
70
+ readonly conditions: readonly Animation3DTransitionCondition[];
71
+ readonly duration: number;
72
+ readonly hasExitTime?: boolean;
73
+ readonly exitTime?: number;
74
+ readonly destinationOffset?: number;
75
+ readonly interruption?: Animation3DTransitionInterruption;
76
+ }
77
+ export interface Animation3DStateMachineLayer {
78
+ readonly id: string;
79
+ readonly name: string;
80
+ readonly initialStateId: string;
81
+ readonly states: readonly Animation3DStateDefinition[];
82
+ /** Declaration order is transition priority. */
83
+ readonly transitions: readonly Animation3DTransitionDefinition[];
84
+ readonly blendMode?: Animation3DBlendMode;
85
+ readonly weight?: number;
86
+ readonly mask?: Animation3DBindingMask;
87
+ }
88
+ /** Serializable definition; controller state is always stored separately. */
89
+ export interface Animation3DStateMachineDefinition {
90
+ readonly format: 'haiyue-animation3d-state-machine@1';
91
+ readonly id: string;
92
+ readonly name: string;
93
+ readonly parameters: readonly Animation3DParameterDefinition[];
94
+ readonly layers: readonly Animation3DStateMachineLayer[];
95
+ }
@@ -0,0 +1,70 @@
1
+ import type { Animation3DClip } from './Animation3DClip.js';
2
+ import { Animation3DMixer } from './Animation3DMixer.js';
3
+ import type { Animation3DMutablePose, Animation3DPose } from './Animation3DPose.js';
4
+ import type { Animation3DStateMachineDefinition } from './Animation3DStateMachine.js';
5
+ declare const COMPILED_ANIMATION3D_STATE_MACHINE: unique symbol;
6
+ /**
7
+ * Opaque compiler output. Compiled nodes and lookup tables are deliberately
8
+ * hidden so validation/compiler internals can evolve without expanding the
9
+ * facade.
10
+ */
11
+ export interface Animation3DCompiledStateMachine {
12
+ readonly format: 'haiyue-animation-state-machine-compiled@1';
13
+ readonly id: string;
14
+ readonly name: string;
15
+ readonly [COMPILED_ANIMATION3D_STATE_MACHINE]: true;
16
+ }
17
+ export type Animation3DStateMachineValidationCode = 'invalid-value' | 'duplicate-id' | 'missing-reference' | 'parameter-type-mismatch' | 'invalid-operator' | 'empty-blend-tree' | 'invalid-thresholds' | 'recursive-motion';
18
+ export interface Animation3DStateMachineValidationIssue {
19
+ readonly code: Animation3DStateMachineValidationCode;
20
+ readonly path: string;
21
+ readonly message: string;
22
+ }
23
+ export declare class Animation3DStateMachineValidationError extends Error {
24
+ readonly issues: readonly Animation3DStateMachineValidationIssue[];
25
+ constructor(issues: readonly Animation3DStateMachineValidationIssue[]);
26
+ }
27
+ export declare function validateAnimation3DStateMachineDefinition(definition: Animation3DStateMachineDefinition): readonly Animation3DStateMachineValidationIssue[];
28
+ export declare function compileAnimation3DStateMachineDefinition(definition: Animation3DStateMachineDefinition): Animation3DCompiledStateMachine;
29
+ export interface Animation3DStateMachineClipResolver {
30
+ resolve(clipId: string): Animation3DClip | null;
31
+ }
32
+ export interface Animation3DStateMachineControllerOptions {
33
+ readonly maxTransitionsPerUpdate?: number;
34
+ }
35
+ export type Animation3DStateMachineControllerStatus = 'active' | 'destroyed';
36
+ export interface Animation3DStateMachineLayerSnapshot {
37
+ readonly layerId: string;
38
+ readonly currentStateId: string;
39
+ readonly currentTime: number;
40
+ readonly transitionId: string | null;
41
+ readonly sourceStateId: string | null;
42
+ readonly destinationStateId: string | null;
43
+ readonly transitionProgress: number;
44
+ }
45
+ /**
46
+ * Public closed-loop controller and minimal Mixer integration.
47
+ *
48
+ * The internal mixer port, action handles, controller transactions and
49
+ * compiled nodes never cross this boundary.
50
+ */
51
+ export declare class Animation3DStateMachineController {
52
+ #private;
53
+ readonly mixer: Animation3DMixer;
54
+ constructor(compiled: Animation3DCompiledStateMachine, mixer: Animation3DMixer, clipResolver: Animation3DStateMachineClipResolver, options?: Animation3DStateMachineControllerOptions);
55
+ get status(): Animation3DStateMachineControllerStatus;
56
+ get time(): number;
57
+ get layerSnapshots(): readonly Animation3DStateMachineLayerSnapshot[];
58
+ getLayerSnapshot(layerId: string): Animation3DStateMachineLayerSnapshot;
59
+ setFloat(name: string, value: number): this;
60
+ setInteger(name: string, value: number): this;
61
+ setBoolean(name: string, value: boolean): this;
62
+ setTrigger(name: string): this;
63
+ resetTrigger(name: string): this;
64
+ getParameter(name: string): number | boolean;
65
+ update(deltaSeconds: number, out: Animation3DMutablePose): Animation3DPose;
66
+ evaluate(out: Animation3DMutablePose): Animation3DPose;
67
+ reset(out: Animation3DMutablePose): Animation3DPose;
68
+ destroy(): void;
69
+ }
70
+ export {};
@@ -0,0 +1,19 @@
1
+ import type { Animation3DBinding } from './Animation3DBinding';
2
+ export type Animation3DInterpolation = 'step' | 'linear' | 'cubic-spline';
3
+ export interface Animation3DTrackFor<TBinding extends Animation3DBinding> {
4
+ readonly id: string;
5
+ readonly binding: TBinding;
6
+ readonly interpolation: Animation3DInterpolation;
7
+ /**
8
+ * Strictly increasing key times in seconds.
9
+ * The clip resource owns the underlying storage; consumers must not mutate it.
10
+ */
11
+ readonly times: Readonly<Float32Array>;
12
+ /**
13
+ * step/linear: keyCount * binding.valueSize values.
14
+ * cubic-spline: keyCount groups of [inTangent, value, outTangent], with each
15
+ * entry containing binding.valueSize values.
16
+ */
17
+ readonly values: Readonly<Float32Array>;
18
+ }
19
+ export type Animation3DTrack = Animation3DTrackFor<Animation3DBinding>;
@@ -0,0 +1,73 @@
1
+ import { Entity } from '@haiyue/engine';
2
+ import { PbrMaterial } from '@haiyue/engine/material';
3
+ import type { Animation3DClip } from '../Animation3DClip';
4
+ import { Animation3DMixer } from '../Animation3DMixer';
5
+ import { Animation3DPoseBuffer } from '../Animation3DPoseBuffer';
6
+ import type { HyaAnimation3DActionGroup, HyaAnimation3DPlayOptions, HyaAnimation3DRuntimeDiagnostics, HyaAnimation3DRuntimeOptions, HyaAnimation3DStateMachineRuntimeControl } from './HyaAnimation3DTypes';
7
+ type RuntimeState = 'active' | 'destroyed';
8
+ /**
9
+ * Optional native-3D HYA owner. The caller must pass an already validated
10
+ * animation-spec payload; no ECS/GPU object is allocated by the parser.
11
+ */
12
+ export declare class HyaAnimation3DRuntime {
13
+ readonly root: Entity;
14
+ readonly mixer: Animation3DMixer;
15
+ readonly pose: Animation3DPoseBuffer;
16
+ private readonly _scene;
17
+ private readonly _payload;
18
+ private readonly _clips;
19
+ private readonly _resources;
20
+ private readonly _entities;
21
+ private readonly _transforms;
22
+ private readonly _materials;
23
+ private readonly _cameras;
24
+ private readonly _models;
25
+ private readonly _mainClips;
26
+ private readonly _modelClips;
27
+ private readonly _modelBindingIds;
28
+ private readonly _actionGroups;
29
+ private readonly _resolver;
30
+ private readonly _poseApplier;
31
+ private readonly _owner;
32
+ private readonly _geometries;
33
+ private readonly _particles;
34
+ private readonly _abortController;
35
+ private readonly _externalSignal;
36
+ private readonly _externalAbortListener;
37
+ private readonly _disposeModel;
38
+ private _state;
39
+ private _initialized;
40
+ private _stateMachine;
41
+ private constructor();
42
+ static create(options: HyaAnimation3DRuntimeOptions): Promise<HyaAnimation3DRuntime>;
43
+ get state(): RuntimeState;
44
+ get initialized(): boolean;
45
+ get clips(): readonly Animation3DClip[];
46
+ get authoredCameraIds(): readonly string[];
47
+ get stateMachine(): HyaAnimation3DStateMachineRuntimeControl | null;
48
+ getEntity(nodeId: string): Entity | null;
49
+ getMaterial(materialId: string): PbrMaterial | null;
50
+ getModelAnimationClips(nodeId: string): readonly Animation3DClip[];
51
+ select(nodeIds: readonly string[]): void;
52
+ useAuthoredCamera(nodeId: string): void;
53
+ playClip(clipId: string, options?: HyaAnimation3DPlayOptions): HyaAnimation3DActionGroup;
54
+ removeActionGroup(group: HyaAnimation3DActionGroup | string): boolean;
55
+ update(deltaSeconds: number): void;
56
+ setTime(timeSeconds: number): void;
57
+ diagnostics(): HyaAnimation3DRuntimeDiagnostics;
58
+ destroy(): void;
59
+ private _initialize;
60
+ private _createMaterials;
61
+ private _createNodes;
62
+ private _createComponent;
63
+ private _attachHierarchy;
64
+ private _loadModels;
65
+ private _buildClipPartitions;
66
+ private _createStateMachineRuntime;
67
+ private _createSceneEndpoint;
68
+ private _matchModelBinding;
69
+ private _addPreviewLights;
70
+ private _assertActive;
71
+ }
72
+ export declare function createHyaAnimation3DRuntime(options: HyaAnimation3DRuntimeOptions): Promise<HyaAnimation3DRuntime>;
73
+ export {};
@@ -0,0 +1,65 @@
1
+ import { ParticleEmitter3D } from '@haiyue/engine/components';
2
+ import type { AnimationStateMachineDefinition } from '../../animation-state-machine/AnimationStateMachine.js';
3
+ import { AnimationStateMachineController, type AnimationStateMachineActionOptions } from '../../animation-state-machine/runtime/index.js';
4
+ import type { Animation3DClip } from '../Animation3DClip.js';
5
+ import type { Animation3DPose } from '../Animation3DPose.js';
6
+ import { Animation3DPoseBuffer } from '../Animation3DPoseBuffer.js';
7
+ import type { Animation3DStateMachineDefinition } from '../Animation3DStateMachine.js';
8
+ import { type Animation3DStateMachineActionRuntimeHandle } from '../runtime/integration/Animation3DStateMachineMixerAdapter.js';
9
+ import { Animation3DMixerRuntime } from '../runtime/mixer/Mixer.js';
10
+ export interface HyaAnimation3DStateMachinePartition {
11
+ readonly id: string;
12
+ readonly mixer: Animation3DMixerRuntime;
13
+ readonly clips: ReadonlyMap<string, Animation3DClip>;
14
+ /** Maps authored HYA binding ids to a model runtime's source binding ids. */
15
+ readonly bindingIds?: ReadonlyMap<string, string>;
16
+ readonly pose?: Animation3DPoseBuffer;
17
+ readonly apply: (pose: Animation3DPose) => void;
18
+ }
19
+ export interface HyaAnimation3DParticleCue {
20
+ readonly key: string;
21
+ readonly emitter: ParticleEmitter3D;
22
+ readonly start: number;
23
+ readonly end: number;
24
+ }
25
+ export interface HyaAnimation3DStateMachineRuntimeOptions {
26
+ readonly definition: AnimationStateMachineDefinition | Animation3DStateMachineDefinition;
27
+ readonly clips: readonly Animation3DClip[];
28
+ readonly partitions: readonly HyaAnimation3DStateMachinePartition[];
29
+ readonly particleCues?: ReadonlyMap<string, readonly HyaAnimation3DParticleCue[]>;
30
+ }
31
+ export declare class HyaAnimation3DStateMachineActionHandle {
32
+ readonly id: string;
33
+ readonly clipId: string;
34
+ readonly duration: number;
35
+ readonly loop: AnimationStateMachineActionOptions['loop'];
36
+ readonly children: readonly Animation3DStateMachineActionRuntimeHandle[];
37
+ readonly activeCueKeys: Set<string>;
38
+ targetTime: number;
39
+ traversal: number;
40
+ playing: boolean;
41
+ destroyed: boolean;
42
+ pendingDestroy: boolean;
43
+ constructor(id: string, clipId: string, duration: number, loop: AnimationStateMachineActionOptions['loop'], children: readonly Animation3DStateMachineActionRuntimeHandle[]);
44
+ }
45
+ /** Coordinates native scene, glTF model and Particle3D channels with one controller transaction. */
46
+ export declare class HyaAnimation3DStateMachineRuntime {
47
+ readonly controller: AnimationStateMachineController<HyaAnimation3DStateMachineActionHandle>;
48
+ private readonly _partitions;
49
+ private readonly _port;
50
+ private _time;
51
+ private _destroyed;
52
+ constructor(options: HyaAnimation3DStateMachineRuntimeOptions);
53
+ get time(): number;
54
+ get liveActionCount(): number;
55
+ get liveBindingCount(): number;
56
+ get sideEffectOwnerCount(): number;
57
+ update(deltaSeconds: number): void;
58
+ evaluate(): void;
59
+ reset(): void;
60
+ destroy(): void;
61
+ private _runFrame;
62
+ private _openFrames;
63
+ private _cancelFrames;
64
+ private _requireActive;
65
+ }