@vgai/engine 0.5.5 → 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 (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,64 @@
1
+ /**
2
+ * Structural identity — the deterministic id scheme (and the small material
3
+ * reflection helper that rides along with it) the editor's live-three authoring
4
+ * adapter uses to address the objects of a world whose source carries no
5
+ * serve-time identity stamps
6
+ * (`packages/editor/src/authoring/live-three-identity.ts`, `structuralIdentity`).
7
+ *
8
+ * Identity: each object gets a **structural-path id** — deterministic from the
9
+ * scene's shape (position in the tree + three.js type + name), so the SAME id
10
+ * re-binds to the SAME object after the game rebuilds its scene within a
11
+ * session. It is also written to `userData.entityId` so the editor's object map
12
+ * / gizmo / selection (which key on `entityId`) bind to foreign objects with no
13
+ * further shim.
14
+ *
15
+ * This module used to be the shared core of a per-game JSON sidecar
16
+ * persistence system, which was deleted outright (2026-08-02) — ingest edits
17
+ * are LIVE-ONLY now. The id scheme survives because it is what makes the live
18
+ * hierarchy/selection/inspector work at all; nothing here reads or writes a
19
+ * file.
20
+ */
21
+ import type * as THREE from 'three';
22
+ /** Fixed id for the captured render camera (not a scene child, so no structural path). */
23
+ export declare const CAMERA_ID = "ingest:camera";
24
+ /**
25
+ * The material whose colour a mesh's swatch reflects, if it has one.
26
+ *
27
+ * A multi-material mesh reflects its FIRST slot — that is what a single swatch
28
+ * can honestly stand for, and it is also the slot a creation-site anchor for
29
+ * `material.color` resolves against. Returns `null` for anything with no
30
+ * `color` at all rather than fabricating one.
31
+ */
32
+ export declare function colorMaterialOf(o: THREE.Object3D): THREE.MeshStandardMaterial | null;
33
+ /** Result of a structural-path walk: the id→object map plus a few reflection stats. */
34
+ export interface StructuralIdWalk {
35
+ byId: Map<string, THREE.Object3D>;
36
+ count: number;
37
+ meshes: number;
38
+ lights: number;
39
+ }
40
+ /**
41
+ * (Re)assign structural-path ids to every object under `scene` (and, if
42
+ * given, the separately-captured render `camera`, under the fixed
43
+ * {@link CAMERA_ID}). Idempotent and deterministic from scene structure
44
+ * (position + type + name) — so a re-walk after the game rebuilds part of its
45
+ * tree re-binds the same ids to the same objects.
46
+ *
47
+ * EDITOR FURNITURE IS EXCLUDED, and that exclusion is load-bearing rather than
48
+ * cosmetic. In ingest mode the editor adds its grid, lights, particle
49
+ * BatchedRenderer and TransformControls gizmo to the GAME'S OWN scene, and
50
+ * they arrive asynchronously — some before the walk, some after. Indexing them
51
+ * made a game object's path depend on how much editor furniture happened to be
52
+ * attached at walk time, so the same mesh changed id across a re-walk (observed
53
+ * in the games-fps ingest: an object addressed as `ingest:106/0/0/0:…` came
54
+ * back as `ingest:102/0:Mesh:Cube004` — four root slots earlier, exactly the
55
+ * grid + two editor lights + BatchedRenderer).
56
+ *
57
+ * Skipping the furniture entirely — not merely declining to give it an id —
58
+ * is what fixes that: the game's own children occupy 0..N-1 whatever else is
59
+ * parented alongside them. It also keeps gizmo handles and the grid out of the
60
+ * hierarchy/inspector projections built on this walk, where they were
61
+ * selectable and colorable as if they were game content.
62
+ */
63
+ export declare function assignStructuralIds(scene: THREE.Object3D, camera?: THREE.Object3D | undefined): StructuralIdWalk;
64
+ //# sourceMappingURL=structural-ids.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"structural-ids.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/structural-ids.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AAGpC,0FAA0F;AAC1F,eAAO,MAAM,SAAS,kBAAkB,CAAC;AAoBzC;;;;;;;GAOG;AACH,wBAAgB,eAAe,CAAC,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,KAAK,CAAC,oBAAoB,GAAG,IAAI,CAKpF;AAED,uFAAuF;AACvF,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,KAAK,CAAC,QAAQ,EACrB,MAAM,CAAC,EAAE,KAAK,CAAC,QAAQ,GAAG,SAAS,GAClC,gBAAgB,CAgClB"}
@@ -0,0 +1,110 @@
1
+ /**
2
+ * Structural identity — the deterministic id scheme (and the small material
3
+ * reflection helper that rides along with it) the editor's live-three authoring
4
+ * adapter uses to address the objects of a world whose source carries no
5
+ * serve-time identity stamps
6
+ * (`packages/editor/src/authoring/live-three-identity.ts`, `structuralIdentity`).
7
+ *
8
+ * Identity: each object gets a **structural-path id** — deterministic from the
9
+ * scene's shape (position in the tree + three.js type + name), so the SAME id
10
+ * re-binds to the SAME object after the game rebuilds its scene within a
11
+ * session. It is also written to `userData.entityId` so the editor's object map
12
+ * / gizmo / selection (which key on `entityId`) bind to foreign objects with no
13
+ * further shim.
14
+ *
15
+ * This module used to be the shared core of a per-game JSON sidecar
16
+ * persistence system, which was deleted outright (2026-08-02) — ingest edits
17
+ * are LIVE-ONLY now. The id scheme survives because it is what makes the live
18
+ * hierarchy/selection/inspector work at all; nothing here reads or writes a
19
+ * file.
20
+ */
21
+ import { setUserData } from '../../ecs/user-data';
22
+ /** Fixed id for the captured render camera (not a scene child, so no structural path). */
23
+ export const CAMERA_ID = 'ingest:camera';
24
+ /**
25
+ * The editor parks its OWN objects — grid, its two lights, the particle
26
+ * BatchedRenderer, every TransformControls/gizmo helper — on layer 31
27
+ * (`packages/editor/src/editor-layers.ts`'s `EDITOR_LAYER`) so the game camera
28
+ * never sees them. In ingest mode those objects are added to the GAME'S OWN
29
+ * scene, which is the same tree this walk indexes.
30
+ */
31
+ const EDITOR_ONLY_LAYER_MASK = 1 << 31;
32
+ /**
33
+ * Editor furniture, not game content. Excluded from the walk entirely — see
34
+ * {@link assignStructuralIds} for why that exclusion is what makes the id
35
+ * scheme's central promise true.
36
+ */
37
+ function isEditorOnly(o) {
38
+ return (o.layers.mask & EDITOR_ONLY_LAYER_MASK) !== 0;
39
+ }
40
+ /**
41
+ * The material whose colour a mesh's swatch reflects, if it has one.
42
+ *
43
+ * A multi-material mesh reflects its FIRST slot — that is what a single swatch
44
+ * can honestly stand for, and it is also the slot a creation-site anchor for
45
+ * `material.color` resolves against. Returns `null` for anything with no
46
+ * `color` at all rather than fabricating one.
47
+ */
48
+ export function colorMaterialOf(o) {
49
+ const mat = o.material;
50
+ if (!mat)
51
+ return null;
52
+ const m = (Array.isArray(mat) ? mat[0] : mat);
53
+ return m?.color ? m : null;
54
+ }
55
+ /**
56
+ * (Re)assign structural-path ids to every object under `scene` (and, if
57
+ * given, the separately-captured render `camera`, under the fixed
58
+ * {@link CAMERA_ID}). Idempotent and deterministic from scene structure
59
+ * (position + type + name) — so a re-walk after the game rebuilds part of its
60
+ * tree re-binds the same ids to the same objects.
61
+ *
62
+ * EDITOR FURNITURE IS EXCLUDED, and that exclusion is load-bearing rather than
63
+ * cosmetic. In ingest mode the editor adds its grid, lights, particle
64
+ * BatchedRenderer and TransformControls gizmo to the GAME'S OWN scene, and
65
+ * they arrive asynchronously — some before the walk, some after. Indexing them
66
+ * made a game object's path depend on how much editor furniture happened to be
67
+ * attached at walk time, so the same mesh changed id across a re-walk (observed
68
+ * in the games-fps ingest: an object addressed as `ingest:106/0/0/0:…` came
69
+ * back as `ingest:102/0:Mesh:Cube004` — four root slots earlier, exactly the
70
+ * grid + two editor lights + BatchedRenderer).
71
+ *
72
+ * Skipping the furniture entirely — not merely declining to give it an id —
73
+ * is what fixes that: the game's own children occupy 0..N-1 whatever else is
74
+ * parented alongside them. It also keeps gizmo handles and the grid out of the
75
+ * hierarchy/inspector projections built on this walk, where they were
76
+ * selectable and colorable as if they were game content.
77
+ */
78
+ export function assignStructuralIds(scene, camera) {
79
+ const byId = new Map();
80
+ let count = 0;
81
+ let meshes = 0;
82
+ let lights = 0;
83
+ const visit = (o, path) => {
84
+ const id = `ingest:${path}:${o.type}:${o.name || ''}`;
85
+ setUserData(o, 'entityId', id);
86
+ byId.set(id, o);
87
+ count++;
88
+ if (o.isLight)
89
+ lights++;
90
+ else if (o.isMesh)
91
+ meshes++;
92
+ visitChildren(o, path);
93
+ };
94
+ const visitChildren = (o, path) => {
95
+ let i = 0;
96
+ for (const c of o.children) {
97
+ if (isEditorOnly(c))
98
+ continue;
99
+ visit(c, path ? `${path}/${i}` : `${i}`);
100
+ i++;
101
+ }
102
+ };
103
+ visitChildren(scene, '');
104
+ if (camera) {
105
+ setUserData(camera, 'entityId', CAMERA_ID);
106
+ byId.set(CAMERA_ID, camera);
107
+ count++;
108
+ }
109
+ return { byId, count, meshes, lights };
110
+ }
@@ -0,0 +1,44 @@
1
+ /**
2
+ * Upstream-pin extraction — R5 ((c)/ §7.1 item 9): the fix for the overlay identity
3
+ * gap the structural-id + `authoredAgainst.gameVersion` scheme (T7.7/D9) does not
4
+ * close. A re-vendor of a vendored upstream game that keeps a slot's shape (index +
5
+ * three.js type + name unchanged) reapplies a saved overlay onto a semantically
6
+ * different object with `applied: 1, orphanedIds: []` — silent wrong-meaning success
7
+ * — because `authoredAgainst.gameVersion` is the MANIFEST's own `version` (hand-set
8
+ * by whoever wrote the ingest manifest, e.g. every `public/ingest/*` vendored game
9
+ * ships `"version": "0.1.0"` regardless of which upstream commit it vendors), never
10
+ * tied to the thing that actually changes on a re-vendor: the `UPSTREAM.md` pin.
11
+ *
12
+ * This module is the pure, dependency-free half (parse text -> pin, or
13
+ * `null`): NO file I/O here, so it is usable from any context (editor
14
+ * save/apply-time hooks over a fetched `/UPSTREAM.md`, a future Node-side
15
+ * CLI check, tests). READ-ONLY by construction — it has no writer; this
16
+ * codebase never generates or edits an `UPSTREAM.md` (the anti-shim rule:
17
+ * adapters never fabricate first-party data, and a game's own vendoring
18
+ * provenance is exactly that).
19
+ *
20
+ * Format (established convention, not invented here — see every
21
+ * `public/ingest/*\/UPSTREAM.md`'s `## Upstream` section, e.g.
22
+ * `public/ingest/tanks/UPSTREAM.md`):
23
+ *
24
+ * ## Upstream
25
+ *
26
+ * - Repo: https://github.com/colyseus/realtime-tanks-demo
27
+ * - Commit: **`6339493130b4b1d4d28f0f52d17b2fba738c7d47`**
28
+ *
29
+ * i.e. a Markdown bullet whose label is `Commit:` and whose value is a bold,
30
+ * backtick-code full (or abbreviated) git SHA. Every vendored game in this
31
+ * repo (`tanks`, `racing-game`, `simcity`) follows this exact shape.
32
+ */
33
+ /**
34
+ * Extract the pinned upstream commit hash from a vendored game's
35
+ * `UPSTREAM.md` prose, or `null` if the file doesn't follow the convention
36
+ * (or wasn't found — the caller decides what a missing file means; this
37
+ * function only parses text it's handed). Never throws — an unparseable
38
+ * document is an honest `null`, not an error (anti-shim: no guessing, no
39
+ * fabricating a pin from a game folder that doesn't declare one, e.g. an
40
+ * externally-authored non-vendored project opened via the CLI-on-folder
41
+ * route).
42
+ */
43
+ export declare function extractUpstreamPin(markdown: string): string | null;
44
+ //# sourceMappingURL=upstream-pin.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"upstream-pin.d.ts","sourceRoot":"","sources":["../../../src/adapter/ingest/upstream-pin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAKH;;;;;;;;;GASG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAElE"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Upstream-pin extraction — R5 ((c)/ §7.1 item 9): the fix for the overlay identity
3
+ * gap the structural-id + `authoredAgainst.gameVersion` scheme (T7.7/D9) does not
4
+ * close. A re-vendor of a vendored upstream game that keeps a slot's shape (index +
5
+ * three.js type + name unchanged) reapplies a saved overlay onto a semantically
6
+ * different object with `applied: 1, orphanedIds: []` — silent wrong-meaning success
7
+ * — because `authoredAgainst.gameVersion` is the MANIFEST's own `version` (hand-set
8
+ * by whoever wrote the ingest manifest, e.g. every `public/ingest/*` vendored game
9
+ * ships `"version": "0.1.0"` regardless of which upstream commit it vendors), never
10
+ * tied to the thing that actually changes on a re-vendor: the `UPSTREAM.md` pin.
11
+ *
12
+ * This module is the pure, dependency-free half (parse text -> pin, or
13
+ * `null`): NO file I/O here, so it is usable from any context (editor
14
+ * save/apply-time hooks over a fetched `/UPSTREAM.md`, a future Node-side
15
+ * CLI check, tests). READ-ONLY by construction — it has no writer; this
16
+ * codebase never generates or edits an `UPSTREAM.md` (the anti-shim rule:
17
+ * adapters never fabricate first-party data, and a game's own vendoring
18
+ * provenance is exactly that).
19
+ *
20
+ * Format (established convention, not invented here — see every
21
+ * `public/ingest/*\/UPSTREAM.md`'s `## Upstream` section, e.g.
22
+ * `public/ingest/tanks/UPSTREAM.md`):
23
+ *
24
+ * ## Upstream
25
+ *
26
+ * - Repo: https://github.com/colyseus/realtime-tanks-demo
27
+ * - Commit: **`6339493130b4b1d4d28f0f52d17b2fba738c7d47`**
28
+ *
29
+ * i.e. a Markdown bullet whose label is `Commit:` and whose value is a bold,
30
+ * backtick-code full (or abbreviated) git SHA. Every vendored game in this
31
+ * repo (`tanks`, `racing-game`, `simcity`) follows this exact shape.
32
+ */
33
+ /** Matches `- Commit: **\`<sha>\`**` (any amount of internal whitespace, case-insensitive hex). */
34
+ const COMMIT_BULLET_RE = /-\s*Commit:\s*\*\*`([0-9a-fA-F]{7,40})`\*\*/;
35
+ /**
36
+ * Extract the pinned upstream commit hash from a vendored game's
37
+ * `UPSTREAM.md` prose, or `null` if the file doesn't follow the convention
38
+ * (or wasn't found — the caller decides what a missing file means; this
39
+ * function only parses text it's handed). Never throws — an unparseable
40
+ * document is an honest `null`, not an error (anti-shim: no guessing, no
41
+ * fabricating a pin from a game folder that doesn't declare one, e.g. an
42
+ * externally-authored non-vendored project opened via the CLI-on-folder
43
+ * route).
44
+ */
45
+ export function extractUpstreamPin(markdown) {
46
+ return COMMIT_BULLET_RE.exec(markdown)?.[1] ?? null;
47
+ }
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Capability-gate shortfall reporting (D10, T7.6) — the honesty half of the
3
+ * play-control contract. §(d) draws the `loop` axis (`gated | self-driven`) as
4
+ * independent of capability tier: a `self-driven` world (an ingested game
5
+ * driving its own rAF/ticker) pauses for real ONLY if its adapter implements an
6
+ * explicit loop-gate capability (`MountedRootBase.setPaused`/`step`) —
7
+ * otherwise it "honestly reports so" rather than a silent no-op (the
8
+ * D5 §5.2 finding: gating a raw-rAF loop from outside was
9
+ * demonstrated and REJECTED). The audio seam (`SystemAdapters.AudioAdapter`)
10
+ * has the identical shape: absent or unable to silence a world's audio on pause
11
+ * must report, not pretend.
12
+ *
13
+ * Pure compute + message-formatting, same split as `achieved-tier.ts`
14
+ * (`packages/editor/src/achieved-tier.ts`) — callers own the actual
15
+ * `console.warn`/`editorConsole.warn` call; this module never logs.
16
+ */
17
+ /** Greppable prefix for a loop-gate shortfall (pause requested, world's loop
18
+ * could not actually be gated). */
19
+ export declare const LOOP_GATE_PREFIX = "loop-gate";
20
+ /** Greppable prefix for an audio-gate shortfall (pause requested, world's
21
+ * audio could not actually be silenced). */
22
+ export declare const AUDIO_GATE_PREFIX = "audio-gate";
23
+ /** One shortfall instance: which world, and why the capability wasn't there. */
24
+ export interface CapabilityGateReport {
25
+ readonly worldId: string;
26
+ readonly reason: string;
27
+ }
28
+ /** Format a loop-gate shortfall message (a `self-driven` world with no
29
+ * working pause capability). */
30
+ export declare function formatLoopGateMessage(report: CapabilityGateReport): string;
31
+ /** Format an audio-gate shortfall message (a world with no `AudioAdapter`, or
32
+ * whose adapter cannot actually silence it). */
33
+ export declare function formatAudioGateMessage(report: CapabilityGateReport): string;
34
+ //# sourceMappingURL=loop-gate-report.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"loop-gate-report.d.ts","sourceRoot":"","sources":["../../src/adapter/loop-gate-report.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH;oCACoC;AACpC,eAAO,MAAM,gBAAgB,cAAc,CAAC;AAE5C;6CAC6C;AAC7C,eAAO,MAAM,iBAAiB,eAAe,CAAC;AAE9C,gFAAgF;AAChF,MAAM,WAAW,oBAAoB;IACnC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAcD;iCACiC;AACjC,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAE1E;AAED;iDACiD;AACjD,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAE3E"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Capability-gate shortfall reporting (D10, T7.6) — the honesty half of the
3
+ * play-control contract. §(d) draws the `loop` axis (`gated | self-driven`) as
4
+ * independent of capability tier: a `self-driven` world (an ingested game
5
+ * driving its own rAF/ticker) pauses for real ONLY if its adapter implements an
6
+ * explicit loop-gate capability (`MountedRootBase.setPaused`/`step`) —
7
+ * otherwise it "honestly reports so" rather than a silent no-op (the
8
+ * D5 §5.2 finding: gating a raw-rAF loop from outside was
9
+ * demonstrated and REJECTED). The audio seam (`SystemAdapters.AudioAdapter`)
10
+ * has the identical shape: absent or unable to silence a world's audio on pause
11
+ * must report, not pretend.
12
+ *
13
+ * Pure compute + message-formatting, same split as `achieved-tier.ts`
14
+ * (`packages/editor/src/achieved-tier.ts`) — callers own the actual
15
+ * `console.warn`/`editorConsole.warn` call; this module never logs.
16
+ */
17
+ /** Greppable prefix for a loop-gate shortfall (pause requested, world's loop
18
+ * could not actually be gated). */
19
+ export const LOOP_GATE_PREFIX = 'loop-gate';
20
+ /** Greppable prefix for an audio-gate shortfall (pause requested, world's
21
+ * audio could not actually be silenced). */
22
+ export const AUDIO_GATE_PREFIX = 'audio-gate';
23
+ function formatGateMessage(prefix, capability, report) {
24
+ return (`${prefix} world "${report.worldId}": pause requested but ${capability} cannot be gated ` +
25
+ `(${report.reason}) — reporting honestly instead of silently no-op-ing. ` +
26
+ `${prefix} ${JSON.stringify(report)}`);
27
+ }
28
+ /** Format a loop-gate shortfall message (a `self-driven` world with no
29
+ * working pause capability). */
30
+ export function formatLoopGateMessage(report) {
31
+ return formatGateMessage(LOOP_GATE_PREFIX, "this world's loop", report);
32
+ }
33
+ /** Format an audio-gate shortfall message (a world with no `AudioAdapter`, or
34
+ * whose adapter cannot actually silence it). */
35
+ export function formatAudioGateMessage(report) {
36
+ return formatGateMessage(AUDIO_GATE_PREFIX, "this world's audio", report);
37
+ }
@@ -0,0 +1,69 @@
1
+ /**
2
+ * RapierPhysicsAdapter — the first-party `PhysicsAdapter` over the existing
3
+ * `PhysicsRegistry` (Object3D ↔ Rapier body/collider). This is the generalized,
4
+ * behind-the-interface form of the old `setEcsSyncTransform` teleport: it lets
5
+ * the editor freeze a body, apply a gizmo edit, and resume — without the editor
6
+ * knowing Rapier exists.
7
+ *
8
+ * The seam is keyed by NODE ID (P-4), so THIS is where the three-specific
9
+ * `id → Object3D` step happens: once, at the implementer's own boundary,
10
+ * through the `resolve` function its constructor is handed. Nothing above this
11
+ * line — not the editor, not the seam — needs to know an `Object3D` exists.
12
+ */
13
+ import type * as THREE from 'three';
14
+ import type { PhysicsRegistry } from '../physics/physics-registry';
15
+ import type { PhysicsContext } from '../setup/setup-physics';
16
+ import type { PhysicsAdapter } from './system-adapter';
17
+ /**
18
+ * Exactly what {@link createRapierBodyEditing} touches on a Rapier rigid body,
19
+ * declared STRUCTURALLY rather than as `RAPIER.RigidBody`.
20
+ *
21
+ * Not a wrapper and not an abstraction — it names five of Rapier's own methods
22
+ * with Rapier's own semantics, and every caller keeps passing Rapier's own
23
+ * objects. It exists because this repo legitimately resolves TWO copies of
24
+ * `@dimforge/rapier3d-compat`: the engine's own (0.14) and the one
25
+ * `@react-three/rapier` pins for R3F worlds (0.19). Their `RigidBody` classes
26
+ * are unrelated NOMINAL types, so a shared helper that named either one could
27
+ * not serve both callers.
28
+ */
29
+ export interface RapierEditableBody {
30
+ isFixed(): boolean;
31
+ bodyType(): number;
32
+ setBodyType(type: number, wakeUp: boolean): void;
33
+ setTranslation(translation: {
34
+ x: number;
35
+ y: number;
36
+ z: number;
37
+ }, wakeUp: boolean): void;
38
+ setRotation(rotation: {
39
+ x: number;
40
+ y: number;
41
+ z: number;
42
+ w: number;
43
+ }, wakeUp: boolean): void;
44
+ }
45
+ /**
46
+ * The four REQUIRED `PhysicsAdapter` members, over nothing but "which Rapier
47
+ * body drives this node" — the `freeze → apply → unfreeze` protocol itself,
48
+ * with no opinion about where the body came from.
49
+ *
50
+ * Split out of {@link createRapierPhysicsAdapter} (it is that function's own
51
+ * `ownerOf`/`freeze`/`commit`/`unfreeze`, unchanged) because the FIRST-PARTY
52
+ * mount is no longer the only Rapier in this engine: an R3F world does its
53
+ * physics with `@react-three/rapier` inside the fiber tree, which owns its own
54
+ * bodies and its own `Object3D` mapping, and reaches these same four verbs
55
+ * through `world3d-react/rapier-physics-bridge.tsx`. The optional members
56
+ * (`debugDraw`, `setDebugDrawEnabled`, `contactPoints`) are NOT here: each is
57
+ * answered differently by each Rapier owner, and a caller that cannot answer
58
+ * one honestly omits it.
59
+ */
60
+ export declare function createRapierBodyEditing(bodyFor: (nodeId: string) => RapierEditableBody | null | undefined): Pick<PhysicsAdapter, 'ownerOf' | 'freeze' | 'commit' | 'unfreeze'>;
61
+ export declare function createRapierPhysicsAdapter(registry: PhysicsRegistry, physics: PhysicsContext | null | undefined,
62
+ /**
63
+ * The world's own `id → Object3D` map. Injected rather than derived here so
64
+ * this file never hard-codes an identity convention (e.g. reading the
65
+ * first-party `userData.entityId` key off foreign objects, which is the
66
+ * ingest-stamping leak the retirement playbook deliberately parked).
67
+ */
68
+ resolve: (nodeId: string) => THREE.Object3D | null): PhysicsAdapter;
69
+ //# sourceMappingURL=rapier-physics-adapter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rapier-physics-adapter.d.ts","sourceRoot":"","sources":["../../src/adapter/rapier-physics-adapter.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC7D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAGvD;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,IAAI,OAAO,CAAC;IACnB,QAAQ,IAAI,MAAM,CAAC;IACnB,WAAW,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACjD,cAAc,CAAC,WAAW,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;IACxF,WAAW,CAAC,QAAQ,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,MAAM,EAAE,OAAO,GAAG,IAAI,CAAC;CAC9F;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,kBAAkB,GAAG,IAAI,GAAG,SAAS,GACjE,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,QAAQ,GAAG,QAAQ,GAAG,UAAU,CAAC,CAqCpE;AAED,wBAAgB,0BAA0B,CACxC,QAAQ,EAAE,eAAe,EACzB,OAAO,EAAE,cAAc,GAAG,IAAI,GAAG,SAAS;AAC1C;;;;;GAKG;AACH,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,KAAK,CAAC,QAAQ,GAAG,IAAI,GACjD,cAAc,CA+DhB"}
@@ -0,0 +1,135 @@
1
+ /**
2
+ * RapierPhysicsAdapter — the first-party `PhysicsAdapter` over the existing
3
+ * `PhysicsRegistry` (Object3D ↔ Rapier body/collider). This is the generalized,
4
+ * behind-the-interface form of the old `setEcsSyncTransform` teleport: it lets
5
+ * the editor freeze a body, apply a gizmo edit, and resume — without the editor
6
+ * knowing Rapier exists.
7
+ *
8
+ * The seam is keyed by NODE ID (P-4), so THIS is where the three-specific
9
+ * `id → Object3D` step happens: once, at the implementer's own boundary,
10
+ * through the `resolve` function its constructor is handed. Nothing above this
11
+ * line — not the editor, not the seam — needs to know an `Object3D` exists.
12
+ */
13
+ /**
14
+ * The four REQUIRED `PhysicsAdapter` members, over nothing but "which Rapier
15
+ * body drives this node" — the `freeze → apply → unfreeze` protocol itself,
16
+ * with no opinion about where the body came from.
17
+ *
18
+ * Split out of {@link createRapierPhysicsAdapter} (it is that function's own
19
+ * `ownerOf`/`freeze`/`commit`/`unfreeze`, unchanged) because the FIRST-PARTY
20
+ * mount is no longer the only Rapier in this engine: an R3F world does its
21
+ * physics with `@react-three/rapier` inside the fiber tree, which owns its own
22
+ * bodies and its own `Object3D` mapping, and reaches these same four verbs
23
+ * through `world3d-react/rapier-physics-bridge.tsx`. The optional members
24
+ * (`debugDraw`, `setDebugDrawEnabled`, `contactPoints`) are NOT here: each is
25
+ * answered differently by each Rapier owner, and a caller that cannot answer
26
+ * one honestly omits it.
27
+ */
28
+ export function createRapierBodyEditing(bodyFor) {
29
+ /** Saved body types while frozen, so unfreeze can restore them. */
30
+ const frozen = new Map();
31
+ return {
32
+ ownerOf(nodeId) {
33
+ const body = bodyFor(nodeId);
34
+ if (!body)
35
+ return 'editor';
36
+ // A fixed body never moves on its own → the editor owns its transform.
37
+ return body.isFixed() ? 'editor' : 'physics';
38
+ },
39
+ freeze(nodeId) {
40
+ const body = bodyFor(nodeId);
41
+ if (!body || frozen.has(body))
42
+ return;
43
+ frozen.set(body, body.bodyType());
44
+ // Kinematic-position: the body stops simulating but tracks the pose we set.
45
+ body.setBodyType(2 /* KinematicPositionBased */, true);
46
+ },
47
+ commit(nodeId, t) {
48
+ const body = bodyFor(nodeId);
49
+ if (!body)
50
+ return;
51
+ body.setTranslation({ x: t.position[0], y: t.position[1], z: t.position[2] }, true);
52
+ body.setRotation({ x: t.rotation[0], y: t.rotation[1], z: t.rotation[2], w: t.rotation[3] }, true);
53
+ },
54
+ unfreeze(nodeId) {
55
+ const body = bodyFor(nodeId);
56
+ if (!body)
57
+ return;
58
+ const prev = frozen.get(body);
59
+ if (prev !== undefined) {
60
+ body.setBodyType(prev, true);
61
+ frozen.delete(body);
62
+ }
63
+ },
64
+ };
65
+ }
66
+ export function createRapierPhysicsAdapter(registry, physics,
67
+ /**
68
+ * The world's own `id → Object3D` map. Injected rather than derived here so
69
+ * this file never hard-codes an identity convention (e.g. reading the
70
+ * first-party `userData.entityId` key off foreign objects, which is the
71
+ * ingest-stamping leak the retirement playbook deliberately parked).
72
+ */
73
+ resolve) {
74
+ /**
75
+ * Reused backing store for `contactPoints` (grown ×2 on demand, never
76
+ * shrunk) — the seam contract says the returned view is only valid until
77
+ * the next call, exactly so this never allocates per frame once warm.
78
+ */
79
+ let contactBuf = new Float32Array(64 * 3);
80
+ let contactCount = 0;
81
+ const pushContact = (x, y, z) => {
82
+ if ((contactCount + 1) * 3 > contactBuf.length) {
83
+ const grown = new Float32Array(contactBuf.length * 2);
84
+ grown.set(contactBuf);
85
+ contactBuf = grown;
86
+ }
87
+ contactBuf[contactCount * 3] = x;
88
+ contactBuf[contactCount * 3 + 1] = y;
89
+ contactBuf[contactCount * 3 + 2] = z;
90
+ contactCount++;
91
+ };
92
+ const appendManifoldContacts = (manifold) => {
93
+ const count = manifold.numSolverContacts();
94
+ for (let i = 0; i < count; i++) {
95
+ // Solver contacts are WORLD-space (unlike localContactPoint1/2).
96
+ const p = manifold.solverContactPoint(i);
97
+ if (p)
98
+ pushContact(p.x, p.y, p.z);
99
+ }
100
+ };
101
+ const collectContactPoints = () => {
102
+ if (!physics)
103
+ return contactBuf.subarray(0, 0);
104
+ const world = physics.rapierWorld;
105
+ contactCount = 0;
106
+ for (const [, refs] of registry.entries()) {
107
+ world.contactPairsWith(refs.collider, (other) => {
108
+ // Each touching pair is enumerated from BOTH sides — process it only
109
+ // from the lower-handle side (also skips self).
110
+ if (other.handle <= refs.collider.handle)
111
+ return;
112
+ world.contactPair(refs.collider, other, appendManifoldContacts);
113
+ });
114
+ }
115
+ return contactBuf.subarray(0, contactCount * 3);
116
+ };
117
+ /** The one place this adapter crosses from node id into Three's vocabulary. */
118
+ const bodyFor = (nodeId) => {
119
+ const o = resolve(nodeId);
120
+ return o ? registry.get(o)?.body : undefined;
121
+ };
122
+ return {
123
+ ...createRapierBodyEditing(bodyFor),
124
+ debugDraw: () => physics?.debugMesh ?? null,
125
+ setDebugDrawEnabled(enabled) {
126
+ if (!physics)
127
+ return;
128
+ // Same two fields the in-game KeyP toggle flips — the adapter's render
129
+ // system reads `debugEnabled` and feeds `debugRender()` into the mesh.
130
+ physics.debugEnabled = enabled;
131
+ physics.debugMesh.visible = enabled;
132
+ },
133
+ contactPoints: collectContactPoints,
134
+ };
135
+ }