@rig-c/play 1.26.0 → 1.28.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/README.md +29 -11
- package/dist/CanvasRenderer.d.ts.map +1 -1
- package/dist/MeshGlBlitter.d.ts.map +1 -1
- package/dist/_play-runtime.js +15079 -0
- package/dist/_play-runtime.js.map +1 -0
- package/dist/composed-camera.d.ts +30 -0
- package/dist/composed-camera.d.ts.map +1 -0
- package/dist/composed-take.d.ts +124 -0
- package/dist/composed-take.d.ts.map +1 -0
- package/dist/composed-take.js +1536 -0
- package/dist/composed-take.js.map +1 -0
- package/dist/index.js +11 -14975
- package/dist/index.js.map +1 -1
- package/dist/scene-camera.d.ts +28 -0
- package/dist/scene-camera.d.ts.map +1 -0
- package/docs/MIGRATION.md +201 -0
- package/docs/REFERENCE.md +1482 -0
- package/docs/STABILITY.md +56 -0
- package/package.json +18 -1
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# @rig-c/play stability inventory
|
|
2
|
+
|
|
3
|
+
## Turn dials
|
|
4
|
+
|
|
5
|
+
| Root export | Stable contract |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `discoverTurnDials(model, durations?)` | Reads compiled model JSON and returns at most one dial per axis in yaw, pitch, body order. A supplied duration list takes precedence over the serialized durations. The model's bindings and slider mapping determine the exact bone, channel and range. Ambiguous or unusable bindings are skipped. |
|
|
8
|
+
| `TurnAxis` | The literals `'yaw'`, `'pitch'` and `'body'`. |
|
|
9
|
+
| `TurnDial` | The fields `axis`, `bone`, `slider`, `channel`, `min`, `max` and `provenance`. Bone and slider names retain their namespaces. Provenance is human-readable and its wording may evolve. |
|
|
10
|
+
| `normalizedDial(value, range)` | Maps normalized input to a range around zero (or the nearest endpoint if zero is outside the range). Inputs outside `[-1, 1]` clamp to the corresponding endpoint. |
|
|
11
|
+
|
|
12
|
+
See the [turn dial reference](REFERENCE.md#discovering-turn-dials) for matching,
|
|
13
|
+
range calculation and use with `BoneAdjust`.
|
|
14
|
+
|
|
15
|
+
## Composed takes
|
|
16
|
+
|
|
17
|
+
| Export from `@rig-c/play/composed-take` | Supported contract |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| `mountComposedTake(root, options)` | Mounts a compiled take in a browser and resolves to a `MountedTake`. |
|
|
20
|
+
| `ComposedTakeError` | Use `code` to handle a refusal. Message wording and underlying causes may evolve. |
|
|
21
|
+
| `CameraMode` | The literals `'fixed'`, `'pan'` and `'parallax'`. |
|
|
22
|
+
| `ComposedPlane` | A plane declares `slots`, `role` and optional `gain` and `baked`. |
|
|
23
|
+
| `ComposedTakeOptions` | Supported option names are `modelUrl`, `sceneReportUrl`, `animation`, `loop`, `planes`, `camera`, `maxDisplacement`, `backend`, `autoStart`, `autoSweep`, `transitionMs` and `pointerTurn`. For a keyed report /2 take, `loop` must agree with the authored flag. Other takes require `loop: true`. |
|
|
24
|
+
| `MountedTake` | The mounted canvas and player, camera and turn readouts, refusal state, and camera, frame and disposal methods. |
|
|
25
|
+
| `SCENE_CAMERA_REPORT_MAX_BYTES` | Consumer budget for raw UTF-8 scene report bytes. This value is the minimum budget for later minor releases. |
|
|
26
|
+
| `bindSceneCamera(report, model)` | Returns `null` for report /1 or a bound camera for report /2. Pass raw UTF-8 bytes as a `Uint8Array` to enforce the budget before parsing. Callers passing a parsed report enforce the same budget on the raw bytes themselves. The model digest must cover the exact bytes the caller parses. The binding validates the stage and animation metadata. |
|
|
27
|
+
| `BoundSceneCamera.sample(animation, clock)` | Returns a `SceneCameraFrame` for the named track, `null` for a known unkeyed animation, or `SCENE_CAMERA_CLIP_MISMATCH` for an unknown animation. |
|
|
28
|
+
| `SceneCameraClock` | A phase in finite, nonnegative authored or compiled seconds, or an explicit unwrapped terminal sample. Phase wraps for looping takes and clamps for one-shots. |
|
|
29
|
+
| `SceneCameraFrame` | Animation name, authored and compiled seconds, pan in authored pixels (Y down), zoom, world view (Y up), output dimensions in authored pixels and loop flag. |
|
|
30
|
+
| `sceneCameraProjection(frame)` | Inverse world-to-output and output-to-world mappings, including outside the fixed output clip. |
|
|
31
|
+
| `renderSceneCameraFrame(renderer, pose, frame, backing?)` | Draws one pose through the camera on either canvas backend. Optional integer backing dimensions scale the raster. Divide backing-space pointer coordinates by that scale before applying the inverse projection. Its output space stays in authored canvas pixels. |
|
|
32
|
+
|
|
33
|
+
`dist/composed-camera.d.ts` ships as a type dependency of `@rig-c/play/composed-take`. It has no export-map key and is outside the public import surface.
|
|
34
|
+
The supported refusal codes are listed in the [composed take reference](REFERENCE.md#composed-take-refusals).
|
|
35
|
+
The authored camera codes are `SCENE_CAMERA_REPORT_INVALID`,
|
|
36
|
+
`SCENE_CAMERA_REPORT_TOO_LARGE`,
|
|
37
|
+
`SCENE_CAMERA_MODEL_MISMATCH`, `SCENE_CAMERA_CLIP_MISMATCH`,
|
|
38
|
+
`SCENE_CAMERA_CLOCK_INVALID` and `SCENE_CAMERA_VIEW_INVALID`.
|
|
39
|
+
|
|
40
|
+
The compiled duration is Core's maximum stored timeline time on the packed
|
|
41
|
+
animation, at binary32 precision, exposed as a JavaScript number in
|
|
42
|
+
`ModelAssets.animations`. Binding compares it for exact equality with the
|
|
43
|
+
report's `compiled_duration`. The authored `duration` can differ. The two
|
|
44
|
+
durations must be finite and nonnegative, and zero on one clock requires zero
|
|
45
|
+
on the other. Samples map the current phase between the clocks, preserve the
|
|
46
|
+
exact endpoints and use the player's JavaScript animation time. Consumers
|
|
47
|
+
that compare a copied authored duration use exact equality with the report's
|
|
48
|
+
`duration`.
|
|
49
|
+
|
|
50
|
+
On keyed takes, a skeletal clip shared by planes with different shifts uses
|
|
51
|
+
a polygon moved with each distinct shift.
|
|
52
|
+
|
|
53
|
+
Until the demo page uses this entry, a minor release may retune the handoff
|
|
54
|
+
duration (`transitionMs`), automatic sweep (`autoSweep`) or pointer hover excursion
|
|
55
|
+
(`maxDisplacement`). The [reference](REFERENCE.md#mounting-a-composed-take)
|
|
56
|
+
records the current defaults.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rig-c/play",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.28.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",
|
|
@@ -33,11 +33,19 @@
|
|
|
33
33
|
".": {
|
|
34
34
|
"types": "./dist/index.d.ts",
|
|
35
35
|
"import": "./dist/index.js"
|
|
36
|
+
},
|
|
37
|
+
"./composed-take": {
|
|
38
|
+
"types": "./dist/composed-take.d.ts",
|
|
39
|
+
"import": "./dist/composed-take.js"
|
|
36
40
|
}
|
|
37
41
|
},
|
|
38
42
|
"files": [
|
|
39
43
|
"dist/index.js",
|
|
40
44
|
"dist/index.js.map",
|
|
45
|
+
"dist/composed-take.js",
|
|
46
|
+
"dist/composed-take.js.map",
|
|
47
|
+
"dist/_play-runtime.js",
|
|
48
|
+
"dist/_play-runtime.js.map",
|
|
41
49
|
"dist/CanvasRenderer.d.ts",
|
|
42
50
|
"dist/CanvasRenderer.d.ts.map",
|
|
43
51
|
"dist/DomRenderer.d.ts",
|
|
@@ -48,6 +56,12 @@
|
|
|
48
56
|
"dist/MeshGlBlitter.d.ts.map",
|
|
49
57
|
"dist/index.d.ts",
|
|
50
58
|
"dist/index.d.ts.map",
|
|
59
|
+
"dist/composed-take.d.ts",
|
|
60
|
+
"dist/composed-take.d.ts.map",
|
|
61
|
+
"dist/composed-camera.d.ts",
|
|
62
|
+
"dist/composed-camera.d.ts.map",
|
|
63
|
+
"dist/scene-camera.d.ts",
|
|
64
|
+
"dist/scene-camera.d.ts.map",
|
|
51
65
|
"dist/loadModel.d.ts",
|
|
52
66
|
"dist/loadModel.d.ts.map",
|
|
53
67
|
"dist/pixelRatio.d.ts",
|
|
@@ -63,6 +77,9 @@
|
|
|
63
77
|
"dist/liveFrameSource.d.ts.map",
|
|
64
78
|
"dist/turnDials.d.ts",
|
|
65
79
|
"dist/turnDials.d.ts.map",
|
|
80
|
+
"docs/MIGRATION.md",
|
|
81
|
+
"docs/REFERENCE.md",
|
|
82
|
+
"docs/STABILITY.md",
|
|
66
83
|
"skills"
|
|
67
84
|
],
|
|
68
85
|
"sideEffects": false,
|