@rig-c/play 1.21.1 → 1.21.2
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 +30 -18
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
compiled model document `rigc build` writes, `skeleton.model.json` — as **plain
|
|
13
13
|
DOM**: one absolutely-positioned `<img>` per rigid slot, posed with a single CSS
|
|
14
14
|
`matrix()` write per frame, and deforming meshes on small per-part canvases; or
|
|
15
|
-
as **one canvas** per player. It poses through `rig-c/
|
|
16
|
-
core
|
|
15
|
+
as **one canvas** per player. It poses through rigc's bundled `rig-c/runtime`
|
|
16
|
+
and `rig-c/core`, and links nothing from Esoteric Software.
|
|
17
17
|
`rig-play` is the convenience install name; `spine-html` is the legacy install name.
|
|
18
18
|
The compiler is [@rig-c/core](https://github.com/rig-c/core) (npm `@rig-c/core`)
|
|
19
19
|
and the part generator [rig-c/parts](https://github.com/rig-c/parts).
|
|
@@ -112,8 +112,7 @@ The package plays rigs built by [rigc](https://github.com/rig-c/core):
|
|
|
112
112
|
is what the player loads, and it states everything posing and drawing need —
|
|
113
113
|
the skeleton, the animations, and where every region sits on its page — so the
|
|
114
114
|
`.atlas` and `skeleton.json` beside it are not fetched. Poses are computed by
|
|
115
|
-
`rig-c/
|
|
116
|
-
is nothing else to install.
|
|
115
|
+
the bundled `rig-c/runtime` and `rig-c/core`: there is nothing else to install.
|
|
117
116
|
|
|
118
117
|
```ts
|
|
119
118
|
import { loadModel, RigPlayer } from '@rig-c/play';
|
|
@@ -186,9 +185,9 @@ package built from this tree.
|
|
|
186
185
|
`physicsMoved(scope, motion)` supplies apparent world movement to named bone,
|
|
187
186
|
subtree or constraint physics; `moved()` continues to report whole-rig motion.
|
|
188
187
|
See the reference for explicit pivots, units and evaluation/history limits.
|
|
189
|
-
- [docs/MIGRATION.md](docs/MIGRATION.md) —
|
|
190
|
-
WebGL by default since 1.9) and from `spine-html`
|
|
191
|
-
what has no counterpart, before and after).
|
|
188
|
+
- [docs/MIGRATION.md](docs/MIGRATION.md) — adding live-frame consumers, coming
|
|
189
|
+
from 1.8 (meshes draw through WebGL by default since 1.9) and from `spine-html`
|
|
190
|
+
0.8 (the 0.8 → 1.0 table, what has no counterpart, before and after).
|
|
192
191
|
- [docs/TESTING.md](docs/TESTING.md) — how the suite holds the picture: the two
|
|
193
192
|
render modes' parity, the clipping oracle, the loading harness, and the
|
|
194
193
|
independent official raster oracle.
|
|
@@ -224,16 +223,28 @@ deterministic captures.
|
|
|
224
223
|
|
|
225
224
|
## How it works
|
|
226
225
|
|
|
227
|
-
`loadModel` reads the rig's compiled model document (`rig-c/core`'s `readModel`)
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
226
|
+
`loadModel` reads the rig's compiled model document (`rig-c/core`'s `readModel`).
|
|
227
|
+
With the default `poser: 'auto'`, `RigPlayer` uses `rig-c/runtime`'s
|
|
228
|
+
`compileRuntime` and `RuntimePose` for covered models and animations, drawing
|
|
229
|
+
from a borrowed `LiveFrame` exposed by `player.liveFrame()`. Features and
|
|
230
|
+
operations outside that path's coverage use the `rig-c/core` oracle —
|
|
231
|
+
`openTrack` for a single track, `openTracks` for track composition. Models with
|
|
232
|
+
physics constraints stay on that oracle path. `player.poser` reports `"runtime"` or
|
|
233
|
+
`"oracle: <reason>"`; `poser: 'oracle'` selects the oracle explicitly. Posing
|
|
234
|
+
stays CPU-side and renderer-agnostic, advancing one `dt` at a time.
|
|
235
|
+
|
|
236
|
+
Both renderers accept a borrowed `LiveFrame` or a detached `PosedFrame`.
|
|
237
|
+
`player.posedFrame()` returns a snapshot that survives later pose mutations;
|
|
238
|
+
a live frame is valid only until the next pose mutation. See
|
|
239
|
+
[Borrowing a live frame](docs/REFERENCE.md#borrowing-a-live-frame) for the
|
|
240
|
+
buffer layout, lifetime and fallback policy.
|
|
241
|
+
|
|
242
|
+
At load time each region of the document's `pages` section is cut into its own
|
|
243
|
+
bitmap (rotation restored), one blob URL per region — except regions that
|
|
244
|
+
already cover their whole page, which are used as they are. Both frame forms
|
|
245
|
+
describe, for each slot in draw order, a region's four world corners (order
|
|
246
|
+
**BL, UL, UR, BR**) or a mesh's world vertices, page UVs and triangles, its tint,
|
|
247
|
+
blend and clip. For a region: flip Y (the frame is Y-up), derive the affine from three
|
|
237
248
|
corners, write one `matrix()` string. That's the whole rigid render path.
|
|
238
249
|
|
|
239
250
|
## License
|
|
@@ -243,7 +254,8 @@ so here is what is true of this package and this repository, stated plainly:
|
|
|
243
254
|
|
|
244
255
|
1. The published package — `@rig-c/play`, and `rig-play` and `spine-html`, the same files — **links
|
|
245
256
|
nothing from Esoteric Software**. Its one module bundles the renderer and
|
|
246
|
-
`rig-c/core` (MIT), which
|
|
257
|
+
`rig-c/core` and `rig-c/runtime` (MIT), which pose rigc's model document;
|
|
258
|
+
no part of the
|
|
247
259
|
[Spine Runtimes](https://github.com/EsotericSoftware/spine-runtimes) is in it or
|
|
248
260
|
required beside it.
|
|
249
261
|
2. Development tooling pins `@esotericsoftware/spine-webgl` 4.3.13 and its matching
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rig-c/play",
|
|
3
|
-
"version": "1.21.
|
|
3
|
+
"version": "1.21.2",
|
|
4
4
|
"description": "Plays skeleton.model.json written by rigc build as plain DOM elements — rigid slots as <img> posed by CSS matrix, deform meshes on small per-part canvases — or as one canvas.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|