@vgai/engine 0.5.15 → 0.5.17

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 (220) hide show
  1. package/dist/adapter/adapter-module.d.ts +229 -33
  2. package/dist/adapter/adapter-module.d.ts.map +1 -1
  3. package/dist/adapter/adapter-module.js +222 -50
  4. package/dist/adapter/authoring-seam-contract.d.ts +530 -0
  5. package/dist/adapter/authoring-seam-contract.d.ts.map +1 -0
  6. package/dist/adapter/authoring-seam-contract.js +162 -0
  7. package/dist/adapter/authoring.d.ts +237 -50
  8. package/dist/adapter/authoring.d.ts.map +1 -1
  9. package/dist/adapter/authoring.js +2 -1
  10. package/dist/adapter/entrypoint-selection-source.d.ts +35 -0
  11. package/dist/adapter/entrypoint-selection-source.d.ts.map +1 -0
  12. package/dist/adapter/entrypoint-selection-source.js +151 -0
  13. package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts +7 -3
  14. package/dist/adapter/finders/scenes-from-entrypoint-selection.d.ts.map +1 -1
  15. package/dist/adapter/finders/scenes-from-entrypoint-selection.js +145 -27
  16. package/dist/adapter/first-party-systems.d.ts +13 -3
  17. package/dist/adapter/first-party-systems.d.ts.map +1 -1
  18. package/dist/adapter/first-party-systems.js +10 -3
  19. package/dist/adapter/index.d.ts +7 -2
  20. package/dist/adapter/index.d.ts.map +1 -1
  21. package/dist/adapter/index.js +4 -0
  22. package/dist/adapter/ingest/contract-system-adapters.d.ts +1 -1
  23. package/dist/adapter/ingest/contract-system-adapters.d.ts.map +1 -1
  24. package/dist/adapter/ingest/contract-system-adapters.js +13 -25
  25. package/dist/adapter/ingest/game-contract-seams.d.ts +214 -0
  26. package/dist/adapter/ingest/game-contract-seams.d.ts.map +1 -0
  27. package/dist/adapter/ingest/game-contract-seams.js +62 -0
  28. package/dist/adapter/ingest/game-contract.d.ts +5 -3
  29. package/dist/adapter/ingest/game-contract.d.ts.map +1 -1
  30. package/dist/adapter/ingest/game-contract.js +4 -1
  31. package/dist/adapter/ingest/merge-debug-adapters.d.ts +52 -0
  32. package/dist/adapter/ingest/merge-debug-adapters.d.ts.map +1 -0
  33. package/dist/adapter/ingest/merge-debug-adapters.js +141 -0
  34. package/dist/adapter/ingest/observation-debug-adapter.d.ts +56 -0
  35. package/dist/adapter/ingest/observation-debug-adapter.d.ts.map +1 -0
  36. package/dist/adapter/ingest/observation-debug-adapter.js +131 -0
  37. package/dist/adapter/ingest/scene-capture.d.ts +38 -13
  38. package/dist/adapter/ingest/scene-capture.d.ts.map +1 -1
  39. package/dist/adapter/ingest/scene-capture.js +101 -24
  40. package/dist/adapter/ingest/visible-capture-window.d.ts +22 -5
  41. package/dist/adapter/ingest/visible-capture-window.d.ts.map +1 -1
  42. package/dist/adapter/ingest/visible-capture-window.js +46 -7
  43. package/dist/adapter/native-debug-module.d.ts +43 -0
  44. package/dist/adapter/native-debug-module.d.ts.map +1 -0
  45. package/dist/adapter/native-debug-module.js +230 -0
  46. package/dist/adapter/object3d-authoring-subject.d.ts +32 -0
  47. package/dist/adapter/object3d-authoring-subject.d.ts.map +1 -0
  48. package/dist/adapter/object3d-authoring-subject.js +25 -0
  49. package/dist/adapter/root-adapter.d.ts +25 -56
  50. package/dist/adapter/root-adapter.d.ts.map +1 -1
  51. package/dist/adapter/root-adapter.js +4 -20
  52. package/dist/adapter/root-seam-contract.d.ts +129 -0
  53. package/dist/adapter/root-seam-contract.d.ts.map +1 -0
  54. package/dist/adapter/root-seam-contract.js +37 -0
  55. package/dist/adapter/seam-evidence.d.ts +118 -0
  56. package/dist/adapter/seam-evidence.d.ts.map +1 -0
  57. package/dist/adapter/seam-evidence.js +231 -0
  58. package/dist/adapter/setup-three-root-adapter.d.ts +2 -3
  59. package/dist/adapter/setup-three-root-adapter.d.ts.map +1 -1
  60. package/dist/adapter/setup-three-root-adapter.js +11 -12
  61. package/dist/adapter/system-adapter.d.ts +6 -1
  62. package/dist/adapter/system-adapter.d.ts.map +1 -1
  63. package/dist/adapter/system-seam-contract.d.ts +354 -0
  64. package/dist/adapter/system-seam-contract.d.ts.map +1 -0
  65. package/dist/adapter/system-seam-contract.js +95 -0
  66. package/dist/animation/xstate-animation-binding.d.ts +6 -0
  67. package/dist/animation/xstate-animation-binding.d.ts.map +1 -1
  68. package/dist/animation/xstate-animation-binding.js +142 -4
  69. package/dist/asset-formats/collider.d.ts +1 -1
  70. package/dist/asset-formats/mesh.d.ts +2 -2
  71. package/dist/asset-formats/particles.d.ts +1 -1
  72. package/dist/canvas-react/engine-bridge.d.ts +6 -6
  73. package/dist/canvas-react/engine-bridge.d.ts.map +1 -1
  74. package/dist/canvas-react/engine-bridge.js +2 -2
  75. package/dist/canvas-react/index.d.ts +2 -2
  76. package/dist/canvas-react/index.d.ts.map +1 -1
  77. package/dist/canvas-react/index.js +1 -1
  78. package/dist/canvas-react/pixi-react-adapter.d.ts +15 -9
  79. package/dist/canvas-react/pixi-react-adapter.d.ts.map +1 -1
  80. package/dist/canvas-react/pixi-react-adapter.js +129 -64
  81. package/dist/canvas-react/pixi-react-root-factory.d.ts.map +1 -1
  82. package/dist/canvas-react/pixi-react-root-factory.js +4 -0
  83. package/dist/canvas-react/world-context.d.ts +22 -12
  84. package/dist/canvas-react/world-context.d.ts.map +1 -1
  85. package/dist/canvas-react/world-context.js +12 -51
  86. package/dist/data/curve.d.ts +1 -1
  87. package/dist/data/curve.js +2 -2
  88. package/dist/dev/instruments.d.ts +4 -4
  89. package/dist/dev/instruments.js +4 -4
  90. package/dist/dev/register-render-vitals.d.ts +2 -2
  91. package/dist/dev/register-render-vitals.js +2 -2
  92. package/dist/dev/static-batch-advisor.d.ts +1 -1
  93. package/dist/dev/static-batch-advisor.js +2 -2
  94. package/dist/ecs/user-data.d.ts +5 -0
  95. package/dist/ecs/user-data.d.ts.map +1 -1
  96. package/dist/ecs/user-data.js +3 -0
  97. package/dist/input/input-manager.d.ts +64 -0
  98. package/dist/input/input-manager.d.ts.map +1 -1
  99. package/dist/input/input-manager.js +149 -0
  100. package/dist/manifest/load.d.ts +0 -3
  101. package/dist/manifest/load.d.ts.map +1 -1
  102. package/dist/manifest/load.js +0 -4
  103. package/dist/manifest/schema.d.ts +9 -11
  104. package/dist/manifest/schema.d.ts.map +1 -1
  105. package/dist/manifest/schema.js +2 -23
  106. package/dist/pixi/authoring.d.ts +33 -0
  107. package/dist/pixi/authoring.d.ts.map +1 -1
  108. package/dist/pixi/authoring.js +301 -2
  109. package/dist/pixi/ingest.d.ts +2 -1
  110. package/dist/pixi/ingest.d.ts.map +1 -1
  111. package/dist/pixi/ingest.js +4 -2
  112. package/dist/pixi/scene-capture.d.ts +9 -1
  113. package/dist/pixi/scene-capture.d.ts.map +1 -1
  114. package/dist/pixi/scene-capture.js +9 -6
  115. package/dist/react/world-state.d.ts +12 -0
  116. package/dist/react/world-state.d.ts.map +1 -1
  117. package/dist/react/world-state.js +14 -0
  118. package/dist/render/particles-factory.d.ts +13 -6
  119. package/dist/render/particles-factory.d.ts.map +1 -1
  120. package/dist/render/particles-factory.js +6 -3
  121. package/dist/render/soft-particle-depth.d.ts +3 -3
  122. package/dist/render/soft-particle-depth.d.ts.map +1 -1
  123. package/dist/render/soft-particle-depth.js +8 -13
  124. package/dist/runtime/create-runtime.d.ts +25 -62
  125. package/dist/runtime/create-runtime.d.ts.map +1 -1
  126. package/dist/runtime/create-runtime.js +58 -105
  127. package/dist/runtime/dev-build.d.ts +37 -0
  128. package/dist/runtime/dev-build.d.ts.map +1 -0
  129. package/dist/runtime/dev-build.js +49 -0
  130. package/dist/runtime/game.d.ts +38 -72
  131. package/dist/runtime/game.d.ts.map +1 -1
  132. package/dist/runtime/game.js +40 -55
  133. package/dist/runtime/mount-game.d.ts.map +1 -1
  134. package/dist/runtime/mount-game.js +12 -1
  135. package/dist/runtime/mount-manifest.d.ts +0 -13
  136. package/dist/runtime/mount-manifest.d.ts.map +1 -1
  137. package/dist/runtime/mount-manifest.js +5 -25
  138. package/dist/runtime/types.d.ts +18 -0
  139. package/dist/runtime/types.d.ts.map +1 -1
  140. package/dist/setup/setup-renderer.d.ts +3 -4
  141. package/dist/setup/setup-renderer.d.ts.map +1 -1
  142. package/dist/setup/setup-renderer.js +3 -4
  143. package/dist/world3d-react/engine-bridge.d.ts +1 -1
  144. package/dist/world3d-react/engine-bridge.d.ts.map +1 -1
  145. package/dist/world3d-react/engine-bridge.js +29 -4
  146. package/dist/world3d-react/index.d.ts +1 -1
  147. package/dist/world3d-react/index.js +1 -1
  148. package/dist/world3d-react/r3f-adapter.d.ts +7 -0
  149. package/dist/world3d-react/r3f-adapter.d.ts.map +1 -1
  150. package/dist/world3d-react/r3f-adapter.js +132 -28
  151. package/dist/world3d-react/r3f-root-factory.d.ts.map +1 -1
  152. package/dist/world3d-react/r3f-root-factory.js +14 -0
  153. package/dist/world3d-react/rapier-physics-bridge.d.ts +4 -4
  154. package/dist/world3d-react/rapier-physics-bridge.js +3 -3
  155. package/dist/world3d-react/world-context.d.ts +52 -3
  156. package/dist/world3d-react/world-context.d.ts.map +1 -1
  157. package/dist/world3d-react/world-context.js +94 -64
  158. package/dist-config/config.js.map +1 -1
  159. package/package.json +1 -1
  160. package/schemas/engine-capabilities.json +8 -8
  161. package/schemas/vgai-project.schema.json +1 -6
  162. package/src/adapter/adapter-module.ts +405 -72
  163. package/src/adapter/authoring-seam-contract.ts +211 -0
  164. package/src/adapter/authoring.ts +242 -50
  165. package/src/adapter/entrypoint-selection-source.ts +159 -0
  166. package/src/adapter/finders/scenes-from-entrypoint-selection.ts +162 -36
  167. package/src/adapter/first-party-systems.ts +17 -3
  168. package/src/adapter/index.ts +51 -1
  169. package/src/adapter/ingest/contract-system-adapters.ts +26 -30
  170. package/src/adapter/ingest/game-contract-seams.ts +85 -0
  171. package/src/adapter/ingest/game-contract.ts +9 -4
  172. package/src/adapter/ingest/merge-debug-adapters.ts +193 -0
  173. package/src/adapter/ingest/observation-debug-adapter.ts +158 -0
  174. package/src/adapter/ingest/scene-capture.ts +126 -23
  175. package/src/adapter/ingest/visible-capture-window.ts +63 -9
  176. package/src/adapter/native-debug-module.ts +307 -0
  177. package/src/adapter/object3d-authoring-subject.ts +50 -0
  178. package/src/adapter/root-adapter.ts +25 -56
  179. package/src/adapter/root-seam-contract.ts +57 -0
  180. package/src/adapter/seam-evidence.ts +336 -0
  181. package/src/adapter/setup-three-root-adapter.ts +13 -15
  182. package/src/adapter/system-adapter.ts +6 -1
  183. package/src/adapter/system-seam-contract.ts +121 -0
  184. package/src/animation/xstate-animation-binding.ts +151 -4
  185. package/src/canvas-react/engine-bridge.ts +6 -6
  186. package/src/canvas-react/index.ts +2 -1
  187. package/src/canvas-react/pixi-react-adapter.tsx +143 -77
  188. package/src/canvas-react/pixi-react-root-factory.tsx +4 -0
  189. package/src/canvas-react/world-context.ts +26 -101
  190. package/src/data/curve.ts +2 -2
  191. package/src/dev/instruments.ts +4 -4
  192. package/src/dev/register-render-vitals.ts +2 -2
  193. package/src/dev/static-batch-advisor.ts +2 -2
  194. package/src/ecs/user-data.ts +5 -0
  195. package/src/input/input-manager.ts +145 -0
  196. package/src/manifest/load.ts +0 -7
  197. package/src/manifest/schema.ts +2 -25
  198. package/src/pixi/authoring.ts +329 -2
  199. package/src/pixi/ingest.ts +9 -2
  200. package/src/pixi/scene-capture.ts +20 -5
  201. package/src/react/world-state.tsx +15 -0
  202. package/src/render/particles-factory.ts +16 -6
  203. package/src/render/soft-particle-depth.ts +8 -13
  204. package/src/runtime/create-runtime.ts +79 -158
  205. package/src/runtime/dev-build.ts +49 -0
  206. package/src/runtime/game.ts +72 -113
  207. package/src/runtime/mount-game.ts +19 -1
  208. package/src/runtime/mount-manifest.ts +5 -37
  209. package/src/runtime/types.ts +22 -0
  210. package/src/setup/setup-renderer.ts +3 -4
  211. package/src/world3d-react/engine-bridge.ts +29 -4
  212. package/src/world3d-react/index.ts +1 -1
  213. package/src/world3d-react/r3f-adapter.tsx +140 -31
  214. package/src/world3d-react/r3f-root-factory.tsx +14 -0
  215. package/src/world3d-react/rapier-physics-bridge.tsx +4 -4
  216. package/src/world3d-react/world-context.ts +111 -87
  217. package/dist/runtime/dev-layers.d.ts +0 -34
  218. package/dist/runtime/dev-layers.d.ts.map +0 -1
  219. package/dist/runtime/dev-layers.js +0 -46
  220. package/src/runtime/dev-layers.ts +0 -46
@@ -11,7 +11,8 @@
11
11
  * the ONE game-scoped registry (`getDebugRegistry(host.game)`), so a
12
12
  * component's effect can `ctx.debug.registerStateProvider(...)` and be
13
13
  * visible to `vgai eval`/the editor's debug panels.
14
- * 2. **`ctx.input` is the game-owned `InputManager`** (`host.game.input` the
14
+ * 2. **`ctx.input` is the game-owned `InputManager` when a Game hosts the
15
+ * root** (`host.game.input` — the
15
16
  * same instance every sibling root shares), and this module registers the
16
17
  * per-world debug-registry seams (`setVirtualInputTarget`/
17
18
  * `setInputActionsSource`/`setInputTraceSource`) that make `game.input.*`
@@ -19,13 +20,14 @@
19
20
  * `DEBUG_INPUT_UNAVAILABLE`. The project's input map loads through
20
21
  * `Game.loadInputMap` (the game-owned, load-once path every root shares).
21
22
  * A missing/unparseable map degrades LOUDLY without failing the mount — a
22
- * canvas world with no declared actions is legal.
23
- * 3. **Absent subsystems fail loudly at the ctx surface.** A canvas world
24
- * builds no THREE scene/camera, no Rapier world, no composer, no first-party
25
- * audio/particles/debug-draw, and is handed no `AssetCache` (the canvas host
26
- * context carries none — see `adapter/host-context.ts`). Reading those
27
- * `ctx` fields yields a throwing getter naming the limitation and the
28
- * sanctioned alternative, never a silent `undefined`.
23
+ * canvas world with no declared actions is legal. A bare/foreign mount
24
+ * receives `null`, visibly in the type, rather than a throwing getter.
25
+ * 3. **Absent subsystems are absent from the type.** A canvas world builds no
26
+ * THREE scene/camera, Rapier world, composer, first-party audio/particles/
27
+ * debug-draw, or Three-flavoured `AssetCache`. Its explicit
28
+ * {@link CanvasGameContext} cannot name those fields, so misuse fails at
29
+ * the call site during typechecking instead of from a throwing getter at
30
+ * runtime.
29
31
  *
30
32
  * The Pixi handles themselves are deliberately NOT re-exposed here: a component
31
33
  * reaches the live `Application` (and therefore `app.stage`, `app.renderer`,
@@ -41,24 +43,6 @@ import { createDebugRegistry, getDebugRegistry, } from '../runtime/debug-registr
41
43
  * verbatim with the three lane — a project has ONE input map, whatever surface
42
44
  * reads it. */
43
45
  export const DEFAULT_INPUT_MAP_PATH = '/inputmaps/default.inputmap.json';
44
- /** Install a throwing getter for a `GameContext` field this world genuinely
45
- * does not build — a component reaching for it fails LOUDLY at its own call
46
- * site, naming the limitation, instead of reading `undefined` and breaking
47
- * somewhere downstream. Non-enumerable so spreads/serialization of the ctx
48
- * never trip it. */
49
- function defineAbsentCtxField(target, worldId, key, why) {
50
- Object.defineProperty(target, key, {
51
- configurable: true,
52
- enumerable: false,
53
- get() {
54
- throw new Error(`canvas world "${worldId}": ctx.${key} is not available — ${why} ` +
55
- '(A canvas world ctx provides: input, systems, clock, debug, random, game, roots, ' +
56
- "registerSystemAdapter. The Pixi runtime itself comes from @pixi/react's " +
57
- 'useApplication() — app.stage, app.renderer, app.ticker — and assets from Pixi`s own ' +
58
- 'Assets.)');
59
- },
60
- });
61
- }
62
46
  /**
63
47
  * Build the engine runtime for one canvas world from a `CanvasHostContext`.
64
48
  * React-free on purpose: everything here is plain engine wiring the adapter
@@ -76,6 +60,7 @@ export function createCanvasRootContext(host, options) {
76
60
  let app = null;
77
61
  const ctxRaw = {
78
62
  systems,
63
+ input: host.game?.input ?? null,
79
64
  registerSystemAdapter: (kind, adapter) => {
80
65
  // biome-ignore lint/suspicious/noExplicitAny: same per-key record write the three lane performs; correct by construction
81
66
  systemAdapters[kind] = adapter;
@@ -113,7 +98,7 @@ export function createCanvasRootContext(host, options) {
113
98
  '`container.destroy({ children: true })`, scheduled with `clock.after(seconds, ...)`.');
114
99
  },
115
100
  });
116
- ctx.clock = clock;
101
+ ctxRaw['clock'] = clock;
117
102
  // --- ctx.input + the debug-registry input seams — the game-owned
118
103
  // InputManager, polled by the game-scoped runner each frame; this world
119
104
  // registers the per-world seams so `game.input.*` (virtual input) and the
@@ -122,7 +107,6 @@ export function createCanvasRootContext(host, options) {
122
107
  if (host.game) {
123
108
  const game = host.game;
124
109
  const input = game.input;
125
- ctxRaw['input'] = input;
126
110
  debugRegistry.setInputActionsSource(id, () => input.actionNames().map((name) => ({ name, valueType: input.getActionValueType(name) })));
127
111
  debugRegistry.setInputTraceSource(id, () => {
128
112
  const raw = input.getInputTrace();
@@ -159,29 +143,6 @@ export function createCanvasRootContext(host, options) {
159
143
  });
160
144
  }
161
145
  }
162
- else {
163
- defineAbsentCtxField(ctxRaw, id, 'input', 'input is game-owned and this mount has no Game host (host.game is absent — bare ' +
164
- 'harness/foreign host); mount through the vgai host to get the shared InputManager.');
165
- }
166
- // --- Loud absence for everything a canvas world genuinely does not build. ---
167
- const threeWhy = 'a canvas world renders through PixiJS and owns no THREE scene graph; the world root is ' +
168
- "the Pixi stage, reached with @pixi/react's useApplication().app.stage.";
169
- defineAbsentCtxField(ctxRaw, id, 'scene', threeWhy);
170
- defineAbsentCtxField(ctxRaw, id, 'camera', threeWhy);
171
- defineAbsentCtxField(ctxRaw, id, 'sceneIndex', 'the live scene index walks a THREE.Scene; a canvas world has none (walk the Pixi display ' +
172
- 'tree from useApplication().app.stage instead).');
173
- const rapierWhy = 'canvas worlds do not build the first-party Rapier runtime; drive physics from inside the ' +
174
- 'tree with the 2D physics library of your choice.';
175
- defineAbsentCtxField(ctxRaw, id, 'rapierWorld', rapierWhy);
176
- defineAbsentCtxField(ctxRaw, id, 'rapier', rapierWhy);
177
- defineAbsentCtxField(ctxRaw, id, 'physics', rapierWhy);
178
- defineAbsentCtxField(ctxRaw, id, 'collisions', rapierWhy);
179
- defineAbsentCtxField(ctxRaw, id, 'assets', 'the canvas host context carries no AssetCache (that cache is a GLTF/texture loader ' +
180
- "resolving THREE objects); load textures/spritesheets with Pixi's own `Assets`.");
181
- defineAbsentCtxField(ctxRaw, id, 'composer', 'a canvas world has no postprocessing EffectComposer; use Pixi filters on a Container.');
182
- defineAbsentCtxField(ctxRaw, id, 'audio', 'canvas worlds build no first-party audio context; use Web Audio directly (or @pixi/sound).');
183
- defineAbsentCtxField(ctxRaw, id, 'particles', 'canvas worlds build no three.quarks particle runtime; use a Pixi particle container.');
184
- defineAbsentCtxField(ctxRaw, id, 'debugDraw', 'canvas worlds build no debug-draw helper; draw into a Pixi `Graphics` in the tree.');
185
146
  return {
186
147
  ctx,
187
148
  systems,
@@ -93,7 +93,7 @@ export declare function curve(axes: CurveAxes): z.ZodType<CurveValue>;
93
93
  * Read a curve field's declared axes back off a LIVE Zod schema (as opposed to
94
94
  * the emitted JSON Schema, which the editor's Data panel reads instead).
95
95
  *
96
- * This is the dev-menu capability's detection door: it derives its rows by
96
+ * This is the dev-tools capability's detection door: it derives its rows by
97
97
  * walking the game's own `TuningSchema` object, so it needs the axes from the
98
98
  * schema in hand. Wrappers (`.optional()`, `.default(…)`, `.describe(…)` chains
99
99
  * that re-wrap) hide the metadata behind an inner type, so a bounded unwrap
@@ -34,7 +34,7 @@
34
34
  * update, the same way it reads any other tuning value.
35
35
  */
36
36
  import { z } from 'zod';
37
- /** How the marker rides out to the emitted JSON Schema — the editor's and the dev menu's detection key, the exact shape `dataRef` uses with `x-vgai-ref`. */
37
+ /** How the marker rides out to the emitted JSON Schema — the editor's detection key, the exact shape `dataRef` uses with `x-vgai-ref`. */
38
38
  const CURVE_META_KEY = 'x-vgai-curve';
39
39
  function axisLabel(axes, axis) {
40
40
  return axes[axis].label ?? axis;
@@ -122,7 +122,7 @@ export function curve(axes) {
122
122
  * Read a curve field's declared axes back off a LIVE Zod schema (as opposed to
123
123
  * the emitted JSON Schema, which the editor's Data panel reads instead).
124
124
  *
125
- * This is the dev-menu capability's detection door: it derives its rows by
125
+ * This is the dev-tools capability's detection door: it derives its rows by
126
126
  * walking the game's own `TuningSchema` object, so it needs the axes from the
127
127
  * schema in hand. Wrappers (`.optional()`, `.default(…)`, `.describe(…)` chains
128
128
  * that re-wrap) hide the metadata behind an inner type, so a bounded unwrap
@@ -25,11 +25,11 @@
25
25
  * game registry.
26
26
  *
27
27
  * ── THE DOOR ────────────────────────────────────────────────────────────────
28
- * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-menu
29
- * capability's own registry adopts this list (`installDevMenuInstruments`) and
28
+ * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
29
+ * capability's own registry adopts this list (`installDevToolsInstruments`) and
30
30
  * publishes each instrument through the SAME door every declaration in that
31
31
  * capability uses — one provider per reading (`instrument.timescale`), one
32
- * command per action (`instrument.timescale.set`), plus the `dev-menu` index
32
+ * command per action (`instrument.timescale.set`), plus the `dev-tools` index
33
33
  * provider. That is deliberate and load-bearing: the registry IS the product,
34
34
  * so every reader of an instrument reaches the SAME registration.
35
35
  *
@@ -43,7 +43,7 @@
43
43
  * ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
44
44
  * {@link createDevInstruments} owns everything it allocates: the frame-time
45
45
  * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
46
- * dev-menu capability's `DevMenuBridge`, which creates one set per mounted
46
+ * dev-tools capability's `DevToolsBridge`, which creates one set per mounted
47
47
  * game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
48
48
  * that ends it. Nothing else here holds a resource; the time-scale, pause and
49
49
  * collider instruments only drive state that `Game` already owns.
@@ -25,11 +25,11 @@
25
25
  * game registry.
26
26
  *
27
27
  * ── THE DOOR ────────────────────────────────────────────────────────────────
28
- * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-menu
29
- * capability's own registry adopts this list (`installDevMenuInstruments`) and
28
+ * This module is IMPLEMENTATION ONLY. It publishes nothing itself: the dev-tools
29
+ * capability's own registry adopts this list (`installDevToolsInstruments`) and
30
30
  * publishes each instrument through the SAME door every declaration in that
31
31
  * capability uses — one provider per reading (`instrument.timescale`), one
32
- * command per action (`instrument.timescale.set`), plus the `dev-menu` index
32
+ * command per action (`instrument.timescale.set`), plus the `dev-tools` index
33
33
  * provider. That is deliberate and load-bearing: the registry IS the product,
34
34
  * so every reader of an instrument reaches the SAME registration.
35
35
  *
@@ -43,7 +43,7 @@
43
43
  * ── RESOURCE OWNERSHIP, STATED ONCE ─────────────────────────────────────────
44
44
  * {@link createDevInstruments} owns everything it allocates: the frame-time
45
45
  * ring buffer and its ONE `game.onRenderStep` subscription. SHARER: the
46
- * dev-menu capability's `DevMenuBridge`, which creates one set per mounted
46
+ * dev-tools capability's `DevToolsBridge`, which creates one set per mounted
47
47
  * game. TEARDOWN: the returned {@link DevInstrumentSet.dispose} — the ONE path
48
48
  * that ends it. Nothing else here holds a resource; the time-scale, pause and
49
49
  * collider instruments only drive state that `Game` already owns.
@@ -36,8 +36,8 @@
36
36
  * the drawing buffer halves was never fill-bound.
37
37
  *
38
38
  * ── GATING ──────────────────────────────────────────────────────────────────
39
- * The caller gates. Both seeders call this only under `devLayersEnabled()`
40
- * (`runtime/dev-layers.ts` — the ONE owner of "is this a dev context"), so a
39
+ * The caller gates. Both seeders call this only under `devBuildEnabled()`
40
+ * (`runtime/dev-build.ts` — the ONE owner of "is this a dev context"), so a
41
41
  * ship build registers nothing and pays nothing. Each also requires a `Game`
42
42
  * shell (there is no profiler to fold without one) and a non-headless mount
43
43
  * (nothing brackets a submission, so the readings could only ever be empty).
@@ -36,8 +36,8 @@
36
36
  * the drawing buffer halves was never fill-bound.
37
37
  *
38
38
  * ── GATING ──────────────────────────────────────────────────────────────────
39
- * The caller gates. Both seeders call this only under `devLayersEnabled()`
40
- * (`runtime/dev-layers.ts` — the ONE owner of "is this a dev context"), so a
39
+ * The caller gates. Both seeders call this only under `devBuildEnabled()`
40
+ * (`runtime/dev-build.ts` — the ONE owner of "is this a dev context"), so a
41
41
  * ship build registers nothing and pays nothing. Each also requires a `Game`
42
42
  * shell (there is no profiler to fold without one) and a non-headless mount
43
43
  * (nothing brackets a submission, so the readings could only ever be empty).
@@ -6,7 +6,7 @@
6
6
  * require someone to ASK, and both require that someone to already know that
7
7
  * static batching exists, is possible here, and is spelled `<Frozen>`. An
8
8
  * agent building a game does not know any of that, so the measurement has to
9
- * do the routing itself — the same idiom as the dev-menu's unconfigured-section
9
+ * do the routing itself — the same idiom as dev-tools' unconfigured-section
10
10
  * warning: the reading names the exact edit.
11
11
  *
12
12
  * ── THE DECISION IS PURE, THE SCHEDULE IS NOT ───────────────────────────────
@@ -6,7 +6,7 @@
6
6
  * require someone to ASK, and both require that someone to already know that
7
7
  * static batching exists, is possible here, and is spelled `<Frozen>`. An
8
8
  * agent building a game does not know any of that, so the measurement has to
9
- * do the routing itself — the same idiom as the dev-menu's unconfigured-section
9
+ * do the routing itself — the same idiom as dev-tools' unconfigured-section
10
10
  * warning: the reading names the exact edit.
11
11
  *
12
12
  * ── THE DECISION IS PURE, THE SCHEDULE IS NOT ───────────────────────────────
@@ -106,7 +106,7 @@ export function decideStaticBatchAdvisory(input) {
106
106
  * Once per PAGE, not once per module evaluation — a hot reload re-runs this
107
107
  * module, and an advisory that reappears on every save is one that gets muted
108
108
  * along with everything else on the console. Same mechanism, and the same
109
- * reason, as the dev menu's unconfigured-section warning.
109
+ * reason, as dev-tools' unconfigured-section warning.
110
110
  */
111
111
  const WARNED_KEY = '__vgaiStaticBatchAdvised';
112
112
  function alreadyWarned() {
@@ -111,12 +111,15 @@
111
111
  * JSX props for renderer/editor integration.
112
112
  * - `constraints` — live project-owned spatial constraints projected
113
113
  * into the shared Inspector and viewport.
114
+ * - `authoringSubject` — transient identity/inspection for an ecosystem-native
115
+ * subject represented by an Object3D proxy.
114
116
  * - `splineControlPoint` — index of a spline control-point drag handle.
115
117
  * - `vcDirIdx` — view-cube face direction index (0=+X,1=-X,2=+Y,...).
116
118
  */
117
119
  import type * as THREE from 'three';
118
120
  import type { ParticleSystem } from 'three.quarks';
119
121
  import type { ConstraintMark } from '../adapter/constraint';
122
+ import type { Object3DAuthoringSubjectMark } from '../adapter/object3d-authoring-subject';
120
123
  import type { RapierEditableBody } from '../adapter/rapier-physics-adapter';
121
124
  import type { ReflectionProbeMark } from '../adapter/reflection-probe';
122
125
  import type { AnimationRuntimeInspection } from '../animation/runtime-inspection';
@@ -174,6 +177,7 @@ export interface UserDataSchema {
174
177
  skeletonEnabled: boolean;
175
178
  envObject: boolean;
176
179
  constraints: readonly ConstraintMark[];
180
+ authoringSubject: Object3DAuthoringSubjectMark;
177
181
  reflectionProbe: ReflectionProbeMark;
178
182
  vcDirIdx: number;
179
183
  /** W1a navmesh path-probe preview polyline: the routed waypoints, mirrored
@@ -231,6 +235,7 @@ export declare const UserDataKeys: {
231
235
  readonly skeletonEnabled: "skeletonEnabled";
232
236
  readonly envObject: "envObject";
233
237
  readonly constraints: "constraints";
238
+ readonly authoringSubject: "authoringSubject";
234
239
  readonly reflectionProbe: "reflectionProbe";
235
240
  readonly vcDirIdx: "vcDirIdx";
236
241
  readonly navPathPoints: "navPathPoints";
@@ -1 +1 @@
1
- {"version":3,"file":"user-data.d.ts","sourceRoot":"","sources":["../../src/ecs/user-data.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmHG;AAEH,OAAO,KAAK,KAAK,KAAK,MAAM,OAAO,CAAC;AACpC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACnD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAC;AAC5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,6BAA6B,CAAC;AACvE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAC;AAClF,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,uCAAuC,CAAC;AACpF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM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W,CAAC,CAAC,SAAS,WAAW,EAC/C,GAAG,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,EACtC,GAAG,EAAE,CAAC,GACL,cAAc,CAAC,CAAC,CAAC,GAAG,SAAS,CAE/B;AAED,sCAAsC;AACtC,wBAAgB,WAAW,CAAC,CAAC,SAAS,WAAW,EAC/C,GAAG,EAAE,KAAK,CAAC,QAAQ,EACnB,GAAG,EAAE,CAAC,EACN,KAAK,EAAE,cAAc,CAAC,CAAC,CAAC,GACvB,IAAI,CAEN;AAED,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,GAAG,IAAI,GAAG,SAAS,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAE7F;AAED,+BAA+B;AAC/B,wBAAgB,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,GAAG,IAAI,CAE1E"}
@@ -111,6 +111,8 @@
111
111
  * JSX props for renderer/editor integration.
112
112
  * - `constraints` — live project-owned spatial constraints projected
113
113
  * into the shared Inspector and viewport.
114
+ * - `authoringSubject` — transient identity/inspection for an ecosystem-native
115
+ * subject represented by an Object3D proxy.
114
116
  * - `splineControlPoint` — index of a spline control-point drag handle.
115
117
  * - `vcDirIdx` — view-cube face direction index (0=+X,1=-X,2=+Y,...).
116
118
  */
@@ -158,6 +160,7 @@ export const UserDataKeys = {
158
160
  skeletonEnabled: 'skeletonEnabled',
159
161
  envObject: 'envObject',
160
162
  constraints: 'constraints',
163
+ authoringSubject: 'authoringSubject',
161
164
  reflectionProbe: 'reflectionProbe',
162
165
  vcDirIdx: 'vcDirIdx',
163
166
  navPathPoints: 'navPathPoints',
@@ -40,6 +40,9 @@ export declare class InputManager {
40
40
  private mouseButtonsJustUp;
41
41
  private mouseDeltaX;
42
42
  private mouseDeltaY;
43
+ /** Last `mousemove` client position. Device-poll only — action maps read delta, not this. */
44
+ private mouseClientX;
45
+ private mouseClientY;
43
46
  private gamepads;
44
47
  private gamepadButtonsDown;
45
48
  private gamepadButtonsPrev;
@@ -221,6 +224,21 @@ export declare class InputManager {
221
224
  * data reaches `isPressed`/`isJustPressed`/`isJustReleased`.
222
225
  */
223
226
  loadMap(url: string): Promise<void>;
227
+ /**
228
+ * `loadMap`'s OPTIONAL sibling: apply the map at `url` when the project
229
+ * ships one and report `false` — SILENTLY — when it does not exist.
230
+ *
231
+ * The host loads the conventional map path at mount for every three/canvas
232
+ * root, including the scaffolded shape that has declared no actions yet, so
233
+ * "no map on disk" is the ordinary state of a brand-new project and must not
234
+ * print an error on every boot. Everything else stays exactly as loud as
235
+ * `loadMap`: a map that EXISTS and is malformed (or any non-404 failure)
236
+ * still logs and throws.
237
+ */
238
+ loadMapIfPresent(url: string): Promise<boolean>;
239
+ /** Shared fetch/validate/apply for {@link loadMap} and
240
+ * {@link loadMapIfPresent}; `optional` decides only what a 404 means. */
241
+ private fetchMap;
224
242
  /**
225
243
  * F3 — `loadMap`'s synchronous, no-`fetch` sibling: apply an already-in-
226
244
  * memory (or freshly-deserialized) input-map DOCUMENT, validated through
@@ -496,6 +514,39 @@ export declare class InputManager {
496
514
  x: number;
497
515
  y: number;
498
516
  };
517
+ /**
518
+ * Device-poll door (not an action binding). Every getter checks
519
+ * {@link inputActive} at READ time so a poll while play is off or the
520
+ * tab is unfocused is inert — the same predicate `onKeyDown` / `onMouseMove`
521
+ * already use. Inventing an implicit `registerAction` per key would define
522
+ * bindings the project's own `.inputmap` never named.
523
+ */
524
+ isDeviceKeyPressed(code: string): boolean;
525
+ isDeviceKeyJustPressed(code: string): boolean;
526
+ isDeviceKeyJustReleased(code: string): boolean;
527
+ /** `button` is the DOM `MouseEvent.button` index (0 left, 1 middle, 2 right). */
528
+ isDeviceMouseButtonPressed(button: number): boolean;
529
+ isDeviceMouseButtonJustPressed(button: number): boolean;
530
+ isDeviceMouseButtonJustReleased(button: number): boolean;
531
+ /**
532
+ * This-frame mouse delta in DOM space (Y +down). Callers that need Unity
533
+ * `Pointer.delta` (Y-up) flip Y themselves.
534
+ */
535
+ getDeviceMouseDelta(): {
536
+ x: number;
537
+ y: number;
538
+ };
539
+ /** Last `mousemove` client position in DOM space (origin top-left, Y +down). */
540
+ getDeviceMousePosition(): {
541
+ x: number;
542
+ y: number;
543
+ };
544
+ hasDeviceGamepad(): boolean;
545
+ isDeviceGamepadButtonPressed(button: number): boolean;
546
+ isDeviceGamepadButtonJustPressed(button: number): boolean;
547
+ isDeviceGamepadButtonJustReleased(button: number): boolean;
548
+ getDeviceGamepadAxis(axis: number): number;
549
+ private firstConnectedGamepadIndex;
499
550
  /**
500
551
  * F4 (spec §12 "Schema and Examples" — the F3 prompt-switching gap): which
501
552
  * device family most recently produced real input, or `null` before any
@@ -771,6 +822,19 @@ export declare class InputManager {
771
822
  };
772
823
  /** Request pointer lock for FPS-style mouse control */
773
824
  requestPointerLock(element: HTMLElement): void;
825
+ /**
826
+ * Release pointer lock on the element {@link requestPointerLock} wired.
827
+ *
828
+ * Godot's `Input.mouse_mode = MOUSE_MODE_VISIBLE` is this call: drop the
829
+ * lock if this manager holds it, and unwire the click-to-lock listener so a
830
+ * later click does not recapture. Idempotent. A host with no
831
+ * `document.exitPointerLock` (headless) still unwires — the lock never
832
+ * existed there.
833
+ *
834
+ * Only the lock THIS manager requested is released. An editor viewport
835
+ * holding lock on a different element is not ours to drop.
836
+ */
837
+ exitPointerLock(): void;
774
838
  /** Clean up event listeners */
775
839
  dispose(): void;
776
840
  }
@@ -1 +1 @@
1
- {"version":3,"file":"input-manager.d.ts","sourceRoot":"","sources":["../../src/input/input-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,iBAAiB,EACjB,eAAe,EACf,eAAe,EACf,aAAa,EACb,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,OAAO,EACR,MAAM,eAAe,CAAC;AA4BvB;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,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A;KAAE;IAUzE;;;;;;;2DAOuD;IACvD,mBAAmB,IAAI,IAAI;IAI3B;;;;;;;;;;;;;;;;;;OAkBG;IACH,oBAAoB,CAClB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,GACjD,IAAI;IAYP;;;;;;4BAMwB;IACxB,YAAY,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,IAAI;IAI1E;;+DAE2D;IAC3D,mBAAmB,IAAI,IAAI;IAM3B;;kCAE8B;IAC9B,kBAAkB,IAAI,IAAI;IAI1B,6DAA6D;IAC7D,gBAAgB,IAAI,OAAO;IAI3B;;;mBAGe;IACf,aAAa,IAAI;QACf,OAAO,EAAE,CAAC,CAAC;QACX,KAAK,EAAE;YAAE,IAAI,EAAE,MAAM,CAAC;YAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG;gBAAE,CAAC,EAAE,MAAM,CAAC;gBAAC,CAAC,EAAE,MAAM,CAAA;aAAE,CAAC,CAAA;SAAE,EAAE,CAAC;KACjG;IAID,uDAAuD;IACvD,kBAAkB,CAAC,OAAO,EAAE,WAAW;IAWvC;;;;;;;;;;;OAWG;IACH,eAAe;IAYf,+BAA+B;IAC/B,OAAO;CAoBR"}
@@ -277,6 +277,9 @@ export class InputManager {
277
277
  mouseButtonsJustUp = new Set();
278
278
  mouseDeltaX = 0;
279
279
  mouseDeltaY = 0;
280
+ /** Last `mousemove` client position. Device-poll only — action maps read delta, not this. */
281
+ mouseClientX = 0;
282
+ mouseClientY = 0;
280
283
  gamepads = [];
281
284
  // Gamepad button edge tracking (P1.6c). Keys are `${gamepadIndex}:${buttonIndex}`.
282
285
  // `Prev` is last frame's pressed set; `Down` is this frame's; the just-down/up
@@ -527,6 +530,8 @@ export class InputManager {
527
530
  this.lastActiveDevice = 'mouse';
528
531
  this.mouseDeltaX += e.movementX;
529
532
  this.mouseDeltaY += e.movementY;
533
+ this.mouseClientX = e.clientX;
534
+ this.mouseClientY = e.clientY;
530
535
  };
531
536
  /** F2 — real window blur: drop focus and flush held REAL-device state
532
537
  * (the browser stops delivering keyup/mouseup while blurred, so a key
@@ -626,10 +631,31 @@ export class InputManager {
626
631
  * data reaches `isPressed`/`isJustPressed`/`isJustReleased`.
627
632
  */
628
633
  async loadMap(url) {
634
+ await this.fetchMap(url, false);
635
+ }
636
+ /**
637
+ * `loadMap`'s OPTIONAL sibling: apply the map at `url` when the project
638
+ * ships one and report `false` — SILENTLY — when it does not exist.
639
+ *
640
+ * The host loads the conventional map path at mount for every three/canvas
641
+ * root, including the scaffolded shape that has declared no actions yet, so
642
+ * "no map on disk" is the ordinary state of a brand-new project and must not
643
+ * print an error on every boot. Everything else stays exactly as loud as
644
+ * `loadMap`: a map that EXISTS and is malformed (or any non-404 failure)
645
+ * still logs and throws.
646
+ */
647
+ async loadMapIfPresent(url) {
648
+ return this.fetchMap(url, true);
649
+ }
650
+ /** Shared fetch/validate/apply for {@link loadMap} and
651
+ * {@link loadMapIfPresent}; `optional` decides only what a 404 means. */
652
+ async fetchMap(url, optional) {
629
653
  let data;
630
654
  try {
631
655
  const res = await fetch(resolveUrl(url));
632
656
  if (!res.ok) {
657
+ if (optional && res.status === 404)
658
+ return false;
633
659
  throw new Error(`HTTP ${res.status} ${res.statusText}`);
634
660
  }
635
661
  const json = await res.json();
@@ -644,6 +670,7 @@ export class InputManager {
644
670
  throw err instanceof AssetParseError ? err : new Error(message);
645
671
  }
646
672
  this.applyParsedMap(data);
673
+ return true;
647
674
  }
648
675
  /**
649
676
  * F3 — `loadMap`'s synchronous, no-`fetch` sibling: apply an already-in-
@@ -1618,6 +1645,103 @@ export class InputManager {
1618
1645
  getMouseDelta() {
1619
1646
  return { x: this.mouseDeltaX, y: this.mouseDeltaY };
1620
1647
  }
1648
+ /**
1649
+ * Device-poll door (not an action binding). Every getter checks
1650
+ * {@link inputActive} at READ time so a poll while play is off or the
1651
+ * tab is unfocused is inert — the same predicate `onKeyDown` / `onMouseMove`
1652
+ * already use. Inventing an implicit `registerAction` per key would define
1653
+ * bindings the project's own `.inputmap` never named.
1654
+ */
1655
+ isDeviceKeyPressed(code) {
1656
+ if (!this.inputActive)
1657
+ return false;
1658
+ return this.keysDown.has(code);
1659
+ }
1660
+ isDeviceKeyJustPressed(code) {
1661
+ if (!this.inputActive)
1662
+ return false;
1663
+ return this.keysJustDown.has(code);
1664
+ }
1665
+ isDeviceKeyJustReleased(code) {
1666
+ if (!this.inputActive)
1667
+ return false;
1668
+ return this.keysJustUp.has(code);
1669
+ }
1670
+ /** `button` is the DOM `MouseEvent.button` index (0 left, 1 middle, 2 right). */
1671
+ isDeviceMouseButtonPressed(button) {
1672
+ if (!this.inputActive)
1673
+ return false;
1674
+ return this.mouseButtons.has(button);
1675
+ }
1676
+ isDeviceMouseButtonJustPressed(button) {
1677
+ if (!this.inputActive)
1678
+ return false;
1679
+ return this.mouseButtonsJustDown.has(button);
1680
+ }
1681
+ isDeviceMouseButtonJustReleased(button) {
1682
+ if (!this.inputActive)
1683
+ return false;
1684
+ return this.mouseButtonsJustUp.has(button);
1685
+ }
1686
+ /**
1687
+ * This-frame mouse delta in DOM space (Y +down). Callers that need Unity
1688
+ * `Pointer.delta` (Y-up) flip Y themselves.
1689
+ */
1690
+ getDeviceMouseDelta() {
1691
+ if (!this.inputActive)
1692
+ return { x: 0, y: 0 };
1693
+ return { x: this.mouseDeltaX, y: this.mouseDeltaY };
1694
+ }
1695
+ /** Last `mousemove` client position in DOM space (origin top-left, Y +down). */
1696
+ getDeviceMousePosition() {
1697
+ if (!this.inputActive)
1698
+ return { x: 0, y: 0 };
1699
+ return { x: this.mouseClientX, y: this.mouseClientY };
1700
+ }
1701
+ hasDeviceGamepad() {
1702
+ if (!this.inputActive)
1703
+ return false;
1704
+ return this.gamepads.some((pad) => pad !== null);
1705
+ }
1706
+ isDeviceGamepadButtonPressed(button) {
1707
+ if (!this.inputActive)
1708
+ return false;
1709
+ const index = this.firstConnectedGamepadIndex();
1710
+ if (index < 0)
1711
+ return false;
1712
+ return this.gamepadButtonsDown.has(`${index}:${button}`);
1713
+ }
1714
+ isDeviceGamepadButtonJustPressed(button) {
1715
+ if (!this.inputActive)
1716
+ return false;
1717
+ const index = this.firstConnectedGamepadIndex();
1718
+ if (index < 0)
1719
+ return false;
1720
+ return this.gamepadButtonsJustDown.has(`${index}:${button}`);
1721
+ }
1722
+ isDeviceGamepadButtonJustReleased(button) {
1723
+ if (!this.inputActive)
1724
+ return false;
1725
+ const index = this.firstConnectedGamepadIndex();
1726
+ if (index < 0)
1727
+ return false;
1728
+ return this.gamepadButtonsJustUp.has(`${index}:${button}`);
1729
+ }
1730
+ getDeviceGamepadAxis(axis) {
1731
+ if (!this.inputActive)
1732
+ return 0;
1733
+ const index = this.firstConnectedGamepadIndex();
1734
+ if (index < 0)
1735
+ return 0;
1736
+ return this.gamepads[index]?.axes[axis] ?? 0;
1737
+ }
1738
+ firstConnectedGamepadIndex() {
1739
+ for (let i = 0; i < this.gamepads.length; i++) {
1740
+ if (this.gamepads[i] !== null)
1741
+ return i;
1742
+ }
1743
+ return -1;
1744
+ }
1621
1745
  /**
1622
1746
  * F4 (spec §12 "Schema and Examples" — the F3 prompt-switching gap): which
1623
1747
  * device family most recently produced real input, or `null` before any
@@ -2194,6 +2318,31 @@ export class InputManager {
2194
2318
  this.pointerLockElement = element;
2195
2319
  element.addEventListener('click', this.onPointerLockClick);
2196
2320
  }
2321
+ /**
2322
+ * Release pointer lock on the element {@link requestPointerLock} wired.
2323
+ *
2324
+ * Godot's `Input.mouse_mode = MOUSE_MODE_VISIBLE` is this call: drop the
2325
+ * lock if this manager holds it, and unwire the click-to-lock listener so a
2326
+ * later click does not recapture. Idempotent. A host with no
2327
+ * `document.exitPointerLock` (headless) still unwires — the lock never
2328
+ * existed there.
2329
+ *
2330
+ * Only the lock THIS manager requested is released. An editor viewport
2331
+ * holding lock on a different element is not ours to drop.
2332
+ */
2333
+ exitPointerLock() {
2334
+ const el = this.pointerLockElement;
2335
+ if (el) {
2336
+ el.removeEventListener('click', this.onPointerLockClick);
2337
+ this.pointerLockElement = null;
2338
+ }
2339
+ this.pointerLocked = false;
2340
+ const doc = typeof document !== 'undefined' ? document : undefined;
2341
+ if (!doc || typeof doc.exitPointerLock !== 'function')
2342
+ return;
2343
+ if (el && doc.pointerLockElement === el)
2344
+ doc.exitPointerLock();
2345
+ }
2197
2346
  /** Clean up event listeners */
2198
2347
  dispose() {
2199
2348
  if (this.disposed)