@vgai/engine 0.5.5 → 0.5.7

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 (446) hide show
  1. package/dist/adapter/adapter-surface.d.ts +30 -0
  2. package/dist/adapter/adapter-surface.d.ts.map +1 -0
  3. package/dist/adapter/adapter-surface.js +18 -0
  4. package/dist/adapter/authoring.d.ts +597 -0
  5. package/dist/adapter/authoring.d.ts.map +1 -0
  6. package/dist/adapter/authoring.js +22 -0
  7. package/dist/adapter/colyseus-networking-adapter.d.ts +77 -0
  8. package/dist/adapter/colyseus-networking-adapter.d.ts.map +1 -0
  9. package/dist/adapter/colyseus-networking-adapter.js +76 -0
  10. package/dist/adapter/first-party-systems.d.ts +23 -0
  11. package/dist/adapter/first-party-systems.d.ts.map +1 -0
  12. package/dist/adapter/first-party-systems.js +196 -0
  13. package/dist/adapter/host-context.d.ts +194 -0
  14. package/dist/adapter/host-context.d.ts.map +1 -0
  15. package/dist/adapter/host-context.js +80 -0
  16. package/dist/adapter/index.d.ts +33 -0
  17. package/dist/adapter/index.d.ts.map +1 -0
  18. package/dist/adapter/index.js +25 -0
  19. package/dist/adapter/ingest/game-contract.d.ts +53 -0
  20. package/dist/adapter/ingest/game-contract.d.ts.map +1 -0
  21. package/dist/adapter/ingest/game-contract.js +30 -0
  22. package/dist/adapter/ingest/scene-capture.d.ts +121 -0
  23. package/dist/adapter/ingest/scene-capture.d.ts.map +1 -0
  24. package/dist/adapter/ingest/scene-capture.js +270 -0
  25. package/dist/adapter/ingest/structural-ids.d.ts +64 -0
  26. package/dist/adapter/ingest/structural-ids.d.ts.map +1 -0
  27. package/dist/adapter/ingest/structural-ids.js +110 -0
  28. package/dist/adapter/ingest/upstream-pin.d.ts +44 -0
  29. package/dist/adapter/ingest/upstream-pin.d.ts.map +1 -0
  30. package/dist/adapter/ingest/upstream-pin.js +47 -0
  31. package/dist/adapter/loop-gate-report.d.ts +34 -0
  32. package/dist/adapter/loop-gate-report.d.ts.map +1 -0
  33. package/dist/adapter/loop-gate-report.js +37 -0
  34. package/dist/adapter/rapier-physics-adapter.d.ts +69 -0
  35. package/dist/adapter/rapier-physics-adapter.d.ts.map +1 -0
  36. package/dist/adapter/rapier-physics-adapter.js +135 -0
  37. package/dist/adapter/root-adapter.d.ts +195 -0
  38. package/dist/adapter/root-adapter.d.ts.map +1 -0
  39. package/dist/adapter/root-adapter.js +25 -0
  40. package/dist/adapter/setup-three-root-adapter.d.ts +87 -0
  41. package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -0
  42. package/dist/adapter/setup-three-root-adapter.js +791 -0
  43. package/dist/adapter/system-adapter.d.ts +453 -0
  44. package/dist/adapter/system-adapter.d.ts.map +1 -0
  45. package/dist/adapter/system-adapter.js +13 -0
  46. package/dist/adapter/transform.d.ts +18 -0
  47. package/dist/adapter/transform.d.ts.map +1 -0
  48. package/dist/adapter/transform.js +1 -0
  49. package/dist/ai/navigation.d.ts +78 -0
  50. package/dist/ai/navigation.d.ts.map +1 -0
  51. package/dist/ai/navigation.js +152 -0
  52. package/dist/animation/anim-graph-types.d.ts +25 -0
  53. package/dist/animation/anim-graph-types.d.ts.map +1 -0
  54. package/dist/animation/anim-graph-types.js +1 -0
  55. package/dist/animation/animation-clock.d.ts +213 -0
  56. package/dist/animation/animation-clock.d.ts.map +1 -0
  57. package/dist/animation/animation-clock.js +301 -0
  58. package/dist/animation/blend-node.d.ts +22 -0
  59. package/dist/animation/blend-node.d.ts.map +1 -0
  60. package/dist/animation/blend-node.js +97 -0
  61. package/dist/animation/camera-ownership.d.ts +249 -0
  62. package/dist/animation/camera-ownership.d.ts.map +1 -0
  63. package/dist/animation/camera-ownership.js +169 -0
  64. package/dist/animation/cinematic-cues.d.ts +200 -0
  65. package/dist/animation/cinematic-cues.d.ts.map +1 -0
  66. package/dist/animation/cinematic-cues.js +213 -0
  67. package/dist/animation/clip-map.d.ts +12 -0
  68. package/dist/animation/clip-map.d.ts.map +1 -0
  69. package/dist/animation/clip-map.js +31 -0
  70. package/dist/animation/cubic-spline-interpolant.d.ts +54 -0
  71. package/dist/animation/cubic-spline-interpolant.d.ts.map +1 -0
  72. package/dist/animation/cubic-spline-interpolant.js +111 -0
  73. package/dist/animation/theatre-clock-binding.d.ts +89 -0
  74. package/dist/animation/theatre-clock-binding.d.ts.map +1 -0
  75. package/dist/animation/theatre-clock-binding.js +29 -0
  76. package/dist/animation/theatre-director.d.ts +277 -0
  77. package/dist/animation/theatre-director.d.ts.map +1 -0
  78. package/dist/animation/theatre-director.js +248 -0
  79. package/dist/animation/theatre-object-binding.d.ts +305 -0
  80. package/dist/animation/theatre-object-binding.d.ts.map +1 -0
  81. package/dist/animation/theatre-object-binding.js +351 -0
  82. package/dist/animation/xstate-animation-binding.d.ts +119 -0
  83. package/dist/animation/xstate-animation-binding.d.ts.map +1 -0
  84. package/dist/animation/xstate-animation-binding.js +349 -0
  85. package/dist/animation/xstate-animation-meta.d.ts +266 -0
  86. package/dist/animation/xstate-animation-meta.d.ts.map +1 -0
  87. package/dist/animation/xstate-animation-meta.js +252 -0
  88. package/dist/asset-formats/camera.d.ts +15 -0
  89. package/dist/asset-formats/camera.d.ts.map +1 -0
  90. package/dist/asset-formats/camera.js +15 -0
  91. package/dist/asset-formats/collider.d.ts +21 -0
  92. package/dist/asset-formats/collider.d.ts.map +1 -0
  93. package/dist/asset-formats/collider.js +53 -0
  94. package/dist/asset-formats/index.d.ts +46 -0
  95. package/dist/asset-formats/index.d.ts.map +1 -0
  96. package/dist/asset-formats/index.js +36 -0
  97. package/dist/asset-formats/instances.d.ts +17 -0
  98. package/dist/asset-formats/instances.d.ts.map +1 -0
  99. package/dist/asset-formats/instances.js +31 -0
  100. package/dist/asset-formats/light.d.ts +21 -0
  101. package/dist/asset-formats/light.d.ts.map +1 -0
  102. package/dist/asset-formats/light.js +35 -0
  103. package/dist/asset-formats/material.d.ts +129 -0
  104. package/dist/asset-formats/material.d.ts.map +1 -0
  105. package/dist/asset-formats/material.js +88 -0
  106. package/dist/asset-formats/mesh.d.ts +22 -0
  107. package/dist/asset-formats/mesh.d.ts.map +1 -0
  108. package/dist/asset-formats/mesh.js +64 -0
  109. package/dist/asset-formats/parse.d.ts +20 -0
  110. package/dist/asset-formats/parse.d.ts.map +1 -0
  111. package/dist/asset-formats/parse.js +34 -0
  112. package/dist/asset-formats/particles.d.ts +1390 -0
  113. package/dist/asset-formats/particles.d.ts.map +1 -0
  114. package/dist/asset-formats/particles.js +319 -0
  115. package/dist/asset-formats/render-env.d.ts +387 -0
  116. package/dist/asset-formats/render-env.d.ts.map +1 -0
  117. package/dist/asset-formats/render-env.js +300 -0
  118. package/dist/asset-formats/tuples.d.ts +12 -0
  119. package/dist/asset-formats/tuples.d.ts.map +1 -0
  120. package/dist/asset-formats/tuples.js +14 -0
  121. package/dist/asset-loaders.d.ts +97 -0
  122. package/dist/asset-loaders.d.ts.map +1 -0
  123. package/dist/asset-loaders.js +209 -0
  124. package/dist/asset-parse-error.d.ts +24 -0
  125. package/dist/asset-parse-error.d.ts.map +1 -0
  126. package/dist/asset-parse-error.js +29 -0
  127. package/dist/asset-registry.d.ts +38 -0
  128. package/dist/asset-registry.d.ts.map +1 -0
  129. package/dist/asset-registry.js +66 -0
  130. package/dist/assets.d.ts +26 -0
  131. package/dist/assets.d.ts.map +1 -0
  132. package/dist/assets.js +55 -0
  133. package/dist/audio/wav-encode.d.ts +38 -0
  134. package/dist/audio/wav-encode.d.ts.map +1 -0
  135. package/dist/audio/wav-encode.js +97 -0
  136. package/dist/canvas-react/engine-bridge.d.ts +45 -0
  137. package/dist/canvas-react/engine-bridge.d.ts.map +1 -0
  138. package/dist/canvas-react/engine-bridge.js +45 -0
  139. package/dist/canvas-react/index.d.ts +42 -0
  140. package/dist/canvas-react/index.d.ts.map +1 -0
  141. package/dist/canvas-react/index.js +41 -0
  142. package/dist/canvas-react/pixi-primitive.d.ts +85 -0
  143. package/dist/canvas-react/pixi-primitive.d.ts.map +1 -0
  144. package/dist/canvas-react/pixi-primitive.js +181 -0
  145. package/dist/canvas-react/pixi-react-adapter.d.ts +71 -0
  146. package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -0
  147. package/dist/canvas-react/pixi-react-adapter.js +229 -0
  148. package/dist/canvas-react/pixi-react-root-factory.d.ts +56 -0
  149. package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -0
  150. package/dist/canvas-react/pixi-react-root-factory.js +73 -0
  151. package/dist/canvas-react/world-context.d.ts +88 -0
  152. package/dist/canvas-react/world-context.d.ts.map +1 -0
  153. package/dist/canvas-react/world-context.js +212 -0
  154. package/dist/config.d.ts +9 -0
  155. package/dist/config.d.ts.map +1 -0
  156. package/dist/config.js +8 -0
  157. package/dist/core/frame-pacing.d.ts +90 -0
  158. package/dist/core/frame-pacing.d.ts.map +1 -0
  159. package/dist/core/frame-pacing.js +89 -0
  160. package/dist/core/game-loop.d.ts +62 -0
  161. package/dist/core/game-loop.d.ts.map +1 -0
  162. package/dist/core/game-loop.js +189 -0
  163. package/dist/core/seeded-random.d.ts +69 -0
  164. package/dist/core/seeded-random.d.ts.map +1 -0
  165. package/dist/core/seeded-random.js +121 -0
  166. package/dist/core/sim-clock.d.ts +199 -0
  167. package/dist/core/sim-clock.d.ts.map +1 -0
  168. package/dist/core/sim-clock.js +291 -0
  169. package/dist/core/system-runner.d.ts +96 -0
  170. package/dist/core/system-runner.d.ts.map +1 -0
  171. package/dist/core/system-runner.js +253 -0
  172. package/dist/core/types.d.ts +111 -0
  173. package/dist/core/types.d.ts.map +1 -0
  174. package/dist/core/types.js +25 -0
  175. package/dist/data/data-asset.d.ts +101 -0
  176. package/dist/data/data-asset.d.ts.map +1 -0
  177. package/dist/data/data-asset.js +122 -0
  178. package/dist/data/data-check-core.d.ts +109 -0
  179. package/dist/data/data-check-core.d.ts.map +1 -0
  180. package/dist/data/data-check-core.js +177 -0
  181. package/dist/data/data-ref.d.ts +79 -0
  182. package/dist/data/data-ref.d.ts.map +1 -0
  183. package/dist/data/data-ref.js +130 -0
  184. package/dist/data/vite-plugin-data.d.ts +79 -0
  185. package/dist/data/vite-plugin-data.d.ts.map +1 -0
  186. package/dist/data/vite-plugin-data.js +217 -0
  187. package/dist/defaults.d.ts +233 -0
  188. package/dist/defaults.d.ts.map +1 -0
  189. package/dist/defaults.js +137 -0
  190. package/dist/dev/chrome-trace.d.ts +45 -0
  191. package/dist/dev/chrome-trace.d.ts.map +1 -0
  192. package/dist/dev/chrome-trace.js +114 -0
  193. package/dist/dev/console-bridge.d.ts +22 -0
  194. package/dist/dev/console-bridge.d.ts.map +1 -0
  195. package/dist/dev/console-bridge.js +71 -0
  196. package/dist/dev/debug-draw.d.ts +24 -0
  197. package/dist/dev/debug-draw.d.ts.map +1 -0
  198. package/dist/dev/debug-draw.js +73 -0
  199. package/dist/dev/instruments.d.ts +133 -0
  200. package/dist/dev/instruments.d.ts.map +1 -0
  201. package/dist/dev/instruments.js +231 -0
  202. package/dist/dev/logger.d.ts +30 -0
  203. package/dist/dev/logger.d.ts.map +1 -0
  204. package/dist/dev/logger.js +90 -0
  205. package/dist/dev/performance-profiler.d.ts +111 -0
  206. package/dist/dev/performance-profiler.d.ts.map +1 -0
  207. package/dist/dev/performance-profiler.js +215 -0
  208. package/dist/dev/render-debug-adapter.d.ts +57 -0
  209. package/dist/dev/render-debug-adapter.d.ts.map +1 -0
  210. package/dist/dev/render-debug-adapter.js +141 -0
  211. package/dist/dev/render-memory.d.ts +53 -0
  212. package/dist/dev/render-memory.d.ts.map +1 -0
  213. package/dist/dev/render-memory.js +190 -0
  214. package/dist/dev/webgl-frame-capture.d.ts +134 -0
  215. package/dist/dev/webgl-frame-capture.d.ts.map +1 -0
  216. package/dist/dev/webgl-frame-capture.js +270 -0
  217. package/dist/dev/webgl-gpu-timer.d.ts +8 -0
  218. package/dist/dev/webgl-gpu-timer.d.ts.map +1 -0
  219. package/dist/dev/webgl-gpu-timer.js +52 -0
  220. package/dist/ecs/scene-index.d.ts +179 -0
  221. package/dist/ecs/scene-index.d.ts.map +1 -0
  222. package/dist/ecs/scene-index.js +331 -0
  223. package/dist/ecs/scene-query.d.ts +6 -0
  224. package/dist/ecs/scene-query.d.ts.map +1 -0
  225. package/dist/ecs/scene-query.js +40 -0
  226. package/dist/ecs/user-data.d.ts +193 -0
  227. package/dist/ecs/user-data.d.ts.map +1 -0
  228. package/dist/ecs/user-data.js +145 -0
  229. package/dist/index.d.ts +35 -0
  230. package/dist/index.d.ts.map +1 -0
  231. package/dist/index.js +29 -0
  232. package/dist/input/input-manager.d.ts +944 -0
  233. package/dist/input/input-manager.d.ts.map +1 -0
  234. package/dist/input/input-manager.js +2209 -0
  235. package/dist/input/input-types.d.ts +174 -0
  236. package/dist/input/input-types.d.ts.map +1 -0
  237. package/dist/input/input-types.js +1 -0
  238. package/dist/input/prompt-labels.d.ts +21 -0
  239. package/dist/input/prompt-labels.d.ts.map +1 -0
  240. package/dist/input/prompt-labels.js +121 -0
  241. package/dist/input/rebind-controller.d.ts +59 -0
  242. package/dist/input/rebind-controller.d.ts.map +1 -0
  243. package/dist/input/rebind-controller.js +85 -0
  244. package/dist/input/schema.d.ts +16 -0
  245. package/dist/input/schema.d.ts.map +1 -0
  246. package/dist/input/schema.js +228 -0
  247. package/dist/loader.d.ts +76 -0
  248. package/dist/loader.d.ts.map +1 -0
  249. package/dist/loader.js +114 -0
  250. package/dist/manifest/editor-port.d.ts +53 -0
  251. package/dist/manifest/editor-port.d.ts.map +1 -0
  252. package/dist/manifest/editor-port.js +67 -0
  253. package/dist/manifest/filename.d.ts +14 -0
  254. package/dist/manifest/filename.d.ts.map +1 -0
  255. package/dist/manifest/filename.js +43 -0
  256. package/dist/manifest/index.d.ts +6 -0
  257. package/dist/manifest/index.d.ts.map +1 -0
  258. package/dist/manifest/index.js +9 -0
  259. package/dist/manifest/load-file.d.ts +7 -0
  260. package/dist/manifest/load-file.d.ts.map +1 -0
  261. package/dist/manifest/load-file.js +23 -0
  262. package/dist/manifest/load.d.ts +161 -0
  263. package/dist/manifest/load.d.ts.map +1 -0
  264. package/dist/manifest/load.js +269 -0
  265. package/dist/manifest/locate.d.ts +24 -0
  266. package/dist/manifest/locate.d.ts.map +1 -0
  267. package/dist/manifest/locate.js +48 -0
  268. package/dist/manifest/schema.d.ts +293 -0
  269. package/dist/manifest/schema.d.ts.map +1 -0
  270. package/dist/manifest/schema.js +633 -0
  271. package/dist/physics/collider-dimensions.d.ts +63 -0
  272. package/dist/physics/collider-dimensions.d.ts.map +1 -0
  273. package/dist/physics/collider-dimensions.js +98 -0
  274. package/dist/physics/collision-system.d.ts +41 -0
  275. package/dist/physics/collision-system.d.ts.map +1 -0
  276. package/dist/physics/collision-system.js +64 -0
  277. package/dist/physics/physics-registry.d.ts +45 -0
  278. package/dist/physics/physics-registry.d.ts.map +1 -0
  279. package/dist/physics/physics-registry.js +65 -0
  280. package/dist/physics/transform-writer.d.ts +16 -0
  281. package/dist/physics/transform-writer.d.ts.map +1 -0
  282. package/dist/physics/transform-writer.js +38 -0
  283. package/dist/pixi/authoring.d.ts +93 -0
  284. package/dist/pixi/authoring.d.ts.map +1 -0
  285. package/dist/pixi/authoring.js +207 -0
  286. package/dist/pixi/index.d.ts +16 -0
  287. package/dist/pixi/index.d.ts.map +1 -0
  288. package/dist/pixi/index.js +15 -0
  289. package/dist/pixi/ingest-iframe.d.ts +82 -0
  290. package/dist/pixi/ingest-iframe.d.ts.map +1 -0
  291. package/dist/pixi/ingest-iframe.js +166 -0
  292. package/dist/pixi/ingest.d.ts +97 -0
  293. package/dist/pixi/ingest.d.ts.map +1 -0
  294. package/dist/pixi/ingest.js +40 -0
  295. package/dist/pixi/physics-registry.d.ts +24 -0
  296. package/dist/pixi/physics-registry.d.ts.map +1 -0
  297. package/dist/pixi/physics-registry.js +38 -0
  298. package/dist/pixi/scene-capture.d.ts +43 -0
  299. package/dist/pixi/scene-capture.d.ts.map +1 -0
  300. package/dist/pixi/scene-capture.js +92 -0
  301. package/dist/pixi/system-adapters.d.ts +16 -0
  302. package/dist/pixi/system-adapters.d.ts.map +1 -0
  303. package/dist/pixi/system-adapters.js +37 -0
  304. package/dist/react/unmanaged-root-detector.d.ts +18 -0
  305. package/dist/react/unmanaged-root-detector.d.ts.map +1 -0
  306. package/dist/react/unmanaged-root-detector.js +70 -0
  307. package/dist/react/use-data.d.ts +60 -0
  308. package/dist/react/use-data.d.ts.map +1 -0
  309. package/dist/react/use-data.js +101 -0
  310. package/dist/react/use-selection.d.ts +54 -0
  311. package/dist/react/use-selection.d.ts.map +1 -0
  312. package/dist/react/use-selection.js +71 -0
  313. package/dist/react/world-state.d.ts +154 -0
  314. package/dist/react/world-state.d.ts.map +1 -0
  315. package/dist/react/world-state.js +220 -0
  316. package/dist/render/auto-batcher.d.ts +34 -0
  317. package/dist/render/auto-batcher.d.ts.map +1 -0
  318. package/dist/render/auto-batcher.js +140 -0
  319. package/dist/render/instance-mesh.d.ts +5 -0
  320. package/dist/render/instance-mesh.d.ts.map +1 -0
  321. package/dist/render/instance-mesh.js +19 -0
  322. package/dist/render/light-camera-factory.d.ts +24 -0
  323. package/dist/render/light-camera-factory.d.ts.map +1 -0
  324. package/dist/render/light-camera-factory.js +71 -0
  325. package/dist/render/lod.d.ts +13 -0
  326. package/dist/render/lod.d.ts.map +1 -0
  327. package/dist/render/lod.js +16 -0
  328. package/dist/render/material-factory.d.ts +15 -0
  329. package/dist/render/material-factory.d.ts.map +1 -0
  330. package/dist/render/material-factory.js +186 -0
  331. package/dist/render/mesh-shadow.d.ts +11 -0
  332. package/dist/render/mesh-shadow.d.ts.map +1 -0
  333. package/dist/render/mesh-shadow.js +19 -0
  334. package/dist/render/particles-factory.d.ts +99 -0
  335. package/dist/render/particles-factory.d.ts.map +1 -0
  336. package/dist/render/particles-factory.js +361 -0
  337. package/dist/render/render-batch-system.d.ts +33 -0
  338. package/dist/render/render-batch-system.d.ts.map +1 -0
  339. package/dist/render/render-batch-system.js +223 -0
  340. package/dist/render/render-features.d.ts +47 -0
  341. package/dist/render/render-features.d.ts.map +1 -0
  342. package/dist/render/render-features.js +105 -0
  343. package/dist/render/render-settings.d.ts +35 -0
  344. package/dist/render/render-settings.d.ts.map +1 -0
  345. package/dist/render/render-settings.js +51 -0
  346. package/dist/render/spark-renderer-lifecycle.d.ts +18 -0
  347. package/dist/render/spark-renderer-lifecycle.d.ts.map +1 -0
  348. package/dist/render/spark-renderer-lifecycle.js +57 -0
  349. package/dist/render/viewport-shading.d.ts +17 -0
  350. package/dist/render/viewport-shading.d.ts.map +1 -0
  351. package/dist/render/viewport-shading.js +87 -0
  352. package/dist/runtime/create-runtime.d.ts +259 -0
  353. package/dist/runtime/create-runtime.d.ts.map +1 -0
  354. package/dist/runtime/create-runtime.js +666 -0
  355. package/dist/runtime/debug-bridge.d.ts +288 -0
  356. package/dist/runtime/debug-bridge.d.ts.map +1 -0
  357. package/dist/runtime/debug-bridge.js +277 -0
  358. package/dist/runtime/debug-registry.d.ts +287 -0
  359. package/dist/runtime/debug-registry.d.ts.map +1 -0
  360. package/dist/runtime/debug-registry.js +528 -0
  361. package/dist/runtime/dev-layers.d.ts +34 -0
  362. package/dist/runtime/dev-layers.d.ts.map +1 -0
  363. package/dist/runtime/dev-layers.js +40 -0
  364. package/dist/runtime/frame-selector-cache.d.ts +41 -0
  365. package/dist/runtime/frame-selector-cache.d.ts.map +1 -0
  366. package/dist/runtime/frame-selector-cache.js +65 -0
  367. package/dist/runtime/game.d.ts +576 -0
  368. package/dist/runtime/game.d.ts.map +1 -0
  369. package/dist/runtime/game.js +1003 -0
  370. package/dist/runtime/gameplay-rng-trap.d.ts +47 -0
  371. package/dist/runtime/gameplay-rng-trap.d.ts.map +1 -0
  372. package/dist/runtime/gameplay-rng-trap.js +95 -0
  373. package/dist/runtime/input-router.d.ts +78 -0
  374. package/dist/runtime/input-router.d.ts.map +1 -0
  375. package/dist/runtime/input-router.js +171 -0
  376. package/dist/runtime/mount-game.d.ts +126 -0
  377. package/dist/runtime/mount-game.d.ts.map +1 -0
  378. package/dist/runtime/mount-game.js +159 -0
  379. package/dist/runtime/mount-manifest.d.ts +174 -0
  380. package/dist/runtime/mount-manifest.d.ts.map +1 -0
  381. package/dist/runtime/mount-manifest.js +304 -0
  382. package/dist/runtime/presentation.d.ts +85 -0
  383. package/dist/runtime/presentation.d.ts.map +1 -0
  384. package/dist/runtime/presentation.js +92 -0
  385. package/dist/runtime/render-audio-control.d.ts +126 -0
  386. package/dist/runtime/render-audio-control.d.ts.map +1 -0
  387. package/dist/runtime/render-audio-control.js +116 -0
  388. package/dist/runtime/render-control.d.ts +347 -0
  389. package/dist/runtime/render-control.d.ts.map +1 -0
  390. package/dist/runtime/render-control.js +317 -0
  391. package/dist/runtime/render-seed.d.ts +56 -0
  392. package/dist/runtime/render-seed.d.ts.map +1 -0
  393. package/dist/runtime/render-seed.js +73 -0
  394. package/dist/runtime/state-bridge.d.ts +60 -0
  395. package/dist/runtime/state-bridge.d.ts.map +1 -0
  396. package/dist/runtime/state-bridge.js +62 -0
  397. package/dist/runtime/types.d.ts +285 -0
  398. package/dist/runtime/types.d.ts.map +1 -0
  399. package/dist/runtime/types.js +1 -0
  400. package/dist/runtime/unexported-game-trap.d.ts +36 -0
  401. package/dist/runtime/unexported-game-trap.d.ts.map +1 -0
  402. package/dist/runtime/unexported-game-trap.js +80 -0
  403. package/dist/setup/setup-audio.d.ts +20 -0
  404. package/dist/setup/setup-audio.d.ts.map +1 -0
  405. package/dist/setup/setup-audio.js +41 -0
  406. package/dist/setup/setup-particles.d.ts +17 -0
  407. package/dist/setup/setup-particles.d.ts.map +1 -0
  408. package/dist/setup/setup-particles.js +16 -0
  409. package/dist/setup/setup-physics.d.ts +25 -0
  410. package/dist/setup/setup-physics.d.ts.map +1 -0
  411. package/dist/setup/setup-physics.js +51 -0
  412. package/dist/setup/setup-renderer.d.ts +82 -0
  413. package/dist/setup/setup-renderer.d.ts.map +1 -0
  414. package/dist/setup/setup-renderer.js +381 -0
  415. package/dist/world3d-react/engine-bridge.d.ts +47 -0
  416. package/dist/world3d-react/engine-bridge.d.ts.map +1 -0
  417. package/dist/world3d-react/engine-bridge.js +48 -0
  418. package/dist/world3d-react/index.d.ts +47 -0
  419. package/dist/world3d-react/index.d.ts.map +1 -0
  420. package/dist/world3d-react/index.js +46 -0
  421. package/dist/world3d-react/r3f-adapter.d.ts +51 -0
  422. package/dist/world3d-react/r3f-adapter.d.ts.map +1 -0
  423. package/dist/world3d-react/r3f-adapter.js +368 -0
  424. package/dist/world3d-react/r3f-root-factory.d.ts +62 -0
  425. package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -0
  426. package/dist/world3d-react/r3f-root-factory.js +79 -0
  427. package/dist/world3d-react/rapier-physics-bridge.d.ts +76 -0
  428. package/dist/world3d-react/rapier-physics-bridge.d.ts.map +1 -0
  429. package/dist/world3d-react/rapier-physics-bridge.js +120 -0
  430. package/dist/world3d-react/renderer-config.d.ts +58 -0
  431. package/dist/world3d-react/renderer-config.d.ts.map +1 -0
  432. package/dist/world3d-react/renderer-config.js +96 -0
  433. package/dist/world3d-react/world-context.d.ts +123 -0
  434. package/dist/world3d-react/world-context.d.ts.map +1 -0
  435. package/dist/world3d-react/world-context.js +204 -0
  436. package/dist-config/config.js +303 -0
  437. package/dist-config/config.js.map +7 -0
  438. package/package.json +14 -3
  439. package/src/adapter/rapier-physics-adapter.ts +77 -34
  440. package/src/config.ts +8 -0
  441. package/src/core/frame-pacing.ts +26 -0
  442. package/src/core/game-loop.ts +4 -3
  443. package/src/dev/instruments.ts +302 -0
  444. package/src/setup/setup-renderer.ts +2 -0
  445. package/src/world3d-react/index.ts +9 -0
  446. package/src/world3d-react/rapier-physics-bridge.tsx +137 -0
@@ -0,0 +1,54 @@
1
+ /**
2
+ * The glTF CUBICSPLINE interpolant, and the factory that installs it on a
3
+ * `KeyframeTrack`.
4
+ *
5
+ * `GLTFLoader` has both of these and exports NEITHER — `GLTFCubicSplineInterpolant`
6
+ * and `_createCubicSplineTrackInterpolant` are module-private. Anything that
7
+ * builds a CUBICSPLINE track without going through a GLB parse therefore has
8
+ * to supply them, and the D25 migration does exactly that: it bakes Theatre's
9
+ * bezier easing into tangent triples, and a track carrying triples without the
10
+ * interpolant reads as three times as many components and plays garbage.
11
+ *
12
+ * The flag is also load-bearing on the way OUT. `GLTFExporter` decides a track
13
+ * is CUBICSPLINE by testing `isInterpolantFactoryMethodGLTFCubicSpline` and
14
+ * nothing else (`GLTFExporter.js:2252`), so a baked track without it exports
15
+ * as LINEAR over tangent triples — silently wrong. Installing it is what makes
16
+ * a converted clip round-trip through the industry format instead of needing
17
+ * one of ours.
18
+ *
19
+ * This is a port of Three's own algorithm, not an abstraction over it — the
20
+ * math below is theirs, kept deliberately line-comparable to
21
+ * `GLTFLoader.js`'s `GLTFCubicSplineInterpolant.interpolate_` so a future
22
+ * upstream fix is a readable diff. It exists because of a missing export, and
23
+ * should be deleted the day Three publishes one.
24
+ *
25
+ * Layout, which is the whole reason this is subtle:
26
+ *
27
+ * [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, … ]
28
+ *
29
+ * so `track.getValueSize()` reports 3x the component count and
30
+ * `track.getInterpolation()` returns undefined (Three's enum cannot name a
31
+ * custom interpolant). The `isInterpolantFactoryMethodGLTFCubicSpline` flag on
32
+ * the factory is the only marker, and it is what the editor's authoring
33
+ * projection keys off — see `three-animation-authoring.ts`'s `trackLayout`.
34
+ */
35
+ import * as THREE from 'three';
36
+ /** Hermite evaluation over glTF's `[inTangent, vertex, outTangent]` triples. */
37
+ export declare class CubicSplineInterpolant extends THREE.Interpolant {
38
+ copySampleValue_(index: number): Float32Array | number[];
39
+ interpolate_(i1: number, t0: number, t: number, t1: number): Float32Array | number[];
40
+ }
41
+ /** Quaternion tracks renormalize after the Hermite blend, as glTF requires. */
42
+ export declare class CubicSplineQuaternionInterpolant extends CubicSplineInterpolant {
43
+ interpolate_(i1: number, t0: number, t: number, t1: number): Float32Array | number[];
44
+ }
45
+ /**
46
+ * Install the CUBICSPLINE interpolant on a track whose values are tangent
47
+ * triples — byte-identical in effect to what `GLTFLoader` does to a track it
48
+ * parses from a GLB, so a track from an authored file and a track from a GLB
49
+ * are indistinguishable downstream.
50
+ */
51
+ export declare function installCubicSplineInterpolant(track: THREE.KeyframeTrack): THREE.KeyframeTrack;
52
+ /** True when `track` carries glTF tangent triples rather than plain values. */
53
+ export declare function isCubicSplineTrack(track: THREE.KeyframeTrack): boolean;
54
+ //# sourceMappingURL=cubic-spline-interpolant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cubic-spline-interpolant.d.ts","sourceRoot":"","sources":["../../src/animation/cubic-spline-interpolant.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,gFAAgF;AAChF,qBAAa,sBAAuB,SAAQ,KAAK,CAAC,WAAW;IAC3D,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,EAAE;IAYxD,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,EAAE;CA8BrF;AAID,+EAA+E;AAC/E,qBAAa,gCAAiC,SAAQ,sBAAsB;IACjE,YAAY,CAAC,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,MAAM,EAAE;CAQ9F;AAQD;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,GAAG,KAAK,CAAC,aAAa,CAe7F;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,CAAC,aAAa,GAAG,OAAO,CAItE"}
@@ -0,0 +1,111 @@
1
+ /**
2
+ * The glTF CUBICSPLINE interpolant, and the factory that installs it on a
3
+ * `KeyframeTrack`.
4
+ *
5
+ * `GLTFLoader` has both of these and exports NEITHER — `GLTFCubicSplineInterpolant`
6
+ * and `_createCubicSplineTrackInterpolant` are module-private. Anything that
7
+ * builds a CUBICSPLINE track without going through a GLB parse therefore has
8
+ * to supply them, and the D25 migration does exactly that: it bakes Theatre's
9
+ * bezier easing into tangent triples, and a track carrying triples without the
10
+ * interpolant reads as three times as many components and plays garbage.
11
+ *
12
+ * The flag is also load-bearing on the way OUT. `GLTFExporter` decides a track
13
+ * is CUBICSPLINE by testing `isInterpolantFactoryMethodGLTFCubicSpline` and
14
+ * nothing else (`GLTFExporter.js:2252`), so a baked track without it exports
15
+ * as LINEAR over tangent triples — silently wrong. Installing it is what makes
16
+ * a converted clip round-trip through the industry format instead of needing
17
+ * one of ours.
18
+ *
19
+ * This is a port of Three's own algorithm, not an abstraction over it — the
20
+ * math below is theirs, kept deliberately line-comparable to
21
+ * `GLTFLoader.js`'s `GLTFCubicSplineInterpolant.interpolate_` so a future
22
+ * upstream fix is a readable diff. It exists because of a missing export, and
23
+ * should be deleted the day Three publishes one.
24
+ *
25
+ * Layout, which is the whole reason this is subtle:
26
+ *
27
+ * [ inTangent_1, splineVertex_1, outTangent_1, inTangent_2, splineVertex_2, … ]
28
+ *
29
+ * so `track.getValueSize()` reports 3x the component count and
30
+ * `track.getInterpolation()` returns undefined (Three's enum cannot name a
31
+ * custom interpolant). The `isInterpolantFactoryMethodGLTFCubicSpline` flag on
32
+ * the factory is the only marker, and it is what the editor's authoring
33
+ * projection keys off — see `three-animation-authoring.ts`'s `trackLayout`.
34
+ */
35
+ import * as THREE from 'three';
36
+ /** Hermite evaluation over glTF's `[inTangent, vertex, outTangent]` triples. */
37
+ export class CubicSplineInterpolant extends THREE.Interpolant {
38
+ copySampleValue_(index) {
39
+ const result = this.resultBuffer;
40
+ const values = this.sampleValues;
41
+ const valueSize = this.valueSize;
42
+ // The VERTEX sits one component-stride into its triple.
43
+ const offset = index * valueSize * 3 + valueSize;
44
+ for (let i = 0; i !== valueSize; i++)
45
+ result[i] = values[offset + i];
46
+ return result;
47
+ }
48
+ // Not `override`: Three's published typings do not declare `interpolate_`,
49
+ // though every built-in interpolant implements it.
50
+ interpolate_(i1, t0, t, t1) {
51
+ const result = this.resultBuffer;
52
+ const values = this.sampleValues;
53
+ const stride = this.valueSize;
54
+ const stride2 = stride * 2;
55
+ const stride3 = stride * 3;
56
+ const td = t1 - t0;
57
+ const p = (t - t0) / td;
58
+ const pp = p * p;
59
+ const ppp = pp * p;
60
+ const offset1 = i1 * stride3;
61
+ const offset0 = offset1 - stride3;
62
+ const s2 = -2 * ppp + 3 * pp;
63
+ const s3 = ppp - pp;
64
+ const s0 = 1 - s2;
65
+ const s1 = s3 - pp + p;
66
+ for (let i = 0; i !== stride; i++) {
67
+ const p0 = values[offset0 + i + stride]; // splineVertex_k
68
+ const m0 = values[offset0 + i + stride2] * td; // outTangent_k · Δt
69
+ const p1 = values[offset1 + i + stride]; // splineVertex_k+1
70
+ const m1 = values[offset1 + i] * td; // inTangent_k+1 · Δt
71
+ result[i] = s0 * p0 + s1 * m0 + s2 * p1 + s3 * m1;
72
+ }
73
+ return result;
74
+ }
75
+ }
76
+ const _quaternion = new THREE.Quaternion();
77
+ /** Quaternion tracks renormalize after the Hermite blend, as glTF requires. */
78
+ export class CubicSplineQuaternionInterpolant extends CubicSplineInterpolant {
79
+ interpolate_(i1, t0, t, t1) {
80
+ const result = super.interpolate_(i1, t0, t, t1);
81
+ _quaternion
82
+ .fromArray(result)
83
+ .normalize()
84
+ .toArray(result);
85
+ return result;
86
+ }
87
+ }
88
+ /**
89
+ * Install the CUBICSPLINE interpolant on a track whose values are tangent
90
+ * triples — byte-identical in effect to what `GLTFLoader` does to a track it
91
+ * parses from a GLB, so a track from an authored file and a track from a GLB
92
+ * are indistinguishable downstream.
93
+ */
94
+ export function installCubicSplineInterpolant(track) {
95
+ const factory = function InterpolantFactoryMethodGLTFCubicSpline(result) {
96
+ const Interpolant = this instanceof THREE.QuaternionKeyframeTrack
97
+ ? CubicSplineQuaternionInterpolant
98
+ : CubicSplineInterpolant;
99
+ // getValueSize() counts the whole triple; the interpolant wants components.
100
+ return new Interpolant(this.times, this.values, this.getValueSize() / 3, result);
101
+ };
102
+ factory.isInterpolantFactoryMethodGLTFCubicSpline = true;
103
+ track.createInterpolant = factory;
104
+ return track;
105
+ }
106
+ /** True when `track` carries glTF tangent triples rather than plain values. */
107
+ export function isCubicSplineTrack(track) {
108
+ const factory = track
109
+ .createInterpolant;
110
+ return factory?.isInterpolantFactoryMethodGLTFCubicSpline === true;
111
+ }
@@ -0,0 +1,89 @@
1
+ import type { ISequence } from '@theatre/core';
2
+ import type { SystemPhaseName } from '../core/types';
3
+ import type { AnimationClock } from './animation-clock';
4
+ /**
5
+ * D2 — bind the canonical `AnimationClock` to a Theatre sequence's playhead
6
+ * (spec §10 D2, §5.3, §3.2).
7
+ *
8
+ * This is VGAI's ENTIRE glue for Theatre integration on the clock side:
9
+ * games import and configure `@theatre/core` with its own native vocabulary
10
+ * (`getProject`/`types`/`sheet`/`object`, spec §5.3) — there is no renamed
11
+ * Theatre API here. The only thing VGAI owns is *who drives time*: the
12
+ * canonical clock is the single source of truth, and this binding seeks
13
+ * Theatre's sequence position to match it every time the clock moves. Theatre
14
+ * must never be left to drive its own `requestAnimationFrame` loop — see the
15
+ * module doc on `animation-clock.ts` for why (deterministic export, offline
16
+ * scrubbing, no wall-clock dependency).
17
+ *
18
+ * ## Why setting `sequence.position` is enough (no `sequence.play()`)
19
+ *
20
+ * Theatre's `ISequence.position` setter synchronously updates every bound
21
+ * `SheetObject`'s pull-based `.value` (proven against the real `@theatre/core`
22
+ * runtime in `packages/engine/test/theatre-binding.test.ts` — setting
23
+ * `position` and immediately reading `.value` reflects the new keyframe
24
+ * interpolation with no `requestAnimationFrame`/ticker wait, which is exactly
25
+ * what makes this safe to drive from a synchronous, wall-clock-free
26
+ * `AnimationClock.seek()`/`advance()` call, including headlessly in Node for
27
+ * the render/export seam, I2). Theatre's *push* notification channel
28
+ * (`onValuesChange`/`onChange`) is batched on its own internal raf-driven
29
+ * ticker — it is not delivered 1:1 with each programmatic `position` write,
30
+ * so a subscriber can observe several coalesced position writes as a single
31
+ * notification, or (in a headless/no-raf context) none at all — so object
32
+ * bindings (`theatre-object-binding.ts`) deliberately read `sheetObject.value`
33
+ * (pull) after this binding has run, rather than subscribing to Theatre's
34
+ * push channel, to stay exactly in lockstep with the clock.
35
+ *
36
+ * ## Phase choice
37
+ *
38
+ * Note on phase semantics: `phase` here orders evaluators WITHIN a single
39
+ * clock `emit()` — i.e. within one `seek()`/`advance()` call — using the
40
+ * engine's `SystemPhaseName` vocabulary purely as a shared, familiar naming
41
+ * convention (`animation-clock.ts`'s module doc). It does NOT mean an
42
+ * evaluator registered at, say, `'preRender'` executes during the live
43
+ * engine's own `system-runner` `preRender` phase call within a running RAF
44
+ * frame — the `AnimationClock` is independent of the live game loop's phase
45
+ * execution, and during offline export/scrub there is no RAF frame at all.
46
+ * `phase` only orders same-emit evaluators relative to each other (e.g.
47
+ * guaranteeing this clock-to-sequence binding runs before an object binding
48
+ * reads the sequence on the same crossing), never relative to unrelated
49
+ * engine systems that happen to run in a same-named phase during a live
50
+ * frame.
51
+ *
52
+ * Registered by default at the `'animation'` phase — the same phase
53
+ * XState-bound `AnimationMixer` playback ticks in (the phase table:
54
+ * `... gameLogic → animation → preRender → render`). Object
55
+ * bindings (`bindObject3DTransform`/`bindCameraLens`) default to `'preRender'`
56
+ * (the documented home for camera placement/material tick) specifically so
57
+ * `PHASE_ORDER` — not registration order — guarantees they observe the
58
+ * position this binding just set, regardless of which binding a caller sets
59
+ * up first.
60
+ */
61
+ export interface TheatreClockBindingOptions {
62
+ /**
63
+ * Which `AnimationClock` phase to seek the sequence in. Defaults to
64
+ * `'animation'`. Any object binding reading this sheet's objects should use
65
+ * a phase that runs no earlier (see module doc above) — `'preRender'`, the
66
+ * default for `bindObject3DTransform`/`bindCameraLens`, always qualifies.
67
+ */
68
+ phase?: SystemPhaseName;
69
+ }
70
+ export interface TheatreClockBinding {
71
+ /** Removes the clock evaluator. No further `sequence.position` writes occur after this. */
72
+ dispose(): void;
73
+ }
74
+ /**
75
+ * Subscribe `sequence.position = clock.time` to every crossing of `clock` in
76
+ * the given phase (default `'animation'`). Returns a disposer; call it to
77
+ * stop driving the sequence (e.g. on `GameCleanup.dispose()` or before
78
+ * rebinding on hot reload — this is what keeps HMR from accumulating
79
+ * duplicate listeners, since re-running `setup()` disposes the old binding
80
+ * before creating a new one).
81
+ *
82
+ * Multiple sheets/sequences can each get their own binding with no shared
83
+ * mutable state on VGAI's side — collision avoidance for the underlying
84
+ * Theatre project/sheet identity is Theatre's own `getProject(id)`/
85
+ * `project.sheet(id)` namespacing (spec §5.3), which this function does not
86
+ * touch or wrap.
87
+ */
88
+ export declare function bindClockToTheatreSequence(clock: AnimationClock, sequence: ISequence, options?: TheatreClockBindingOptions): TheatreClockBinding;
89
+ //# sourceMappingURL=theatre-clock-binding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theatre-clock-binding.d.ts","sourceRoot":"","sources":["../../src/animation/theatre-clock-binding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwDG;AAEH,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,2FAA2F;IAC3F,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,SAAS,EACnB,OAAO,GAAE,0BAA+B,GACvC,mBAAmB,CAerB"}
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Subscribe `sequence.position = clock.time` to every crossing of `clock` in
3
+ * the given phase (default `'animation'`). Returns a disposer; call it to
4
+ * stop driving the sequence (e.g. on `GameCleanup.dispose()` or before
5
+ * rebinding on hot reload — this is what keeps HMR from accumulating
6
+ * duplicate listeners, since re-running `setup()` disposes the old binding
7
+ * before creating a new one).
8
+ *
9
+ * Multiple sheets/sequences can each get their own binding with no shared
10
+ * mutable state on VGAI's side — collision avoidance for the underlying
11
+ * Theatre project/sheet identity is Theatre's own `getProject(id)`/
12
+ * `project.sheet(id)` namespacing (spec §5.3), which this function does not
13
+ * touch or wrap.
14
+ */
15
+ export function bindClockToTheatreSequence(clock, sequence, options = {}) {
16
+ const phase = options.phase ?? 'animation';
17
+ const handle = clock.subscribe(phase, () => {
18
+ sequence.position = clock.time;
19
+ });
20
+ let disposed = false;
21
+ return {
22
+ dispose() {
23
+ if (disposed)
24
+ return;
25
+ disposed = true;
26
+ handle.dispose();
27
+ },
28
+ };
29
+ }
@@ -0,0 +1,277 @@
1
+ import type { ISheetObject, UnknownShorthandCompoundProps } from '@theatre/core';
2
+ import type { SystemPhaseName } from '../core/types';
3
+ import type { AnimationClock } from './animation-clock';
4
+ /**
5
+ * D4 — the Theatre "Director" convention (spec §10 D4, §5.3, §3.2).
6
+ *
7
+ * A `Director` is an ordinary Theatre Sheet Object, authored with Theatre's
8
+ * NATIVE `types.stringLiteral`/`types.boolean` vocabulary exactly as shown in
9
+ * spec §5.3 — this module never wraps or renames that API. It is a
10
+ * *convention* (a documented, stable shape) plus a thin binding, not a new
11
+ * animation format:
12
+ *
13
+ * ```ts
14
+ * import { types } from '@theatre/core';
15
+ * const director = sheet.object('Director', {
16
+ * activeCamera: types.stringLiteral('wide', { wide: 'wide', close: 'close', gameplay: 'gameplay' }),
17
+ * shot: types.stringLiteral('opening', { opening: 'opening', reveal: 'reveal', ending: 'ending' }),
18
+ * letterbox: types.boolean(false),
19
+ * // extensible: any additional directorial prop is carried through verbatim
20
+ * // as `DirectorState.extras`, e.g.:
21
+ * blendSeconds: types.number(0, { range: [0, Infinity] }),
22
+ * });
23
+ * ```
24
+ *
25
+ * `activeCamera`/`shot`/`letterbox` are required by the convention (spec §10
26
+ * D4 AC: "covers active camera, shot ID, letterbox, and optional directorial
27
+ * properties"). Anything else declared on the same Theatre object (exposure,
28
+ * grade, a blend-duration prop, ...) is an "optional directorial property" —
29
+ * it is read and surfaced verbatim through `DirectorState.extras`, never
30
+ * hardcoded here, which is what keeps the convention extensible without
31
+ * VGAI inventing a schema for it.
32
+ *
33
+ * ## Binding: pull-based, same lockstep pattern as D2/D3
34
+ *
35
+ * `bindDirectorToClock` follows exactly the `theatre-clock-binding.ts` /
36
+ * `theatre-object-binding.ts` pattern: it reads the Director object's
37
+ * pull-based `sheetObject.value` on every canonical-clock crossing (never
38
+ * Theatre's own batched `onValuesChange` push channel — see those modules'
39
+ * doc comments for why that would desync from a synchronous `clock.seek()`).
40
+ * Default phase is `'preRender'`, the same default `bindObject3DTransform`/
41
+ * `bindCameraLens` use, so — via `PHASE_ORDER`, not registration order — the
42
+ * Director always reads a sequence position that `bindClockToTheatreSequence`
43
+ * (registered at `'animation'`, which runs earlier) has already set for this
44
+ * crossing, regardless of which binding a caller sets up first.
45
+ *
46
+ * ## Seeking updates Director without firing gameplay cues
47
+ *
48
+ * This binding has NO concept of "seek" vs "advance" — unlike
49
+ * `CueRunner` (D5, `cinematic-cues.ts`), which deliberately distinguishes the
50
+ * two (via its own `seek()`/`advance()` wrapper methods) so a
51
+ * `firesDuringSeek: false` cue can be skipped on scrub. A Director value is
52
+ * *visual/directorial state*, not a gameplay consequence (spec §3.2: "Theatre
53
+ * carries visual/directorial values; ordinary TypeScript cues carry gameplay
54
+ * consequences") — it should always reflect the clock's current time,
55
+ * however the clock got there. Composing the two on the SAME
56
+ * `AnimationClock` (Director bound directly to the clock; cues bound through
57
+ * a `CueRunner` wrapping the same clock) is exactly what makes "seek updates
58
+ * Director but does not spuriously fire gameplay cues" fall out for free: a
59
+ * `CueRunner.seek(t)` call moves the one shared clock, which both this
60
+ * binding (always reacts) and the cue runner (gates on `firesDuringSeek`)
61
+ * observe on the same crossing. See `theatre-director.test.ts`'s
62
+ * "composes with D5" suite for the proof.
63
+ *
64
+ * ## Camera-ownership hook — the D6 seam
65
+ *
66
+ * Discrete `activeCamera` changes are exactly the moments a *camera
67
+ * ownership* system (D6, not built in this unit) needs to know about, to cut
68
+ * or blend the live gameplay camera to the Director's declared shot. This
69
+ * module does not own or perform any camera mutation — it only DETECTS a
70
+ * change in the Director's `activeCamera` value across successive
71
+ * evaluations and reports it through `onActiveCameraChange`
72
+ * (`CameraOwnershipHook`), a minimal, one-directional seam:
73
+ *
74
+ * - fired once per detected `activeCamera` transition (never for a
75
+ * no-op/unchanged evaluation, including a re-seek to the same time or a
76
+ * seek that stays within the same shot's camera);
77
+ * - the FIRST evaluation after bind is treated as an "assignment", not a
78
+ * "cut from something" — `previousCameraKey` is `null` and `mode` is
79
+ * forced to `'cut'` (there is nothing to blend FROM yet; D6 is expected
80
+ * to use this event to perform its initial camera capture/placement);
81
+ * - `mode`/`blendSeconds` are derived from an optional extra numeric prop on
82
+ * the SAME Director object (`blendSecondsKey`, default `'blendSeconds'`)
83
+ * — a positive value at the moment of the transition means `'blend'`
84
+ * (with that duration), anything else means `'cut'`. This is the "expose
85
+ * enough for a consumer to cut or blend" seam named in the D4 AC; the
86
+ * ACTUAL blend implementation (interpolating the live camera pose over
87
+ * `blendSeconds`) is D6's job, not this module's.
88
+ *
89
+ * ### `blendSeconds` MUST be authored as HOLD keyframes
90
+ *
91
+ * `blendSeconds` is read at the EXACT moment `activeCamera` is detected to
92
+ * change, whatever clock time that happens to land on. If `blendSeconds` is
93
+ * authored as an ordinary interpolating (bezier) track, a transition
94
+ * detected at a time that isn't exactly a keyframe position reads whatever
95
+ * partially-interpolated value the bezier curve has reached AT THAT MOMENT —
96
+ * not the value actually authored FOR that transition. Concretely: a cut
97
+ * authored at `t=3` with `blendSeconds=0`, followed by a blend authored at
98
+ * `t=6` with `blendSeconds=1.5`, makes the track interpolate from `0` to
99
+ * `1.5` across `[3, 6)`. If the `activeCamera` transition at `t=3` is first
100
+ * *observed* at some later non-keyframe time inside that span (e.g. a coarse
101
+ * seek from `t=2` straight to `t=4.5`, skipping past `t=3` without an
102
+ * intermediate evaluation), `blendSeconds` at `t=4.5` reads a nonzero,
103
+ * partially-interpolated value — misreporting an authored CUT as a partial
104
+ * BLEND.
105
+ *
106
+ * The fix is to author `blendSeconds` keyframes as Theatre HOLD keyframes
107
+ * (`connectedRight: false`, optionally also `type: 'hold'`) rather than the
108
+ * default interpolating bezier keyframes. `connectedRight: false` makes
109
+ * Theatre's own sequence evaluator hold the LEFT keyframe's value constant
110
+ * across the entire span up to (not including) the next keyframe, then snap
111
+ * — never partially interpolate. With `blendSeconds` authored this way, its
112
+ * value at ANY time within `[3, 6)` reads exactly `0` (the cut authored at
113
+ * `t=3`), and only reads `1.5` once the clock reaches `t=6` (the blend
114
+ * authored there) — correct regardless of which non-keyframe time a
115
+ * transition happens to first be observed at. See
116
+ * `fixtures/theatre-director-proof.theatre-project.json` (its `blendSeconds`
117
+ * track uses `connectedRight: false` on every keyframe) and
118
+ * `theatre-director.test.ts`'s "playback grid" suite, which proves this by
119
+ * evaluating a fine-grained, non-keyframe-aligned time grid across the whole
120
+ * span and asserting the reported `mode` never drifts from what was
121
+ * authored at the keyframe that produced the transition.
122
+ *
123
+ * D6 will most likely implement `CameraOwnershipHook` as (roughly) "capture
124
+ * gameplay camera pose once on the first `mode: 'cut'` event; on each
125
+ * subsequent event, cut or blend the owned camera to the shot named by
126
+ * `cameraKey`". Nothing above depends on that implementation existing —
127
+ * `onActiveCameraChange` is optional and this module works with no hook
128
+ * attached at all (Director values are still readable via `getState()`).
129
+ *
130
+ * ## Read API (SDK/CLI seam, B5)
131
+ *
132
+ * `readDirectorState` is a pure, synchronous read of whatever a Director
133
+ * Theatre object's CURRENT value is — no clock/binding required. It is what
134
+ * a later `cinematic.*` SDK/CLI operation (B5) would call to inspect Director
135
+ * state (e.g. "what shot is authored at time t") without needing to spin up
136
+ * a full runtime binding. `TheatreDirectorBinding.getState()` is the
137
+ * clock-driven equivalent — it returns the value read at bind time until the
138
+ * FIRST clock crossing occurs (not "the most recent crossing" — before any
139
+ * crossing there IS no crossing yet), and the value as of the most recent
140
+ * crossing thereafter.
141
+ *
142
+ * Authoring `Director` keyframes in Theatre Studio is a dev-only workflow
143
+ * (spec §10 D2: "Theatre Studio is available only in authoring/development
144
+ * contexts"); the committed project-state JSON is the source of truth this
145
+ * module reads in production — nothing here imports the Theatre Studio
146
+ * package (see `theatre-binding.test.ts`'s repo-wide grep proof of that).
147
+ */
148
+ /** Thrown when a Theatre object does not conform to the Director convention. */
149
+ export declare class TheatreDirectorError extends Error {
150
+ readonly objectKey: string;
151
+ constructor(message: string, objectKey: string);
152
+ }
153
+ /** The Director convention's three required props, plus everything else verbatim. */
154
+ export interface DirectorState {
155
+ readonly activeCamera: string;
156
+ readonly shot: string;
157
+ readonly letterbox: boolean;
158
+ /**
159
+ * Any additional directorial props declared on the same Theatre object
160
+ * (e.g. `exposure`, `grade`, `blendSeconds`), captured verbatim from
161
+ * `sheetObject.value`. The Director convention is deliberately extensible
162
+ * here — VGAI does not enumerate or validate extras beyond the three
163
+ * required props.
164
+ */
165
+ readonly extras: Readonly<Record<string, unknown>>;
166
+ }
167
+ /**
168
+ * Pure, synchronous read of a Director Theatre object's CURRENT value.
169
+ * No clock/binding involved — suitable for one-shot inspection (the later
170
+ * SDK/CLI read path, B5) as well as being the function
171
+ * `bindDirectorToClock` itself calls on every crossing.
172
+ *
173
+ * @throws {TheatreDirectorError} if the object's value does not conform to
174
+ * the Director convention (missing/mistyped `activeCamera`/`shot`/`letterbox`).
175
+ */
176
+ export declare function readDirectorState<Props extends UnknownShorthandCompoundProps>(sheetObject: ISheetObject<Props>): DirectorState;
177
+ /** Whether a reported `activeCamera` transition should be a hard cut or a blend. */
178
+ export type CameraCutMode = 'cut' | 'blend';
179
+ /**
180
+ * One detected `activeCamera` transition. This is the entire payload the
181
+ * D6 camera-ownership system needs to decide what to do — it carries no
182
+ * camera object or mutation itself (that stays entirely on the consumer's
183
+ * side, matching "no arbitrary unsafe property-path evaluator" / "thin
184
+ * integration code" throughout D2-D5).
185
+ */
186
+ export interface CameraOwnershipChangeEvent {
187
+ /** The Director's new `activeCamera` value. */
188
+ readonly cameraKey: string;
189
+ /** The Director's previous `activeCamera` value, or `null` on the first (assignment) event. */
190
+ readonly previousCameraKey: string | null;
191
+ /** `'cut'` unless a positive blend duration was authored for this transition. */
192
+ readonly mode: CameraCutMode;
193
+ /** Blend duration in seconds; `0` for a `'cut'`. */
194
+ readonly blendSeconds: number;
195
+ /** The Director's `shot` value at the moment of this transition, for convenience. */
196
+ readonly shot: string;
197
+ }
198
+ /**
199
+ * D6 seam: implemented fully by the camera-ownership/restoration system
200
+ * (spec §10 D6). This module only detects and reports discrete
201
+ * `activeCamera` transitions — it performs no camera capture, cut, blend, or
202
+ * restoration itself.
203
+ */
204
+ export type CameraOwnershipHook = (event: CameraOwnershipChangeEvent) => void;
205
+ /**
206
+ * WF — one detected event-marker transition on the Director's `event` extra
207
+ * track (authored by the editor's Sequencer as HOLD string keyframes on the
208
+ * SAME Director object; see the sequencer's `EVENT_MARKER_PROP`).
209
+ */
210
+ export interface EventMarkerEvent {
211
+ /** The marker name now active (the hold keyframe's string value). */
212
+ readonly name: string;
213
+ /** The previously active marker name, or `null` before the first marker. */
214
+ readonly previousName: string | null;
215
+ }
216
+ /**
217
+ * WF seam — fired once per DETECTED change of the Director's event-marker
218
+ * value, exactly the `activeCamera` detection semantics: markers are
219
+ * *directorial* state, so the hook reflects whatever value the clock's
220
+ * current time holds, however the clock got there (a seek across several
221
+ * markers fires only the one now active; a seek BACK re-fires the older
222
+ * marker as a change). Gameplay consequences that must distinguish seek from
223
+ * advance belong in a D5 `CueRunner` (`cinematic-cues.ts`), not here.
224
+ */
225
+ export type EventMarkerHook = (event: EventMarkerEvent) => void;
226
+ export interface TheatreDirectorBindingOptions {
227
+ /**
228
+ * Which `AnimationClock` phase to evaluate the Director in. Defaults to
229
+ * `'preRender'` (see module doc — guaranteed by `PHASE_ORDER` to observe a
230
+ * sequence position `bindClockToTheatreSequence`'s `'animation'`-phase
231
+ * default has already set for this crossing).
232
+ */
233
+ phase?: SystemPhaseName;
234
+ /** Camera-ownership seam (D6) — see module doc. Optional; omit to just read state. */
235
+ onActiveCameraChange?: CameraOwnershipHook;
236
+ /**
237
+ * Name of an optional extra numeric Director prop that carries the blend
238
+ * duration (seconds) for the transition landing on the CURRENT
239
+ * evaluation. Defaults to `'blendSeconds'`. Absent, non-numeric, or
240
+ * non-positive at the moment of a transition reports `mode: 'cut'`.
241
+ */
242
+ blendSecondsKey?: string;
243
+ /**
244
+ * WF seam — event-marker hook (see {@link EventMarkerHook}). Fired when
245
+ * the string value of the Director's `eventMarkerKey` extra prop changes
246
+ * between evaluations (markers are authored as HOLD keyframes, so each
247
+ * marker's name holds until the next one). Optional; omit to ignore
248
+ * markers entirely.
249
+ */
250
+ onEventMarker?: EventMarkerHook;
251
+ /**
252
+ * Name of the extra Director prop carrying event-marker names. Defaults to
253
+ * `'event'` — the track the editor's Sequencer writes. An empty string or
254
+ * a non-string value means "no marker active".
255
+ */
256
+ eventMarkerKey?: string;
257
+ }
258
+ export interface TheatreDirectorBinding {
259
+ /**
260
+ * Current Director state (D4 AC: inspectable read API). Before the first
261
+ * clock crossing, this is the bind-time value (`readDirectorState` called
262
+ * once at bind); from the first crossing onward, it is the value as of the
263
+ * most recent crossing.
264
+ */
265
+ getState(): DirectorState;
266
+ /** Removes the clock evaluator. No further evaluation (or hook calls) occurs after this. */
267
+ dispose(): void;
268
+ }
269
+ /**
270
+ * Bind a Director Theatre Sheet Object to `clock`: on every crossing, read
271
+ * its current value (`readDirectorState`) and, if `activeCamera` changed
272
+ * since the last evaluation, report the transition through
273
+ * `onActiveCameraChange` (the D6 seam). Returns a disposer and a `getState()`
274
+ * read API. See the module doc comment for the full contract.
275
+ */
276
+ export declare function bindDirectorToClock<Props extends UnknownShorthandCompoundProps>(clock: AnimationClock, sheetObject: ISheetObject<Props>, options?: TheatreDirectorBindingOptions): TheatreDirectorBinding;
277
+ //# sourceMappingURL=theatre-director.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"theatre-director.d.ts","sourceRoot":"","sources":["../../src/animation/theatre-director.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,6BAA6B,EAAE,MAAM,eAAe,CAAC;AACjF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AACrD,OAAO,KAAK,EAAE,cAAc,EAAwB,MAAM,mBAAmB,CAAC;AAE9E;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+IG;AAEH,gFAAgF;AAChF,qBAAa,oBAAqB,SAAQ,KAAK;IAG3C,QAAQ,CAAC,SAAS,EAAE,MAAM;gBAD1B,OAAO,EAAE,MAAM,EACN,SAAS,EAAE,MAAM;CAK7B;AAED,qFAAqF;AACrF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,OAAO,CAAC;IAC5B;;;;;;OAMG;IACH,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACpD;AAID;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,SAAS,6BAA6B,EAC3E,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,GAC/B,aAAa,CAqCf;AAED,oFAAoF;AACpF,MAAM,MAAM,aAAa,GAAG,KAAK,GAAG,OAAO,CAAC;AAE5C;;;;;;GAMG;AACH,MAAM,WAAW,0BAA0B;IACzC,+CAA+C;IAC/C,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,+FAA+F;IAC/F,QAAQ,CAAC,iBAAiB,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,iFAAiF;IACjF,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,qFAAqF;IACrF,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG,CAAC,KAAK,EAAE,0BAA0B,KAAK,IAAI,CAAC;AAE9E;;;;GAIG;AACH,MAAM,WAAW,gBAAgB;IAC/B,qEAAqE;IACrE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4EAA4E;IAC5E,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CACtC;AAED;;;;;;;;GAQG;AACH,MAAM,MAAM,eAAe,GAAG,CAAC,KAAK,EAAE,gBAAgB,KAAK,IAAI,CAAC;AAEhE,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,mBAAmB,CAAC;IAC3C;;;;;OAKG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;;;;OAMG;IACH,aAAa,CAAC,EAAE,eAAe,CAAC;IAChC;;;;OAIG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,QAAQ,IAAI,aAAa,CAAC;IAC1B,4FAA4F;IAC5F,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,SAAS,6BAA6B,EAC7E,KAAK,EAAE,cAAc,EACrB,WAAW,EAAE,YAAY,CAAC,KAAK,CAAC,EAChC,OAAO,GAAE,6BAAkC,GAC1C,sBAAsB,CA2DxB"}