@ignifx/editor-host 0.14.0 → 0.15.0

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ignifx/editor-host",
3
- "version": "0.14.0",
3
+ "version": "0.15.0",
4
4
  "description": "ignifx editor host: runs a project's own engine inside the ignifx editor's scene view and play view, over a versioned protocol.",
5
5
  "keywords": [
6
6
  "ignifx"
@@ -52,19 +52,19 @@
52
52
  "typescript-native": "npm:typescript@7.0.2",
53
53
  "vite": "^8.2.2",
54
54
  "vitest": "^5.0.0",
55
- "@ignifx/2d": "0.14.0",
56
- "@ignifx/3d": "0.14.0",
57
- "@ignifx/core": "0.14.0",
58
- "@ignifx/input": "0.14.0",
59
- "@ignifx/physics": "0.14.0",
60
- "@ignifx/physics-2d": "0.14.0",
61
- "@ignifx/vite-plugin": "0.14.0"
55
+ "@ignifx/2d": "0.15.0",
56
+ "@ignifx/3d": "0.15.0",
57
+ "@ignifx/core": "0.15.0",
58
+ "@ignifx/input": "0.15.0",
59
+ "@ignifx/physics": "0.15.0",
60
+ "@ignifx/physics-2d": "0.15.0",
61
+ "@ignifx/vite-plugin": "0.15.0"
62
62
  },
63
63
  "peerDependencies": {
64
64
  "@babylonjs/lite": "1.34.0",
65
65
  "vite": "^8.2.2",
66
- "@ignifx/core": "0.14.0",
67
- "@ignifx/vite-plugin": "0.14.0"
66
+ "@ignifx/core": "0.15.0",
67
+ "@ignifx/vite-plugin": "0.15.0"
68
68
  },
69
69
  "peerDependenciesMeta": {
70
70
  "@ignifx/vite-plugin": {
@@ -3,7 +3,7 @@ name: editor-host
3
3
  description: Connects an ignifx project to the ignifx editor with @ignifx/editor-host: the Vite plugin that serves the editor's scene view from the project's own dev server, the virtual:ignifx/editor play controls a game's main.ts hands its app to (play, pause, step, stop, playState, playStateChanged, playStats, screenshot, queryRuntime, sendInput), and the host half of the editor protocol 0.3 over a MessagePort (hello/ready, heartbeat, and the scene document methods openScene, applyOps, readBack, select, pick, frame, setGizmo, setViewMode, screenshot, getSchemas, describeSettings, setAnimateMaterials, getColliderOutlines, sampleAnimation), including the 2D view mode. Use when wiring a project or template for the editor, when the user mentions @ignifx/editor-host, editorHostPlugin, attachEditorPlayControls, virtual:ignifx/editor, startEditorHost or /__ignifx_editor__/, or when debugging why the editor cannot connect to a view or why the scene view disagrees with the editor's document.
4
4
  license: Apache-2.0
5
5
  metadata:
6
- ignifx-version: "0.14.0"
6
+ ignifx-version: "0.15.0"
7
7
  ---
8
8
 
9
9
  # @ignifx/editor-host
@@ -25,7 +25,7 @@ editor's, even though its name starts with `editor-`.
25
25
 
26
26
  ## Environment
27
27
 
28
- - Engine: ignifx `0.14.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
28
+ - Engine: ignifx `0.15.0`; this package targets `@ignifx/core` `>=0.0.0 <1.0.0`.
29
29
  - Peers: `@ignifx/core` and `@babylonjs/lite` (the scene view's gizmos); for the `./vite` entry,
30
30
  `@ignifx/vite-plugin` and `vite`.
31
31
  - A development dependency of the project, at the same version as its `@ignifx/core`.
@@ -59,7 +59,7 @@ editor window (ignifx-editor://app)
59
59
  ├── <iframe> scene view http://127.0.0.1:<port>/__ignifx_editor__/
60
60
  │ generated module → startEditorHost({ extensions(), scripts, settings, manifest })
61
61
  │ owns its app, in edit mode; hostKind "scene"
62
- │ world: the open document's scene + a persistent "editor" scene (camera, never saved)
62
+ │ world: the open document's scene + a persistent "editor" scene (camera, grid, never saved)
63
63
  └── <iframe> play view http://localhost:<port>/ (the game's own index.html)
64
64
  main.ts → attachEditorPlayControls(app) (virtual:ignifx/editor; a no-op in builds)
65
65
  the game owns its app; hostKind "play"
@@ -68,7 +68,7 @@ each view ◀── MessagePort ──▶ editor JSON-RPC 2.0, protocol 0.3
68
68
  connect (window message, origin-checked) → hello → ready → ping/pong, heartbeat
69
69
  scene view: schemasChanged → openScene → applyOps… / readBack / select / pick / frame / setGizmo / screenshot
70
70
  / setViewMode / getSchemas / describeSettings (on request only)
71
- / setAnimateMaterials / getColliderOutlines / sampleAnimation
71
+ / setAnimateMaterials / getColliderOutlines / sampleAnimation / setGrid (with a canvas)
72
72
  ← sceneOpened, selectionChanged, transformDragging/Dragged, hotReloaded, assetReloaded,
73
73
  hostError, log
74
74
  play view: play / pause / step / stop / playState / playStats / screenshot (with a canvas)
@@ -380,6 +380,13 @@ object `openScene` sends, through `world.loadSceneFile`; `readBack` answers with
380
380
  segment), read from `app.physics` / `app.physics2d` by shape, plus `truncated` when the request
381
381
  passed 256 entities or the lines 600 000 numbers. Edit mode keeps physics bodies on the
382
382
  transforms the editor moves without stepping, so the outlines and physics queries follow.
383
+ - **The grid.** With a canvas the scene host lists the `grid` capability and draws a grid: a
384
+ ground grid at `y = 0` in 3D view mode (depth-tested, centred under the eye, coarser the higher
385
+ the eye, faded out before its edge) and a faint grid over the 2D view (one line per layer pixel
386
+ from zoom 8). `setGrid { visible?, size? }` sets the whole grid each call; a field left out takes
387
+ its default (`visible: true`, `size: 1` metre, 0.001 to 1000). The grid starts visible at every
388
+ load, so re-send the editor's state after `ready`. It is never picked or saved, and never in the
389
+ play view; `screenshot` includes it while it is visible.
383
390
  - **A changed asset reloads in place, not the view.** The scene view's page hands every
384
391
  `ignifx:asset-changed` event to `host.assetChanged`, which calls `app.assets.reload(address)` for an
385
392
  asset the app has loaded, of type `scene` (a scene or prefab), `model`, `mesh`, `material`,