@rig-c/play 1.28.0 → 1.29.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/dist/_play-runtime.js +1 -0
- package/dist/_play-runtime.js.map +1 -1
- package/dist/composed-camera.d.ts.map +1 -1
- package/dist/composed-take.d.ts +13 -0
- package/dist/composed-take.d.ts.map +1 -1
- package/dist/composed-take.js +366 -38
- package/dist/composed-take.js.map +1 -1
- package/dist/loadModel.d.ts +7 -1
- package/dist/loadModel.d.ts.map +1 -1
- package/dist/scene-camera.d.ts.map +1 -1
- package/docs/REFERENCE.md +34 -0
- package/package.json +1 -1
package/dist/loadModel.d.ts
CHANGED
|
@@ -11,6 +11,12 @@ import { type AtlasRegion, type RegionImage } from './DomTexture.js';
|
|
|
11
11
|
* (`.json`, `.skel`) is refused by name: this package poses the compiled model
|
|
12
12
|
* through `rig-c/core` and reads nothing else.
|
|
13
13
|
*/
|
|
14
|
+
/**
|
|
15
|
+
* The fetch call `loadModel` makes: the call signature only. `typeof fetch`
|
|
16
|
+
* also carries whatever statics the ambient typings add (bun-types adds
|
|
17
|
+
* `preconnect`), which a wrapper or a test double cannot satisfy.
|
|
18
|
+
*/
|
|
19
|
+
export type ModelFetch = (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>;
|
|
14
20
|
export interface LoadModelOptions {
|
|
15
21
|
/** URL of the compiled model document (`skeleton.model.json`). */
|
|
16
22
|
modelUrl: string;
|
|
@@ -28,7 +34,7 @@ export interface LoadModelOptions {
|
|
|
28
34
|
*/
|
|
29
35
|
crossOrigin?: string;
|
|
30
36
|
/** fetch implementation, for custom headers or a test double. */
|
|
31
|
-
fetch?:
|
|
37
|
+
fetch?: ModelFetch;
|
|
32
38
|
/**
|
|
33
39
|
* What the region cut produces — the rigid tier's per-region bitmaps, which
|
|
34
40
|
* only the DOM mode draws. `'atlas'`: opt-in page-backed rigid canvases,
|
package/dist/loadModel.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loadModel.d.ts","sourceRoot":"","sources":["../src/loadModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAEvH;;;;;;;;;;;GAWG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,KAAK,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"loadModel.d.ts","sourceRoot":"","sources":["../src/loadModel.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,WAAW,EAAsB,KAAK,WAAW,EAAgC,MAAM,iBAAiB,CAAC;AAEvH;;;;;;;;;;;GAWG;AAEH;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG,CAAC,KAAK,EAAE,WAAW,GAAG,GAAG,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAE7F,MAAM,WAAW,gBAAgB;IAC/B,kEAAkE;IAClE,QAAQ,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IAC7D;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,KAAK,CAAC,EAAE,UAAU,CAAC;IACnB;;;;;;;;;OASG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB;;;;;OAKG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,wEAAwE;AACxE,MAAM,MAAM,a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B,CAAC;
|
|
1
|
+
{"version":3,"file":"scene-camera.d.ts","sourceRoot":"","sources":["../src/scene-camera.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAG1D,MAAM,MAAM,gBAAgB,GACxB;IAAE,KAAK,EAAE,UAAU,GAAG,UAAU,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,OAAO,CAAA;CAAE,GACvE;IAAE,QAAQ,EAAE,UAAU,CAAA;CAAE,CAAC;AAE7B,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,eAAe,EAAE,MAAM,CAAC;IACjC,qDAAqD;IACrD,QAAQ,CAAC,GAAG,EAAE,SAAS,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,cAAc,CAAC,CAAC;IAC7C,QAAQ,CAAC,MAAM,EAAE,QAAQ,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IAC7D,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,gBAAgB;IAC/B,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,gBAAgB,GAAG,gBAAgB,GAAG,IAAI,CAAC;CAC7E;AAED,MAAM,MAAM,kBAAkB,GAAG,6BAA6B,GAAG,6BAA6B,GAC1F,4BAA4B,GAAG,4BAA4B,GAAG,2BAA2B,GACzF,+BAA+B,CAAC;AAQpC,eAAO,MAAM,6BAA6B,QAAkB,CAAC"}
|
package/docs/REFERENCE.md
CHANGED
|
@@ -545,6 +545,40 @@ a skeletal clip shared by planes with different shifts uses a polygon moved
|
|
|
545
545
|
with each distinct shift. Omitting the report, supplying report /1, or
|
|
546
546
|
selecting an unkeyed /2 take uses the existing fixed-stage path.
|
|
547
547
|
|
|
548
|
+
On a looping, digest-bound keyed take in Parallax, a Parts `scene_driven`
|
|
549
|
+
declaration can give the view and the listed numeric bone timelines their
|
|
550
|
+
own phase. The pointer eases their playback rate to zero over
|
|
551
|
+
`transitionMs`, holds the continuous phase reached at the end of that
|
|
552
|
+
transition, then eases back to full rate from that phase on leave. Life
|
|
553
|
+
timelines, events and physics keep their existing clocks. Pointer turn
|
|
554
|
+
continues to blend each bound axis toward the pointer. A scene-keyed dial
|
|
555
|
+
blends back toward its scene sample, and a character-keyed dial toward its
|
|
556
|
+
live sample. Set `pointerTurn: false` to keep each dial on its authored phase.
|
|
557
|
+
Touch leaves the scene clock automatic.
|
|
558
|
+
|
|
559
|
+
| Operation | Scene phase |
|
|
560
|
+
| --- | --- |
|
|
561
|
+
| `player.pause()` and `player.resume()` | The scene phase and player track time freeze in place and resume with the same offset. |
|
|
562
|
+
| `player.seek()`, replay, or a take change | Both phases start from the resulting player track time. With the pointer inside, the scene holds immediately at that phase. |
|
|
563
|
+
| Camera mode change | The scene phase starts from the current player track time when returning to Parallax. With the pointer inside, it holds immediately. Fixed and Pan follow the live pose and view. |
|
|
564
|
+
|
|
565
|
+
`sceneHandoff` on the mount reports `behavior: 'hold'` with the unwrapped
|
|
566
|
+
compiled `phase`, or `'additive'` with a null phase. With a declaration
|
|
567
|
+
outside this mode's scope it reports `'refused'`, a null phase, and a
|
|
568
|
+
`reason` naming the address or backdrop dependency when applicable. Refusals
|
|
569
|
+
retain the existing camera behavior. The hold accepts numeric bone properties
|
|
570
|
+
only, and the backdrop must depend on the scene phase alone. One-shots,
|
|
571
|
+
pose-only declarations and report /1 do not enable this mode. Reports and
|
|
572
|
+
takes without the declaration keep their existing behavior. Attachment-set
|
|
573
|
+
operations that change the backdrop slot are outside the scene hold's
|
|
574
|
+
coverage contract.
|
|
575
|
+
|
|
576
|
+
The hold uses the same sampled-row geometric guard as automatic playback.
|
|
577
|
+
A held phase can dwell between two rows where the margin is smaller. On the
|
|
578
|
+
public eased fixture at 1.1333 seconds, the margin after the admitted excursion
|
|
579
|
+
is 0.441 backing pixels against the one-pixel guard. The view still lies
|
|
580
|
+
inside the backdrop at that phase.
|
|
581
|
+
|
|
548
582
|
To drive rendering directly, import `bindSceneCamera`,
|
|
549
583
|
`sceneCameraProjection` and `renderSceneCameraFrame` from
|
|
550
584
|
`@rig-c/play/composed-take`. Pass `bindSceneCamera(report, model)` the stage,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rig-c/play",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.29.0",
|
|
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",
|