@vgai/engine 0.5.4 → 0.5.6

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 (448) 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/runtime/mount-game.ts +6 -0
  445. package/src/runtime/unexported-game-trap.ts +82 -0
  446. package/src/setup/setup-renderer.ts +2 -0
  447. package/src/world3d-react/index.ts +9 -0
  448. package/src/world3d-react/rapier-physics-bridge.tsx +137 -0
@@ -0,0 +1,233 @@
1
+ /**
2
+ * Single source of truth for default values the engine's factories read.
3
+ *
4
+ * WO-8 deleted SEVEN groups — `transform`, `entity`, `audio`, `shadow`,
5
+ * `animation`, `fog`, `environment` — because every one of their readers was a
6
+ * `.vscn.json` consumer (`entity-factory.ts`, `scene-loader.ts`,
7
+ * `scene-sync.ts`, `scene-serializer.ts`, the per-section inspectors) and
8
+ * `defaults-source-scan.test.ts` reported them with ZERO `DEFAULTS.<group>`
9
+ * readers anywhere in engine/editor src or tests. That guard offers two remedies
10
+ * — wire the group to the factory that reads it, or delete it if truly unused —
11
+ * and there is no surviving factory to wire these to: `transform` restated
12
+ * THREE's own Object3D constructor values, `entity.locked`/ `pivot` were
13
+ * descriptor-only fields, and `fog`/`environment.envMapIntensity`/ `shadow` were
14
+ * the `.vscn` `environment` block that `render-env.ts` explicitly did NOT carry
15
+ * forward. Keeping them would have been exactly the dead documentation T1.13
16
+ * created this guard to prevent.
17
+ *
18
+ */
19
+ export declare const DEFAULTS: {
20
+ readonly material: {
21
+ readonly type: "standard";
22
+ readonly color: "#888888";
23
+ readonly metalness: 0;
24
+ readonly roughness: 0.5;
25
+ readonly emissive: "#000000";
26
+ readonly emissiveIntensity: 0;
27
+ readonly opacity: 1;
28
+ readonly transparent: false;
29
+ readonly side: "front";
30
+ readonly flatShading: false;
31
+ readonly clearcoat: {
32
+ readonly clearcoat: 1;
33
+ readonly clearcoatRoughness: 0;
34
+ };
35
+ readonly transmission: {
36
+ readonly transmission: 1;
37
+ readonly ior: 1.5;
38
+ readonly thickness: 0.5;
39
+ };
40
+ readonly sheen: {
41
+ readonly sheen: 1;
42
+ readonly sheenColor: "#ffffff";
43
+ readonly sheenRoughness: 0.5;
44
+ };
45
+ readonly iridescence: {
46
+ readonly iridescence: 1;
47
+ readonly iridescenceIOR: 1.3;
48
+ readonly iridescenceThicknessRange: [number, number];
49
+ };
50
+ readonly displacementScale: 1;
51
+ readonly displacementBias: 0;
52
+ };
53
+ readonly light: {
54
+ readonly color: "#ffffff";
55
+ readonly intensity: 1;
56
+ readonly groundColor: "#000000";
57
+ readonly distance: 0;
58
+ readonly decay: 2;
59
+ readonly angle: number;
60
+ readonly penumbra: 0;
61
+ readonly width: 10;
62
+ readonly height: 10;
63
+ };
64
+ readonly camera: {
65
+ readonly fov: 60;
66
+ readonly near: 0.1;
67
+ readonly far: 1000;
68
+ readonly orthoSize: 5;
69
+ readonly width: 1920;
70
+ readonly height: 1080;
71
+ };
72
+ readonly collider: {
73
+ readonly cuboid: {
74
+ readonly halfExtents: [number, number, number];
75
+ };
76
+ readonly ball: {
77
+ readonly radius: 0.5;
78
+ };
79
+ readonly capsule: {
80
+ readonly radius: 0.25;
81
+ readonly halfHeight: 0.5;
82
+ };
83
+ };
84
+ readonly toneMapping: {
85
+ readonly mode: "aces";
86
+ readonly exposure: 1;
87
+ };
88
+ readonly postProcessing: {
89
+ readonly bloom: {
90
+ readonly intensity: 1;
91
+ readonly luminanceThreshold: 0.9;
92
+ readonly luminanceSmoothing: 0.025;
93
+ };
94
+ readonly vignette: {
95
+ readonly darkness: 0.5;
96
+ readonly offset: 0.5;
97
+ };
98
+ readonly brightnessContrast: {
99
+ readonly brightness: 0;
100
+ readonly contrast: 0;
101
+ };
102
+ readonly hueSaturation: {
103
+ readonly hue: 0;
104
+ readonly saturation: 0;
105
+ };
106
+ readonly sepia: {
107
+ readonly intensity: 1;
108
+ };
109
+ readonly colorDepth: {
110
+ readonly bits: 16;
111
+ };
112
+ readonly chromaticAberration: {
113
+ readonly offsetX: 0.002;
114
+ readonly offsetY: 0.002;
115
+ readonly modulationOffset: 0.15;
116
+ };
117
+ readonly lensDistortion: {
118
+ readonly distortionX: 0;
119
+ readonly distortionY: 0;
120
+ readonly focalLengthX: 1;
121
+ readonly focalLengthY: 1;
122
+ readonly skew: 0;
123
+ };
124
+ readonly depthOfField: {
125
+ readonly worldFocusDistance: 10;
126
+ readonly worldFocusRange: 5;
127
+ readonly bokehScale: 3;
128
+ readonly focalLength: 0.04;
129
+ };
130
+ readonly tiltShift: {
131
+ readonly offset: 0;
132
+ readonly rotation: 0;
133
+ readonly focusArea: 0.4;
134
+ readonly feather: 0.3;
135
+ };
136
+ readonly noise: {
137
+ readonly premultiply: false;
138
+ };
139
+ readonly scanline: {
140
+ readonly density: 1.25;
141
+ };
142
+ readonly dotScreen: {
143
+ readonly angle: 1.57;
144
+ readonly scale: 1;
145
+ };
146
+ readonly grid: {
147
+ readonly scale: 1;
148
+ readonly lineWidth: 0;
149
+ };
150
+ readonly pixelation: {
151
+ readonly granularity: 6;
152
+ };
153
+ readonly glitch: {
154
+ readonly delayX: 1.5;
155
+ readonly delayY: 3.5;
156
+ readonly durationX: 0.6;
157
+ readonly durationY: 1;
158
+ readonly strengthX: 0.3;
159
+ readonly strengthY: 1;
160
+ readonly columns: 0.05;
161
+ readonly ratio: 0.85;
162
+ };
163
+ readonly shockWave: {
164
+ readonly speed: 2;
165
+ readonly maxRadius: 1;
166
+ readonly waveSize: 0.2;
167
+ readonly amplitude: 0.05;
168
+ };
169
+ readonly smaa: {
170
+ readonly preset: "high";
171
+ };
172
+ readonly ssao: {
173
+ readonly radius: 0.05;
174
+ readonly intensity: 2;
175
+ readonly bias: 0.025;
176
+ readonly samples: 16;
177
+ readonly rings: 7;
178
+ readonly fade: 0.01;
179
+ };
180
+ readonly n8ao: {
181
+ readonly aoSamples: 16;
182
+ readonly aoRadius: 5;
183
+ readonly intensity: 5;
184
+ readonly denoiseSamples: 8;
185
+ readonly denoiseRadius: 12;
186
+ readonly distanceFalloff: 1;
187
+ };
188
+ readonly godRays: {
189
+ readonly density: 0.96;
190
+ readonly decay: 0.93;
191
+ readonly weight: 0.4;
192
+ readonly exposure: 0.6;
193
+ readonly samples: 60;
194
+ };
195
+ readonly outline: {
196
+ readonly edgeStrength: 3;
197
+ readonly pulseSpeed: 0;
198
+ readonly visibleEdgeColor: "#ffffff";
199
+ readonly hiddenEdgeColor: "#22090a";
200
+ };
201
+ readonly ssr: {
202
+ readonly intensity: 1;
203
+ readonly exponent: 1;
204
+ readonly distance: 10;
205
+ readonly thickness: 10;
206
+ readonly maxRoughness: 1;
207
+ };
208
+ readonly ssgi: {
209
+ readonly intensity: 1;
210
+ readonly distance: 10;
211
+ readonly thickness: 10;
212
+ readonly maxRoughness: 1;
213
+ };
214
+ readonly motionBlur: {
215
+ readonly intensity: 1;
216
+ readonly jitter: 1;
217
+ readonly samples: 16;
218
+ };
219
+ };
220
+ readonly navigation: {
221
+ readonly cellSize: 0.3;
222
+ readonly cellHeight: 0.2;
223
+ readonly walkableSlopeAngle: 45;
224
+ readonly walkableHeight: 2;
225
+ readonly walkableClimb: 1;
226
+ readonly walkableRadius: 0.5;
227
+ readonly maxEdgeLen: 12;
228
+ readonly maxSimplificationError: 1.3;
229
+ readonly minRegionArea: 8;
230
+ readonly mergeRegionArea: 20;
231
+ };
232
+ };
233
+ //# sourceMappingURL=defaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"defaults.d.ts","sourceRoot":"","sources":["../src/defaults.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAkB0B,CAAC,MAAM,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;kCA6BjB,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6E5D,CAAC"}
@@ -0,0 +1,137 @@
1
+ /**
2
+ * Single source of truth for default values the engine's factories read.
3
+ *
4
+ * WO-8 deleted SEVEN groups — `transform`, `entity`, `audio`, `shadow`,
5
+ * `animation`, `fog`, `environment` — because every one of their readers was a
6
+ * `.vscn.json` consumer (`entity-factory.ts`, `scene-loader.ts`,
7
+ * `scene-sync.ts`, `scene-serializer.ts`, the per-section inspectors) and
8
+ * `defaults-source-scan.test.ts` reported them with ZERO `DEFAULTS.<group>`
9
+ * readers anywhere in engine/editor src or tests. That guard offers two remedies
10
+ * — wire the group to the factory that reads it, or delete it if truly unused —
11
+ * and there is no surviving factory to wire these to: `transform` restated
12
+ * THREE's own Object3D constructor values, `entity.locked`/ `pivot` were
13
+ * descriptor-only fields, and `fog`/`environment.envMapIntensity`/ `shadow` were
14
+ * the `.vscn` `environment` block that `render-env.ts` explicitly did NOT carry
15
+ * forward. Keeping them would have been exactly the dead documentation T1.13
16
+ * created this guard to prevent.
17
+ *
18
+ */
19
+ export const DEFAULTS = {
20
+ material: {
21
+ type: 'standard',
22
+ color: '#888888',
23
+ metalness: 0,
24
+ roughness: 0.5,
25
+ emissive: '#000000',
26
+ emissiveIntensity: 0,
27
+ opacity: 1,
28
+ transparent: false,
29
+ side: 'front',
30
+ flatShading: false,
31
+ clearcoat: { clearcoat: 1, clearcoatRoughness: 0 },
32
+ transmission: { transmission: 1, ior: 1.5, thickness: 0.5 },
33
+ sheen: { sheen: 1, sheenColor: '#ffffff', sheenRoughness: 0.5 },
34
+ iridescence: {
35
+ iridescence: 1,
36
+ iridescenceIOR: 1.3,
37
+ iridescenceThicknessRange: [100, 400],
38
+ },
39
+ displacementScale: 1,
40
+ displacementBias: 0,
41
+ },
42
+ light: {
43
+ color: '#ffffff',
44
+ intensity: 1,
45
+ groundColor: '#000000',
46
+ distance: 0,
47
+ decay: 2,
48
+ angle: Math.PI / 6,
49
+ penumbra: 0,
50
+ // three.js's own RectAreaLight constructor defaults (area lights only).
51
+ width: 10,
52
+ height: 10,
53
+ },
54
+ camera: {
55
+ fov: 60,
56
+ near: 0.1,
57
+ far: 1000,
58
+ orthoSize: 5,
59
+ width: 1920,
60
+ height: 1080,
61
+ },
62
+ collider: {
63
+ cuboid: { halfExtents: [0.5, 0.5, 0.5] },
64
+ ball: { radius: 0.5 },
65
+ capsule: { radius: 0.25, halfHeight: 0.5 },
66
+ },
67
+ toneMapping: {
68
+ // T1.13: the effective renderer default is ACES (see
69
+ // setup-renderer.ts's `createHostRenderer` + `applyScenePostProcessing`,
70
+ // which both hardcode `THREE.ACESFilmicToneMapping`/'aces' as the
71
+ // fallback when a scene omits `environment.toneMapping`) — NOT 'none'.
72
+ // This used to say 'none', silently disagreeing with the runtime and
73
+ // with the editor's Tone Mapping inspector dropdown.
74
+ mode: 'aces',
75
+ exposure: 1.0,
76
+ },
77
+ postProcessing: {
78
+ bloom: { intensity: 1.0, luminanceThreshold: 0.9, luminanceSmoothing: 0.025 },
79
+ vignette: { darkness: 0.5, offset: 0.5 },
80
+ brightnessContrast: { brightness: 0, contrast: 0 },
81
+ hueSaturation: { hue: 0, saturation: 0 },
82
+ sepia: { intensity: 1.0 },
83
+ colorDepth: { bits: 16 },
84
+ chromaticAberration: { offsetX: 0.002, offsetY: 0.002, modulationOffset: 0.15 },
85
+ lensDistortion: { distortionX: 0, distortionY: 0, focalLengthX: 1, focalLengthY: 1, skew: 0 },
86
+ depthOfField: { worldFocusDistance: 10, worldFocusRange: 5, bokehScale: 3, focalLength: 0.04 },
87
+ tiltShift: { offset: 0, rotation: 0, focusArea: 0.4, feather: 0.3 },
88
+ noise: { premultiply: false },
89
+ scanline: { density: 1.25 },
90
+ dotScreen: { angle: 1.57, scale: 1.0 },
91
+ grid: { scale: 1.0, lineWidth: 0.0 },
92
+ pixelation: { granularity: 6 },
93
+ glitch: {
94
+ delayX: 1.5,
95
+ delayY: 3.5,
96
+ durationX: 0.6,
97
+ durationY: 1.0,
98
+ strengthX: 0.3,
99
+ strengthY: 1.0,
100
+ columns: 0.05,
101
+ ratio: 0.85,
102
+ },
103
+ shockWave: { speed: 2, maxRadius: 1, waveSize: 0.2, amplitude: 0.05 },
104
+ smaa: { preset: 'high' },
105
+ ssao: { radius: 0.05, intensity: 2.0, bias: 0.025, samples: 16, rings: 7, fade: 0.01 },
106
+ n8ao: {
107
+ aoSamples: 16,
108
+ aoRadius: 5.0,
109
+ intensity: 5,
110
+ denoiseSamples: 8,
111
+ denoiseRadius: 12,
112
+ distanceFalloff: 1.0,
113
+ },
114
+ godRays: { density: 0.96, decay: 0.93, weight: 0.4, exposure: 0.6, samples: 60 },
115
+ outline: {
116
+ edgeStrength: 3,
117
+ pulseSpeed: 0,
118
+ visibleEdgeColor: '#ffffff',
119
+ hiddenEdgeColor: '#22090a',
120
+ },
121
+ ssr: { intensity: 1, exponent: 1, distance: 10, thickness: 10, maxRoughness: 1 },
122
+ ssgi: { intensity: 1, distance: 10, thickness: 10, maxRoughness: 1 },
123
+ motionBlur: { intensity: 1, jitter: 1, samples: 16 },
124
+ },
125
+ navigation: {
126
+ cellSize: 0.3,
127
+ cellHeight: 0.2,
128
+ walkableSlopeAngle: 45,
129
+ walkableHeight: 2,
130
+ walkableClimb: 1,
131
+ walkableRadius: 0.5,
132
+ maxEdgeLen: 12,
133
+ maxSimplificationError: 1.3,
134
+ minRegionArea: 8,
135
+ mergeRegionArea: 20,
136
+ },
137
+ };
@@ -0,0 +1,45 @@
1
+ /**
2
+ * Chrome Trace Event Format exporter (W4b, F11 profiler → chrome://tracing /
3
+ * Perfetto). A PURE, deterministic function over recorded
4
+ * {@link PerformanceFrame}s — no clock reads, no randomness, no I/O — so the
5
+ * same frames always serialize to byte-identical output (asserted by the unit
6
+ * test).
7
+ *
8
+ * Format (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU):
9
+ * - `M` metadata events name the process and thread.
10
+ * - One `X` (complete) event per frame — `ts` at the frame's absolute start,
11
+ * `dur` the frame's CPU time — with nested `X` events per phase and per
12
+ * system placed at their MEASURED `startMs` offsets inside the frame.
13
+ * - One `C` (counter) event per frame carries the render draw/triangle
14
+ * counters, so the trace viewer draws them as a graph track.
15
+ *
16
+ * All times are microseconds (the format's unit); our profiler measures ms, so
17
+ * every ms value is × 1000. Every event carries the full key set
18
+ * (`ph/ts/dur/pid/tid/name/cat`) for uniformity — metadata/counter events
19
+ * would normally omit `dur`, but a constant `dur: 0` is harmless to the viewer
20
+ * and lets a consumer read every event without per-`ph` branching.
21
+ */
22
+ import type { PerformanceFrame } from './performance-profiler';
23
+ export interface ChromeTraceEvent {
24
+ readonly name: string;
25
+ readonly cat: string;
26
+ readonly ph: 'X' | 'M' | 'C';
27
+ /** Timestamp, microseconds. */
28
+ readonly ts: number;
29
+ /** Duration, microseconds (0 for metadata/counter events). */
30
+ readonly dur: number;
31
+ readonly pid: number;
32
+ readonly tid: number;
33
+ readonly args?: Record<string, unknown>;
34
+ }
35
+ export interface ChromeTraceFile {
36
+ readonly traceEvents: readonly ChromeTraceEvent[];
37
+ readonly displayTimeUnit: 'ms';
38
+ readonly otherData: Record<string, unknown>;
39
+ }
40
+ export interface ChromeTraceOptions {
41
+ processName: string;
42
+ threadName: string;
43
+ }
44
+ export declare function buildChromeTrace(frames: readonly PerformanceFrame[], options: ChromeTraceOptions): ChromeTraceFile;
45
+ //# sourceMappingURL=chrome-trace.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chrome-trace.d.ts","sourceRoot":"","sources":["../../src/dev/chrome-trace.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAE/D,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC7B,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,8DAA8D;IAC9D,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACzC;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,WAAW,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAClD,QAAQ,CAAC,eAAe,EAAE,IAAI,CAAC;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,kBAAkB;IACjC,WAAW,EAAE,MAAM,CAAC;IACpB,UAAU,EAAE,MAAM,CAAC;CACpB;AAUD,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,SAAS,gBAAgB,EAAE,EACnC,OAAO,EAAE,kBAAkB,GAC1B,eAAe,CA6FjB"}
@@ -0,0 +1,114 @@
1
+ /**
2
+ * Chrome Trace Event Format exporter (W4b, F11 profiler → chrome://tracing /
3
+ * Perfetto). A PURE, deterministic function over recorded
4
+ * {@link PerformanceFrame}s — no clock reads, no randomness, no I/O — so the
5
+ * same frames always serialize to byte-identical output (asserted by the unit
6
+ * test).
7
+ *
8
+ * Format (https://docs.google.com/document/d/1CvAClvFfyA5R-PhYUmn5OOQtYMH4h6I0nSsKchNAySU):
9
+ * - `M` metadata events name the process and thread.
10
+ * - One `X` (complete) event per frame — `ts` at the frame's absolute start,
11
+ * `dur` the frame's CPU time — with nested `X` events per phase and per
12
+ * system placed at their MEASURED `startMs` offsets inside the frame.
13
+ * - One `C` (counter) event per frame carries the render draw/triangle
14
+ * counters, so the trace viewer draws them as a graph track.
15
+ *
16
+ * All times are microseconds (the format's unit); our profiler measures ms, so
17
+ * every ms value is × 1000. Every event carries the full key set
18
+ * (`ph/ts/dur/pid/tid/name/cat`) for uniformity — metadata/counter events
19
+ * would normally omit `dur`, but a constant `dur: 0` is harmless to the viewer
20
+ * and lets a consumer read every event without per-`ph` branching.
21
+ */
22
+ const PID = 1;
23
+ const TID = 1;
24
+ const MS_TO_US = 1000;
25
+ function ms(value) {
26
+ return Math.round(value * MS_TO_US);
27
+ }
28
+ export function buildChromeTrace(frames, options) {
29
+ const events = [];
30
+ // Metadata: name the process + thread the frames live on.
31
+ events.push({
32
+ name: 'process_name',
33
+ cat: '__metadata',
34
+ ph: 'M',
35
+ ts: 0,
36
+ dur: 0,
37
+ pid: PID,
38
+ tid: TID,
39
+ args: { name: options.processName },
40
+ });
41
+ events.push({
42
+ name: 'thread_name',
43
+ cat: '__metadata',
44
+ ph: 'M',
45
+ ts: 0,
46
+ dur: 0,
47
+ pid: PID,
48
+ tid: TID,
49
+ args: { name: options.threadName },
50
+ });
51
+ for (const frame of frames) {
52
+ // Absolute frame start (ms): timestamp is the frame's END, cpuMs its span.
53
+ const frameStartMs = frame.timestamp - frame.cpuMs;
54
+ const frameStartUs = ms(frameStartMs);
55
+ events.push({
56
+ name: `frame ${frame.id}`,
57
+ cat: 'frame',
58
+ ph: 'X',
59
+ ts: frameStartUs,
60
+ dur: ms(frame.cpuMs),
61
+ pid: PID,
62
+ tid: TID,
63
+ args: {
64
+ id: frame.id,
65
+ drawCalls: frame.render.drawCalls,
66
+ triangles: frame.render.triangles,
67
+ },
68
+ });
69
+ for (const phase of frame.phases) {
70
+ events.push({
71
+ name: phase.name,
72
+ cat: 'phase',
73
+ ph: 'X',
74
+ ts: ms(frameStartMs + (phase.startMs ?? 0)),
75
+ dur: ms(phase.ms),
76
+ pid: PID,
77
+ tid: TID,
78
+ });
79
+ }
80
+ for (const system of frame.systems) {
81
+ events.push({
82
+ name: system.name,
83
+ cat: 'system',
84
+ ph: 'X',
85
+ ts: ms(frameStartMs + system.startMs),
86
+ dur: ms(system.ms),
87
+ pid: PID,
88
+ tid: TID,
89
+ args: { phase: system.phase },
90
+ });
91
+ }
92
+ // Counter track: render draw/triangle counts at this frame's start.
93
+ events.push({
94
+ name: 'render',
95
+ cat: 'counter',
96
+ ph: 'C',
97
+ ts: frameStartUs,
98
+ dur: 0,
99
+ pid: PID,
100
+ tid: TID,
101
+ args: { drawCalls: frame.render.drawCalls, triangles: frame.render.triangles },
102
+ });
103
+ }
104
+ return {
105
+ traceEvents: events,
106
+ displayTimeUnit: 'ms',
107
+ otherData: {
108
+ version: 2,
109
+ processName: options.processName,
110
+ threadName: options.threadName,
111
+ frameCount: frames.length,
112
+ },
113
+ };
114
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Dev-mode console bridge.
3
+ *
4
+ * Monkey-patches console.log / warn / error to also broadcast each message
5
+ * via `window.postMessage`. Any parent frame (IDE, editor, test harness) can
6
+ * listen for these messages — if nobody is listening they simply go nowhere.
7
+ *
8
+ * Also captures unhandled errors and promise rejections.
9
+ *
10
+ * Call once, as early as possible in the entry point:
11
+ *
12
+ * import { installConsoleBridge } from '@engine/dev/console-bridge';
13
+ * if (import.meta.env.DEV) installConsoleBridge();
14
+ */
15
+ export interface ConsoleBridgeMessage {
16
+ type: 'console-bridge';
17
+ level: 'log' | 'warn' | 'error';
18
+ message: string;
19
+ timestamp: number;
20
+ }
21
+ export declare function installConsoleBridge(): void;
22
+ //# sourceMappingURL=console-bridge.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"console-bridge.d.ts","sourceRoot":"","sources":["../../src/dev/console-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,MAAM,WAAW,oBAAoB;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,OAAO,CAAC;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;CACnB;AA6BD,wBAAgB,oBAAoB,IAAI,IAAI,CAiC3C"}
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Dev-mode console bridge.
3
+ *
4
+ * Monkey-patches console.log / warn / error to also broadcast each message
5
+ * via `window.postMessage`. Any parent frame (IDE, editor, test harness) can
6
+ * listen for these messages — if nobody is listening they simply go nowhere.
7
+ *
8
+ * Also captures unhandled errors and promise rejections.
9
+ *
10
+ * Call once, as early as possible in the entry point:
11
+ *
12
+ * import { installConsoleBridge } from '@engine/dev/console-bridge';
13
+ * if (import.meta.env.DEV) installConsoleBridge();
14
+ */
15
+ const LEVELS = ['log', 'warn', 'error'];
16
+ function post(level, message) {
17
+ const msg = {
18
+ type: 'console-bridge',
19
+ level,
20
+ message,
21
+ timestamp: Date.now(),
22
+ };
23
+ window.postMessage(msg, '*');
24
+ }
25
+ function stringify(args) {
26
+ return args
27
+ .map((a) => {
28
+ if (typeof a === 'string')
29
+ return a;
30
+ try {
31
+ return JSON.stringify(a);
32
+ }
33
+ catch {
34
+ return String(a);
35
+ }
36
+ })
37
+ .join(' ');
38
+ }
39
+ let installed = false;
40
+ export function installConsoleBridge() {
41
+ // Idempotent: a second call must not double-patch console (which would
42
+ // double-post every message) nor add duplicate window listeners.
43
+ if (installed)
44
+ return;
45
+ installed = true;
46
+ // Lazy import — avoid hard dep; if logger.ts isn't bundled the flag stays false
47
+ let getFlag = () => false;
48
+ import('./logger')
49
+ .then((m) => {
50
+ getFlag = () => m._engineLogActive;
51
+ })
52
+ .catch(() => { });
53
+ // Patch console methods
54
+ for (const level of LEVELS) {
55
+ const original = console[level].bind(console);
56
+ console[level] = (...args) => {
57
+ original(...args);
58
+ // Skip bridge posting when the engine logger is handling the message
59
+ // (it posts its own structured 'engine-log' message instead)
60
+ if (!getFlag())
61
+ post(level, stringify(args));
62
+ };
63
+ }
64
+ // Capture unhandled errors
65
+ window.addEventListener('error', (e) => {
66
+ post('error', e.message || String(e.error));
67
+ });
68
+ window.addEventListener('unhandledrejection', (e) => {
69
+ post('error', `Unhandled promise rejection: ${e.reason}`);
70
+ });
71
+ }
@@ -0,0 +1,24 @@
1
+ import * as THREE from 'three';
2
+ /**
3
+ * Debug drawing utilities for development.
4
+ *
5
+ * Draw lines, spheres, boxes, and arrows for visualizing
6
+ * physics colliders, raycasts, AI paths, etc.
7
+ *
8
+ * All debug objects are added to a dedicated group that can be toggled.
9
+ */
10
+ export declare function createDebugDraw(scene: THREE.Scene): {
11
+ /** Draw a line between two points */
12
+ line(from: THREE.Vector3, to: THREE.Vector3, color?: number): THREE.Line<THREE.BufferGeometry<THREE.NormalBufferAttributes, THREE.BufferGeometryEventMap>, THREE.LineBasicMaterial, THREE.Object3DEventMap>;
13
+ /** Draw a wireframe sphere at a position */
14
+ sphere(center: THREE.Vector3, radius?: number, color?: number): THREE.Mesh<THREE.SphereGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
15
+ /** Draw a wireframe box */
16
+ box(center: THREE.Vector3, size: THREE.Vector3, color?: number): THREE.Mesh<THREE.BoxGeometry, THREE.MeshBasicMaterial, THREE.Object3DEventMap>;
17
+ /** Draw an arrow (direction indicator) */
18
+ arrow(origin: THREE.Vector3, direction: THREE.Vector3, length?: number, color?: number): THREE.ArrowHelper;
19
+ /** Clear all debug drawings */
20
+ clear(): void;
21
+ /** Toggle debug draw visibility */
22
+ visible: boolean;
23
+ };
24
+ //# sourceMappingURL=debug-draw.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"debug-draw.d.ts","sourceRoot":"","sources":["../../src/dev/debug-draw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK;IAM9C,qCAAqC;eAC1B,KAAK,CAAC,OAAO,MAAM,KAAK,CAAC,OAAO;IAQ3C,4CAA4C;mBAC7B,KAAK,CAAC,OAAO;IAS5B,2BAA2B;gBACf,KAAK,CAAC,OAAO,QAAQ,KAAK,CAAC,OAAO;IAS9C,0CAA0C;kBAC5B,KAAK,CAAC,OAAO,aAAa,KAAK,CAAC,OAAO;IAQrD,+BAA+B;;IAgB/B,mCAAmC;aACpB,OAAO;EAQzB"}