@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,252 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * E1 — Zod/TypeScript metadata attached to XState state `meta.animation`
4
+ * (spec §11 E1, §5.6, §3.3).
5
+ *
6
+ * This module defines ONLY animation data: which clip(s) a state plays, how
7
+ * they loop/blend/crossfade, and (for locomotion-style states) how a 1D/2D/
8
+ * direct blend tree distributes weight across several clips from a live
9
+ * parameter. It intentionally contains **no transition vocabulary** — no
10
+ * `on`/`target`/`guard`/`always`/`after`/`entry`/`exit`. XState alone owns
11
+ * states, transitions, events, and guards (§3.3); this metadata is read-only
12
+ * data a binding (`xstate-animation-binding.ts`, E2) consumes to drive a
13
+ * `THREE.AnimationMixer` when XState enters/exits a state. Every schema below
14
+ * is `.strict()` specifically so that smuggling a transition-shaped key into
15
+ * `meta.animation` is a loud Zod "unrecognized key" error, not a silently
16
+ * ignored field (E1 AC: "Metadata contains no transition language").
17
+ *
18
+ * ## Native layered composition
19
+ *
20
+ * Parallel XState regions may drive independent named layers. Each layer can
21
+ * filter a clip to selected bone subtrees, scale its weight, and use normal
22
+ * override or Three's native additive blend mode. XState still owns all
23
+ * state/transition semantics; these fields only describe how the active
24
+ * state's native `AnimationAction`s are composed by the binding.
25
+ *
26
+ * ## Blend tree shape
27
+ *
28
+ * Deliberately structurally IDENTICAL to `anim-graph-types.ts`'s
29
+ * `BlendTreeDef` (same `type`/`parameter`/`parameterY`/`children[].clip`/
30
+ * `.threshold`/`.thresholdY`/`.weight` fields) so the binding can hand a
31
+ * parsed `AnimationBlendTree` straight to the existing, already-tested
32
+ * `evaluateBlendTree` (`blend-node.ts`) with zero conversion — E2 reuses that
33
+ * function verbatim rather than re-implementing 1D/2D/direct blend math.
34
+ */
35
+ // ---------------------------------------------------------------------------
36
+ // Blend tree children
37
+ // ---------------------------------------------------------------------------
38
+ const AnimationBlendChildSchema = z
39
+ .object({
40
+ clip: z.string().min(1).describe('Animation clip name this child plays'),
41
+ threshold: z.number().describe('1D/2D blend position on the primary parameter axis'),
42
+ thresholdY: z
43
+ .number()
44
+ .optional()
45
+ .describe('2D blend position on the secondary parameter axis (2D blend trees only)'),
46
+ weight: z
47
+ .number()
48
+ .min(0)
49
+ .optional()
50
+ .describe('Explicit weight for "direct" blend trees (ignored by 1D/2D)'),
51
+ })
52
+ .strict();
53
+ const AnimationBlendTree1DSchema = z
54
+ .object({
55
+ type: z.literal('1D').describe('Interpolates linearly between sorted children by threshold'),
56
+ parameter: z.string().min(1).describe('Context/selector value driving the blend'),
57
+ children: z
58
+ .array(AnimationBlendChildSchema)
59
+ .min(2, '1D blend tree needs at least 2 children to interpolate between'),
60
+ })
61
+ .strict();
62
+ const AnimationBlendTree2DSchema = z
63
+ .object({
64
+ type: z
65
+ .literal('2D')
66
+ .describe('Inverse-distance-weights children by (parameter, parameterY) position'),
67
+ parameter: z.string().min(1).describe('Primary axis context/selector value'),
68
+ parameterY: z.string().min(1).describe('Secondary axis context/selector value'),
69
+ children: z
70
+ .array(AnimationBlendChildSchema.extend({ thresholdY: z.number() }))
71
+ .min(1, '2D blend tree needs at least 1 child'),
72
+ })
73
+ .strict();
74
+ const AnimationBlendTreeDirectSchema = z
75
+ .object({
76
+ type: z.literal('direct').describe('Each child has an explicit weight, normalized to sum to 1'),
77
+ // `parameter` is unused by direct blending (evaluateBlendTree never reads
78
+ // it for `type: 'direct'`) but kept required+defaulted so the parsed
79
+ // value stays structurally assignable to `BlendTreeDef`
80
+ // (`anim-graph-types.ts`), which declares `parameter: string` for every
81
+ // blend mode — the same convention that type already uses.
82
+ parameter: z.string().default(''),
83
+ children: z
84
+ .array(AnimationBlendChildSchema.extend({ weight: z.number().min(0) }))
85
+ .min(1, 'direct blend tree needs at least 1 child'),
86
+ })
87
+ .strict();
88
+ export const AnimationBlendTreeSchema = z.discriminatedUnion('type', [
89
+ AnimationBlendTree1DSchema,
90
+ AnimationBlendTree2DSchema,
91
+ AnimationBlendTreeDirectSchema,
92
+ ]);
93
+ // ---------------------------------------------------------------------------
94
+ // Crossfade / blend-in-out metadata (shared by clip and blend-tree states)
95
+ // ---------------------------------------------------------------------------
96
+ const AnimationCrossfadeMetaSchema = z
97
+ .object({
98
+ duration: z
99
+ .number()
100
+ .min(0)
101
+ .default(0)
102
+ .describe('Seconds to blend from the previously active clip into this state on entry, applied via ' +
103
+ 'native `AnimationAction.crossFadeTo`/`fadeIn` (E2). 0 = instant activation, no fade.'),
104
+ warp: z
105
+ .boolean()
106
+ .default(false)
107
+ .describe("Passed through to AnimationAction.crossFadeTo's `warp` param — linearly warps timeScale " +
108
+ 'across the two clips during the blend so differing clip lengths line up. Default false.'),
109
+ })
110
+ .strict()
111
+ .describe('Blend-in/out/crossfade timing for entering this state');
112
+ const AnimationBoneMaskSchema = z
113
+ .object({
114
+ include: z
115
+ .array(z.string().min(1))
116
+ .min(1)
117
+ .optional()
118
+ .describe('Bone/object names whose complete descendant subtrees are retained'),
119
+ exclude: z
120
+ .array(z.string().min(1))
121
+ .min(1)
122
+ .optional()
123
+ .describe('Bone/object names whose complete descendant subtrees are removed'),
124
+ })
125
+ .strict()
126
+ .refine((mask) => Boolean(mask.include?.length || mask.exclude?.length), {
127
+ message: 'boneMask needs at least one include or exclude bone name',
128
+ })
129
+ .describe('Filters animation tracks by named Object3D/Bone subtrees');
130
+ const AnimationLayerFields = {
131
+ layer: z
132
+ .string()
133
+ .min(1)
134
+ .optional()
135
+ .describe('Composition layer name; omitted means the single base layer'),
136
+ weight: z
137
+ .number()
138
+ .min(0)
139
+ .max(1)
140
+ .optional()
141
+ .describe('Layer weight multiplier from 0 to 1; defaults to 1'),
142
+ blendMode: z
143
+ .enum(['override', 'additive'])
144
+ .optional()
145
+ .describe('Native Three normal/override or additive action blending; defaults to override'),
146
+ boneMask: AnimationBoneMaskSchema.optional().describe('Optional include/exclude filter applied to every clip track in this state'),
147
+ };
148
+ // ---------------------------------------------------------------------------
149
+ // Per-state animation metadata: single clip OR blend tree, plus crossfade
150
+ // ---------------------------------------------------------------------------
151
+ const ClipAnimationMetaSchema = z
152
+ .object({
153
+ clip: z.string().min(1).describe('Single clip to play while this XState state is active'),
154
+ loop: z
155
+ .boolean()
156
+ .default(true)
157
+ .describe('Loop the clip (THREE.LoopRepeat) vs play once (THREE.LoopOnce, clamped on last frame)'),
158
+ speed: z
159
+ .number()
160
+ .positive()
161
+ .default(1)
162
+ .describe('Playback speed multiplier (AnimationAction.timeScale)'),
163
+ crossfade: AnimationCrossfadeMetaSchema.optional(),
164
+ ...AnimationLayerFields,
165
+ })
166
+ .strict();
167
+ const BlendTreeAnimationMetaSchema = z
168
+ .object({
169
+ blendTree: AnimationBlendTreeSchema.describe('Multiple clips blended by a live context/selector-driven parameter'),
170
+ crossfade: AnimationCrossfadeMetaSchema.optional(),
171
+ ...AnimationLayerFields,
172
+ })
173
+ .strict();
174
+ /**
175
+ * The full shape of `state.meta.animation` for one XState state (spec §5.6):
176
+ * exactly one of a single clip or a blend tree, plus optional crossfade
177
+ * timing. `.strict()` on both branches is what makes authoring a transition
178
+ * keyword (`on`, `target`, `guard`, …) inside `meta.animation` a validation
179
+ * error instead of a silently-accepted second transition dialect.
180
+ */
181
+ export const StateAnimationMetaSchema = z.union([
182
+ ClipAnimationMetaSchema,
183
+ BlendTreeAnimationMetaSchema,
184
+ ]);
185
+ /** True iff a validated meta declares a single clip rather than a blend tree. */
186
+ export function isClipAnimationMeta(meta) {
187
+ return 'clip' in meta;
188
+ }
189
+ /** True iff a validated meta declares a blend tree rather than a single clip. */
190
+ export function isBlendTreeAnimationMeta(meta) {
191
+ return 'blendTree' in meta;
192
+ }
193
+ // ---------------------------------------------------------------------------
194
+ // Validation entry point
195
+ // ---------------------------------------------------------------------------
196
+ /** Thrown by `parseStateAnimationMeta` — always names the offending state id. */
197
+ export class AnimationMetaValidationError extends Error {
198
+ stateId;
199
+ issues;
200
+ constructor(message, stateId, issues) {
201
+ super(message);
202
+ this.stateId = stateId;
203
+ this.issues = issues;
204
+ this.name = 'AnimationMetaValidationError';
205
+ }
206
+ }
207
+ /**
208
+ * Validate one state's `meta.animation` value. Called by the E2 binding for
209
+ * every state a machine declares (both at bind time, up front, and — for
210
+ * belt-and-suspenders — again whenever a state is entered).
211
+ *
212
+ * @throws {AnimationMetaValidationError} naming the state id and every Zod
213
+ * issue (path + message) — e.g. an unrecognized `on`/`target` key, a
214
+ * missing `clip`, or a 1D blend tree with only one child.
215
+ */
216
+ export function parseStateAnimationMeta(stateId, raw) {
217
+ const result = StateAnimationMetaSchema.safeParse(raw);
218
+ if (!result.success) {
219
+ const detail = result.error.issues
220
+ .map((issue) => `${issue.path.length ? issue.path.join('.') : '(root)'}: ${issue.message}`)
221
+ .join('; ');
222
+ throw new AnimationMetaValidationError(`[xstate-animation] invalid meta.animation for state "${stateId}": ${detail}`, stateId, result.error.issues);
223
+ }
224
+ return result.data;
225
+ }
226
+ /**
227
+ * Walk every state node in a machine (from its root `StateNode`, e.g.
228
+ * `actor.logic.root`) and validate every `meta.animation` value found.
229
+ * States with no `meta.animation` are skipped (not every XState state needs
230
+ * to drive animation). Returns one entry per animated state, in document
231
+ * order.
232
+ *
233
+ * @throws {AnimationMetaValidationError} on the FIRST invalid meta found —
234
+ * naming the specific state id, so an agent authoring a machine gets an
235
+ * actionable pointer straight to the bad state instead of a generic error.
236
+ */
237
+ export function collectMachineAnimationMeta(root) {
238
+ const out = [];
239
+ const visit = (node) => {
240
+ if (node.meta && 'animation' in node.meta && node.meta.animation !== undefined) {
241
+ out.push({ stateId: node.id, meta: parseStateAnimationMeta(node.id, node.meta.animation) });
242
+ }
243
+ for (const child of Object.values(node.states ?? {}))
244
+ visit(child);
245
+ };
246
+ visit(root);
247
+ return out;
248
+ }
249
+ /** Every clip name referenced anywhere in a validated meta (1 for clip states, N for blend trees). */
250
+ export function clipNamesOf(meta) {
251
+ return isClipAnimationMeta(meta) ? [meta.clip] : meta.blendTree.children.map((c) => c.clip);
252
+ }
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export declare const CameraDescriptorSchema: z.ZodObject<{
3
+ type: z.ZodEnum<{
4
+ perspective: "perspective";
5
+ orthographic: "orthographic";
6
+ }>;
7
+ fov: z.ZodOptional<z.ZodNumber>;
8
+ near: z.ZodOptional<z.ZodNumber>;
9
+ far: z.ZodOptional<z.ZodNumber>;
10
+ orthoSize: z.ZodOptional<z.ZodNumber>;
11
+ width: z.ZodOptional<z.ZodNumber>;
12
+ height: z.ZodOptional<z.ZodNumber>;
13
+ }, z.core.$strip>;
14
+ export type CameraDescriptor = z.infer<typeof CameraDescriptorSchema>;
15
+ //# sourceMappingURL=camera.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"camera.d.ts","sourceRoot":"","sources":["../../src/asset-formats/camera.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,eAAO,MAAM,sBAAsB;;;;;;;;;;;iBAaA,CAAC;AAEpC,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,sBAAsB,CAAC,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { z } from 'zod';
2
+ export const CameraDescriptorSchema = z
3
+ .object({
4
+ type: z.enum(['perspective', 'orthographic']).describe('Camera projection type'),
5
+ fov: z.number().optional().describe('Vertical field of view in degrees (perspective only)'),
6
+ near: z.number().optional().describe('Near clipping plane distance'),
7
+ far: z.number().optional().describe('Far clipping plane distance'),
8
+ orthoSize: z
9
+ .number()
10
+ .optional()
11
+ .describe('Half-height of the orthographic frustum (orthographic only)'),
12
+ width: z.number().optional().describe('Render width in pixels. Defaults to viewport width'),
13
+ height: z.number().optional().describe('Render height in pixels. Defaults to viewport height'),
14
+ })
15
+ .describe('Camera configuration');
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const ColliderDescriptorSchema: z.ZodObject<{
3
+ type: z.ZodEnum<{
4
+ cuboid: "cuboid";
5
+ ball: "ball";
6
+ capsule: "capsule";
7
+ trimesh: "trimesh";
8
+ }>;
9
+ halfExtents: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
10
+ radius: z.ZodOptional<z.ZodNumber>;
11
+ halfHeight: z.ZodOptional<z.ZodNumber>;
12
+ friction: z.ZodOptional<z.ZodNumber>;
13
+ restitution: z.ZodOptional<z.ZodNumber>;
14
+ density: z.ZodOptional<z.ZodNumber>;
15
+ offset: z.ZodOptional<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
16
+ isSensor: z.ZodOptional<z.ZodBoolean>;
17
+ collisionGroups: z.ZodOptional<z.ZodNumber>;
18
+ collisionFilter: z.ZodOptional<z.ZodNumber>;
19
+ }, z.core.$strip>;
20
+ export type ColliderDescriptor = z.infer<typeof ColliderDescriptorSchema>;
21
+ //# sourceMappingURL=collider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collider.d.ts","sourceRoot":"","sources":["../../src/asset-formats/collider.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;;;;iBA4De,CAAC;AAErD,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC"}
@@ -0,0 +1,53 @@
1
+ import { z } from 'zod';
2
+ import { Vec3Schema } from './tuples';
3
+ export const ColliderDescriptorSchema = z
4
+ .object({
5
+ type: z
6
+ .enum(['cuboid', 'ball', 'capsule', 'trimesh'])
7
+ .describe("Collider shape type. T1.2: every shape scales with the entity's composed world scale " +
8
+ "(self × ancestors) — for trimesh this means the entity's own mesh geometry vertices " +
9
+ 'are pre-scaled per-axis before building the Rapier trimesh, so it matches whatever ' +
10
+ "size ends up on screen; it does not require the collider's own dimension fields."),
11
+ halfExtents: Vec3Schema.optional().describe("Half-size [x, y, z] for cuboid colliders, in the ENTITY'S OWN LOCAL units. T1.2: " +
12
+ "scales with the entity — the actual Rapier collider is this value times the entity's " +
13
+ 'composed world scale (self × every transformed ancestor), per axis, baked in once at ' +
14
+ "load time (Rapier has no live notion of an Object3D's scale)."),
15
+ radius: z
16
+ .number()
17
+ .optional()
18
+ .describe("Radius for ball and capsule colliders, in the ENTITY'S OWN LOCAL units. T1.2: scales " +
19
+ "with the entity's composed world scale, which MUST be uniform on the collider's round " +
20
+ 'axes (ball: all of x/y/z; capsule: x and z) — a non-uniform scale there throws a loud ' +
21
+ 'load error (Rapier balls/capsules cannot represent an ellipse).'),
22
+ halfHeight: z
23
+ .number()
24
+ .optional()
25
+ .describe("Half-height for capsule colliders, in the entity's own local units, along the capsule's " +
26
+ "axis (Y). T1.2: scales by the entity's composed world scale on that axis."),
27
+ friction: z.number().optional().describe('Surface friction coefficient'),
28
+ restitution: z
29
+ .number()
30
+ .optional()
31
+ .describe('Bounciness coefficient (0 = no bounce, 1 = perfect bounce)'),
32
+ density: z
33
+ .number()
34
+ .optional()
35
+ .describe('Mass density. Used to compute mass from collider volume'),
36
+ offset: Vec3Schema.optional().describe("Translation offset relative to body origin, in the ENTITY'S OWN LOCAL units. T1.2/R1c: " +
37
+ "scales with the entity's composed world scale (self × every transformed ancestor), " +
38
+ 'per axis, the same way halfExtents/radius/halfHeight do — an unscaled offset would ' +
39
+ "silently drift away from the entity's visual anchor point under any non-1 scale."),
40
+ isSensor: z
41
+ .boolean()
42
+ .optional()
43
+ .describe('When true, detects overlaps without physical blocking (trigger volume)'),
44
+ collisionGroups: z
45
+ .number()
46
+ .optional()
47
+ .describe('Bitmask: collision layers this collider belongs to (max 16 bits)'),
48
+ collisionFilter: z
49
+ .number()
50
+ .optional()
51
+ .describe('Bitmask: collision layers this collider interacts with (max 16 bits)'),
52
+ })
53
+ .describe('Physics collider shape and properties');
@@ -0,0 +1,46 @@
1
+ /**
2
+ * The engine's remaining authored asset formats and descriptor schemas.
3
+ *
4
+ * WO-8 deleted the `.vscn.json` scene format and everything under
5
+ * `engine/src/scene/`. What survived is here, and each module is here because a
6
+ * real runtime reader still consumes it:
7
+ *
8
+ * - `material.ts` — the `.mat.json` shared-material format (`parseMaterialFile`)
9
+ * plus the inline material descriptor `render/material-factory.ts` reads
10
+ * - `instances.ts` — the `.instances.json` transform format (`parseInstancesFile`),
11
+ * read by `render/instance-mesh.ts`
12
+ * - `mesh.ts` — the geometry descriptor `render/material-factory.ts`'s `createGeometry` reads
13
+ * - `light.ts` / `camera.ts` — the descriptors `render/light-camera-factory.ts` reads
14
+ * - `collider.ts` — the descriptor `physics/collider-dimensions.ts` and the editor's
15
+ * collider gizmos read
16
+ * - `particles.ts` — the descriptor `render/particles-factory.ts` reads
17
+ * - `render-settings.ts` — the tone-mapping / post-processing / render-feature scopes
18
+ * `setup/setup-renderer.ts` reads
19
+ * - `tuples.ts` — the shared Vec3/Quat/Transform tuples the above build on
20
+ *
21
+ * These are DESCRIPTORS, not documents: each names a slice of authored data a
22
+ * render/physics factory reads, and none of them is a scene. They carried a
23
+ * `Scene*` prefix until WO-9 task #6 renamed them to `*Descriptor` — the prefix
24
+ * was a leftover of the deleted `.vscn.json` format, not a statement about what
25
+ * they describe.
26
+ */
27
+ export type { CameraDescriptor } from './camera';
28
+ export { CameraDescriptorSchema } from './camera';
29
+ export type { ColliderDescriptor } from './collider';
30
+ export { ColliderDescriptorSchema } from './collider';
31
+ export type { InstancesFile } from './instances';
32
+ export { InstancesFileSchema } from './instances';
33
+ export type { LightDescriptor } from './light';
34
+ export { LightDescriptorSchema } from './light';
35
+ export type { MaterialDescriptor, MaterialFile } from './material';
36
+ export { MaterialDescriptorSchema, MaterialFileSchema } from './material';
37
+ export type { MeshDescriptor } from './mesh';
38
+ export { MeshDescriptorSchema } from './mesh';
39
+ export { parseInstancesFile, parseMaterialFile } from './parse';
40
+ export type { ParticlesDescriptor } from './particles';
41
+ export { ParticlesDescriptorSchema } from './particles';
42
+ export type { PostProcessingDescriptor, RenderEnvironment, ToneMappingDescriptor, } from './render-env';
43
+ export { PostProcessingDescriptorSchema, RenderEnvironmentSchema, ToneMappingDescriptorSchema, } from './render-env';
44
+ export type { Quat, Transform, Vec3 } from './tuples';
45
+ export { QuatSchema, TransformSchema, Vec3Schema } from './tuples';
46
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/asset-formats/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AACjD,OAAO,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAClD,YAAY,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AACtD,YAAY,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACjD,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAChD,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AACnE,OAAO,EAAE,wBAAwB,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAC1E,YAAY,EAAE,cAAc,EAAE,MAAM,QAAQ,CAAC;AAC7C,OAAO,EAAE,oBAAoB,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAChE,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AACxD,YAAY,EACV,wBAAwB,EACxB,iBAAiB,EACjB,qBAAqB,GACtB,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,8BAA8B,EAC9B,uBAAuB,EACvB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AACtD,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC"}
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The engine's remaining authored asset formats and descriptor schemas.
3
+ *
4
+ * WO-8 deleted the `.vscn.json` scene format and everything under
5
+ * `engine/src/scene/`. What survived is here, and each module is here because a
6
+ * real runtime reader still consumes it:
7
+ *
8
+ * - `material.ts` — the `.mat.json` shared-material format (`parseMaterialFile`)
9
+ * plus the inline material descriptor `render/material-factory.ts` reads
10
+ * - `instances.ts` — the `.instances.json` transform format (`parseInstancesFile`),
11
+ * read by `render/instance-mesh.ts`
12
+ * - `mesh.ts` — the geometry descriptor `render/material-factory.ts`'s `createGeometry` reads
13
+ * - `light.ts` / `camera.ts` — the descriptors `render/light-camera-factory.ts` reads
14
+ * - `collider.ts` — the descriptor `physics/collider-dimensions.ts` and the editor's
15
+ * collider gizmos read
16
+ * - `particles.ts` — the descriptor `render/particles-factory.ts` reads
17
+ * - `render-settings.ts` — the tone-mapping / post-processing / render-feature scopes
18
+ * `setup/setup-renderer.ts` reads
19
+ * - `tuples.ts` — the shared Vec3/Quat/Transform tuples the above build on
20
+ *
21
+ * These are DESCRIPTORS, not documents: each names a slice of authored data a
22
+ * render/physics factory reads, and none of them is a scene. They carried a
23
+ * `Scene*` prefix until WO-9 task #6 renamed them to `*Descriptor` — the prefix
24
+ * was a leftover of the deleted `.vscn.json` format, not a statement about what
25
+ * they describe.
26
+ */
27
+ export { CameraDescriptorSchema } from './camera';
28
+ export { ColliderDescriptorSchema } from './collider';
29
+ export { InstancesFileSchema } from './instances';
30
+ export { LightDescriptorSchema } from './light';
31
+ export { MaterialDescriptorSchema, MaterialFileSchema } from './material';
32
+ export { MeshDescriptorSchema } from './mesh';
33
+ export { parseInstancesFile, parseMaterialFile } from './parse';
34
+ export { ParticlesDescriptorSchema } from './particles';
35
+ export { PostProcessingDescriptorSchema, RenderEnvironmentSchema, ToneMappingDescriptorSchema, } from './render-env';
36
+ export { QuatSchema, TransformSchema, Vec3Schema } from './tuples';
@@ -0,0 +1,17 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `.instances.json` — a declarative, authored-data instance-transform asset
4
+ * (F3). Referenced by `mesh.instances` as a bare array of 10-number tuples,
5
+ * one per instance, each `[posX,posY,posZ, quatX,quatY,quatZ,quatW,
6
+ * scaleX,scaleY,scaleZ]`. The scene loader fetches+parses this file and
7
+ * renders it as one `THREE.InstancedMesh` (one draw call) — bulk transform
8
+ * data is referenced as an asset, never inlined into the referencing
9
+ * document (gate G4).
10
+ *
11
+ * WO-8: the document that referenced it was `.vscn.json`, and that format is
12
+ * deleted. `.instances.json` survives as a FETCHED-ASSET format with its own
13
+ * `parseInstancesFile` — nothing in the shipped tree references one today.
14
+ */
15
+ export declare const InstancesFileSchema: z.ZodArray<z.ZodTuple<[z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber, z.ZodNumber], null>>;
16
+ export type InstancesFile = z.infer<typeof InstancesFileSchema>;
17
+ //# sourceMappingURL=instances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instances.d.ts","sourceRoot":"","sources":["../../src/asset-formats/instances.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,mBAAmB,kKAoB7B,CAAC;AAEJ,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC"}
@@ -0,0 +1,31 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * `.instances.json` — a declarative, authored-data instance-transform asset
4
+ * (F3). Referenced by `mesh.instances` as a bare array of 10-number tuples,
5
+ * one per instance, each `[posX,posY,posZ, quatX,quatY,quatZ,quatW,
6
+ * scaleX,scaleY,scaleZ]`. The scene loader fetches+parses this file and
7
+ * renders it as one `THREE.InstancedMesh` (one draw call) — bulk transform
8
+ * data is referenced as an asset, never inlined into the referencing
9
+ * document (gate G4).
10
+ *
11
+ * WO-8: the document that referenced it was `.vscn.json`, and that format is
12
+ * deleted. `.instances.json` survives as a FETCHED-ASSET format with its own
13
+ * `parseInstancesFile` — nothing in the shipped tree references one today.
14
+ */
15
+ export const InstancesFileSchema = z
16
+ .array(z.tuple([
17
+ z.number().describe('posX'),
18
+ z.number().describe('posY'),
19
+ z.number().describe('posZ'),
20
+ z.number().describe('quatX'),
21
+ z.number().describe('quatY'),
22
+ z.number().describe('quatZ'),
23
+ z.number().describe('quatW'),
24
+ z.number().describe('scaleX'),
25
+ z.number().describe('scaleY'),
26
+ z.number().describe('scaleZ'),
27
+ ]))
28
+ .describe('Instance-transform asset (.instances.json): an array of 10-number tuples ' +
29
+ '[posX,posY,posZ, quatX,quatY,quatZ,quatW, scaleX,scaleY,scaleZ], one per instance. ' +
30
+ 'Referenced by a mesh via `mesh.instances` and rendered as a single THREE.InstancedMesh ' +
31
+ '(one draw call).');
@@ -0,0 +1,21 @@
1
+ import { z } from 'zod';
2
+ export declare const LightDescriptorSchema: z.ZodObject<{
3
+ type: z.ZodEnum<{
4
+ area: "area";
5
+ directional: "directional";
6
+ point: "point";
7
+ spot: "spot";
8
+ hemisphere: "hemisphere";
9
+ }>;
10
+ color: z.ZodOptional<z.ZodString>;
11
+ intensity: z.ZodOptional<z.ZodNumber>;
12
+ groundColor: z.ZodOptional<z.ZodString>;
13
+ distance: z.ZodOptional<z.ZodNumber>;
14
+ decay: z.ZodOptional<z.ZodNumber>;
15
+ angle: z.ZodOptional<z.ZodNumber>;
16
+ penumbra: z.ZodOptional<z.ZodNumber>;
17
+ width: z.ZodOptional<z.ZodNumber>;
18
+ height: z.ZodOptional<z.ZodNumber>;
19
+ }, z.core.$strip>;
20
+ export type LightDescriptor = z.infer<typeof LightDescriptorSchema>;
21
+ //# sourceMappingURL=light.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"light.d.ts","sourceRoot":"","sources":["../../src/asset-formats/light.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AA4CxB,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;iBAGM,CAAC;AAEzC,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC"}
@@ -0,0 +1,35 @@
1
+ import { z } from 'zod';
2
+ const LightDescriptorBase = z.object({
3
+ type: z.enum(['directional', 'point', 'spot', 'hemisphere', 'area']).describe('Light type'),
4
+ color: z.string().optional().describe('Light color as CSS hex string'),
5
+ intensity: z
6
+ .number()
7
+ .optional()
8
+ .describe('Native Three.js light intensity. Point and spot lights use candela with inverse-square ' +
9
+ 'falloff (a value near 1 is candle-scale); area lights use nit; directional and ' +
10
+ 'hemisphere lights use Three.js scene-light intensity units.'),
11
+ groundColor: z.string().optional().describe('Ground color for hemisphere lights'),
12
+ distance: z
13
+ .number()
14
+ .optional()
15
+ .describe('Maximum range of the light. 0 = infinite (point/spot only)'),
16
+ decay: z
17
+ .number()
18
+ .nonnegative()
19
+ .optional()
20
+ .describe('Native Three.js distance-decay exponent for point/spot lights. Default 2 gives ' +
21
+ 'physically correct inverse-square falloff.'),
22
+ angle: z.number().optional().describe('Spotlight cone angle in radians (spot only)'),
23
+ penumbra: z.number().optional().describe('Spotlight penumbra softness 0–1 (spot only)'),
24
+ width: z
25
+ .number()
26
+ .optional()
27
+ .describe('Area light width (area only). RectAreaLight has NO shadow support and only affects ' +
28
+ 'Standard/Physical materials — degrades loudly, not silently.'),
29
+ height: z
30
+ .number()
31
+ .optional()
32
+ .describe('Area light height (area only). RectAreaLight has NO shadow support and only affects ' +
33
+ 'Standard/Physical materials — degrades loudly, not silently.'),
34
+ });
35
+ export const LightDescriptorSchema = LightDescriptorBase.refine((l) => l.type !== 'spot' || l.angle === undefined || l.angle > 0, { message: 'Spot light angle must be positive' }).describe('Light source configuration');