@nakednous/host 0.0.3 → 0.0.5

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/README.md CHANGED
@@ -6,7 +6,7 @@ device streams (WebHID, Gamepad), image and video sources, a DOM label overlay a
6
6
  **zero renderer**, pure vanilla DOM.
7
7
 
8
8
  > **Status: 0.0.x.** The whole surface below is shipped. What a bridge draws (a handle's locus,
9
- > a track's path, a helm's rig) lives in `twgl.tree` / `p5.tree`; the host only computes, through
9
+ > a track's path, a helm's rig) lives in `webgl.tree` / `p5.tree`; the host only computes, through
10
10
  > `@nakednous/tree`, and listens.
11
11
 
12
12
  ---
@@ -46,7 +46,7 @@ WebGL or WebGPU — it owns a canvas element's input and the frame clock, and ha
46
46
  application
47
47
  │
48
48
  ▼
49
- twgl.tree · webgpu.tree ← bridge: the GPU, thinly
49
+ webgl.tree · webgpu.tree ← bridge: the GPU, thinly
50
50
  │
51
51
  ├── @nakednous/host ← this package: pointer, handles, tracks, helms, players, streams, media, labels, orbit
52
52
  │ │
@@ -82,15 +82,16 @@ dependency first and an options object last, and registers with the context so
82
82
  | `host.poseTrack(opts)` · `host.cameraTrack(cam, opts)` | core tracks ticked while they play; `{ handles }` builds `TrackHandles`, one handle per keyframe |
83
83
  | `host.hid(opts)` · `host.gamepad(opts)` | rate streams — `lin[3]` / `ang[3]` in raw device units, `bind(helm)` feeds it each tick; `available`, `connected` |
84
84
  | `host.image(url)` · `host.video(opts)` · `host.raster(draw, w, h)` | texture sources — an `ImageBitmap`, a hidden `<video>` from a file or the camera with a `ready` promise, a Canvas2D drawing |
85
+ | `host.model(url)` | an OBJ model as arrays — `{ position, normal?, texcoord?, indices }`, what twgl's `createBufferInfoFromArrays` takes; host's own parser (fan-triangulated faces, one vertex per distinct position / uv / normal triple), materials ignored |
85
86
  | `host.labels` · `host.hasLabels` | the label layer, created on first access — `set(id, text, x, y, z, opts)` at a world anchor, `setScreen(id, text, sx, sy, opts)` in canvas px, `{ frame: true }` for a label that lives one frame, `tick()`; `hasLabels` probes without creating |
86
- | `host.orbit(cam, opts)` | the fall-through gesture — one pointer orbits, two pan and dolly, the wheel dollies; `update()` reports whether the camera moved; the vertical sense follows the bag's projection (y-up GL, y-flipped p5) |
87
+ | `host.orbit(cam, opts)` | the fall-through gesture — one pointer orbits, two pan and dolly, the wheel dollies; `damping` in seconds (default 0.2; 0 exact) makes the camera trail the gesture and complete it after release; `update(dt)` reports whether the camera moved; the vertical sense follows the bag's projection (y-up GL, y-flipped p5) |
87
88
  | `host.tick(dt)` | external-loop mode: tick the players; the caller flushes the pointer once its consumers ran |
88
89
  | `host.register(c)` · `host.unregister(c)` · `host.dispose()` | the lifecycle |
89
90
 
90
91
  The module-level functions behind the methods are exported too (`createView`, `createPointer`,
91
92
  `createPlayers`, `createLoop`, `observeCanvas`, `Handle`, `PointerRouter`, `cameraHelm`,
92
93
  `poseHelm`, `helmBasis`, `poseTrack`, `cameraTrack`, `TrackHandles`, `createHid`,
93
- `createGamepad`, `decodeSpaceNavigator`, `loadImage`, `createVideo`, `raster`, `createLabels`,
94
+ `createGamepad`, `decodeSpaceNavigator`, `loadImage`, `createVideo`, `raster`, `loadModel`, `createLabels`,
94
95
  `createOrbit`), so an adapter can compose them on its own context.
95
96
 
96
97
  ---