@rig-c/play 1.19.0 → 1.21.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 +3 -0
- package/dist/DomRenderer.d.ts +7 -2
- package/dist/DomRenderer.d.ts.map +1 -1
- package/dist/DomTexture.d.ts +8 -0
- package/dist/DomTexture.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2079 -282
- package/dist/index.js.map +1 -1
- package/dist/liveFrame.d.ts +2 -2
- package/dist/liveFrame.d.ts.map +1 -1
- package/dist/loadModel.d.ts +10 -6
- package/dist/loadModel.d.ts.map +1 -1
- package/dist/player.d.ts +28 -0
- package/dist/player.d.ts.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -183,6 +183,9 @@ package built from this tree.
|
|
|
183
183
|
- [docs/REFERENCE.md](docs/REFERENCE.md) — what the player does once it is on
|
|
184
184
|
the page: what ships and what is measured (*Status*), then every API section
|
|
185
185
|
from wind, gravity and dragging to the runtime knobs and what they cost.
|
|
186
|
+
`physicsMoved(scope, motion)` supplies apparent world movement to named bone,
|
|
187
|
+
subtree or constraint physics; `moved()` continues to report whole-rig motion.
|
|
188
|
+
See the reference for explicit pivots, units and evaluation/history limits.
|
|
186
189
|
- [docs/MIGRATION.md](docs/MIGRATION.md) — coming from 1.8 (meshes draw through
|
|
187
190
|
WebGL by default since 1.9) and from `spine-html` 0.8 (the 0.8 → 1.0 table,
|
|
188
191
|
what has no counterpart, before and after).
|
package/dist/DomRenderer.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { LiveFrame } from './liveFrame.js';
|
|
2
|
-
import { type RegionImage } from './DomTexture.js';
|
|
2
|
+
import { type AtlasRegion, type RegionImage } from './DomTexture.js';
|
|
3
3
|
import type { PosedFrame } from './posedFrame.js';
|
|
4
4
|
/** Rasterizer used for the mesh (deform) tier. */
|
|
5
5
|
export type MeshBackend = 'canvas2d' | 'webgl';
|
|
@@ -40,6 +40,7 @@ export declare class DomRenderer {
|
|
|
40
40
|
private readonly root;
|
|
41
41
|
private readonly regionImages;
|
|
42
42
|
private readonly pages;
|
|
43
|
+
private readonly atlasRegions;
|
|
43
44
|
/**
|
|
44
45
|
* Apply the clips the frame carries (default). Each element drawn inside a
|
|
45
46
|
* clip gets a CSS `clip-path` in its own local frame — an element-level
|
|
@@ -63,6 +64,8 @@ export declare class DomRenderer {
|
|
|
63
64
|
clipping: boolean;
|
|
64
65
|
/** Clips applied last frame — distinct clip polygons over the drawn slots. */
|
|
65
66
|
clipCount: number;
|
|
67
|
+
/** Atlas rigid canvases rasterized in the last frame; never includes meshes. */
|
|
68
|
+
rigidRasterCount: number;
|
|
66
69
|
/**
|
|
67
70
|
* Clips in the frame NOT applied last frame: `clipping` is false, or the
|
|
68
71
|
* polygon has fewer than three points. A clip the runtime itself ignores (a
|
|
@@ -171,11 +174,13 @@ export declare class DomRenderer {
|
|
|
171
174
|
* and scaling of the root belong to the caller.
|
|
172
175
|
* @param regionImages Unpacked per-region bitmaps (for the rigid tier),
|
|
173
176
|
* keyed by region name — `PosedRegion.region`.
|
|
177
|
+
* @param atlasRegions Optional page-backed rigid sources, from createAtlasRegions
|
|
178
|
+
* or ModelAssets.atlasRegions. A matching entry takes precedence over regionImages.
|
|
174
179
|
* @param pages Page images (for the mesh tier), keyed by page name —
|
|
175
180
|
* `PosedMesh.page`. Read on every mesh draw, so a caller may fill it after
|
|
176
181
|
* construction.
|
|
177
182
|
*/
|
|
178
|
-
constructor(root: HTMLElement, regionImages: ReadonlyMap<string, RegionImage>, pages?: ReadonlyMap<string, HTMLImageElement>);
|
|
183
|
+
constructor(root: HTMLElement, regionImages: ReadonlyMap<string, RegionImage>, pages?: ReadonlyMap<string, HTMLImageElement>, atlasRegions?: ReadonlyMap<string, AtlasRegion>);
|
|
179
184
|
/**
|
|
180
185
|
* Backing-store pixels currently allocated across the mesh canvases
|
|
181
186
|
* (Σ width × height). Computed on demand from the views — nothing is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomRenderer.d.ts","sourceRoot":"","sources":["../src/DomRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,
|
|
1
|
+
{"version":3,"file":"DomRenderer.d.ts","sourceRoot":"","sources":["../src/DomRenderer.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,OAAO,EAAE,KAAK,WAAW,EAAoC,KAAK,WAAW,EAAuB,MAAM,iBAAiB,CAAC;AAE5H,OAAO,KAAK,EAAwB,UAAU,EAAqC,MAAM,iBAAiB,CAAC;AAE3G,kDAAkD;AAClD,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,OAAO,CAAC;AAE/C;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,MAAM,CAAC;AAyMjD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,qBAAa,WAAW;IA+IpB,OAAO,CAAC,QAAQ,CAAC,IAAI;IACrB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,YAAY;IAjJ/B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,QAAQ,UAAQ;IAChB,8EAA8E;IAC9E,SAAS,SAAK;IACd,gFAAgF;IAChF,gBAAgB,SAAK;IACrB;;;;;OAKG;IACH,aAAa,SAAK;IAClB;;;;OAIG;IACH,cAAc,SAAK;IACnB,2CAA2C;IAC3C,SAAS,SAAK;IACd,kEAAkE;IAClE,cAAc,SAAK;IACnB;;;;OAIG;IACH,kBAAkB,SAAK;IACvB,uCAAuC;IACvC,aAAa,SAAK;IAClB;;;;;OAKG;IACH,cAAc,SAAO;IACrB;;;;OAIG;IACH,cAAc,EAAE,c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G,SAAS,GAAG,IAAI;IAwE3C;;;;;;;;;;;;;;;;;OAiBG;IACH,OAAO,IAAI,IAAI;IAiBf,OAAO,CAAC,YAAY;IAuDpB,OAAO,CAAC,UAAU;IA8JlB;;;;;;OAMG;IACH,OAAO,CAAC,UAAU;IAWlB,sEAAsE;IACtE,OAAO,CAAC,eAAe;IAwCvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA2DG;IACH,OAAO,CAAC,YAAY;IAWpB;;;;;;;;;;;;;OAaG;IACH,OAAO,CAAC,OAAO;IAmCf;;;;;;;;;;OAUG;IACH,OAAO,CAAC,SAAS;IAoDjB,OAAO,CAAC,WAAW;IAOnB,yEAAyE;IACzE,OAAO,CAAC,YAAY;IAUpB,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,eAAe;IAUvB,OAAO,CAAC,YAAY;IAOpB,OAAO,CAAC,WAAW;IA4CnB,OAAO,CAAC,aAAa;IAyBrB,OAAO,CAAC,IAAI;IAuDZ,OAAO,CAAC,IAAI;CAWb"}
|
package/dist/DomTexture.d.ts
CHANGED
|
@@ -46,6 +46,14 @@ export interface RegionImage {
|
|
|
46
46
|
/** Unpacked height in atlas units — see `width`. */
|
|
47
47
|
height: number;
|
|
48
48
|
}
|
|
49
|
+
/** One region's page-backed source, without an encoded per-region URL. */
|
|
50
|
+
export interface AtlasRegion {
|
|
51
|
+
readonly page: PageLayout;
|
|
52
|
+
readonly region: PageRegion;
|
|
53
|
+
readonly image: HTMLImageElement;
|
|
54
|
+
}
|
|
55
|
+
/** Maps atlas entries in layout order; duplicate names keep the last entry. */
|
|
56
|
+
export declare function createAtlasRegions(pages: readonly PageLayout[], images: ReadonlyMap<string, HTMLImageElement>): Map<string, AtlasRegion>;
|
|
49
57
|
/**
|
|
50
58
|
* Page pixels in the alpha convention a DOM/canvas2d consumer needs: the page
|
|
51
59
|
* image itself, or the derived canvas below when the page is premultiplied.
|
package/dist/DomTexture.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DomTexture.d.ts","sourceRoot":"","sources":["../src/DomTexture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,SAAS,UAAU,EAAE,CAAC;CAChC;AAQD,MAAM,WAAW,WAAW;IAC1B;;;;OAIG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;;;;;;;;OASG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"DomTexture.d.ts","sourceRoot":"","sources":["../src/DomTexture.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;GAIG;AACH,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;IACf,kFAAkF;IAClF,GAAG,CAAC,EAAE,OAAO,CAAC;IACd,OAAO,EAAE,SAAS,UAAU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,MAAM,EAAE,WAAW,CAAC,CAAC,CA4EnC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,GAAG,IAAI,CAEpE"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export { type CanvasBackend, CanvasRenderer, type CanvasViewport } from './CanvasRenderer.js';
|
|
2
2
|
export { DomRenderer, type MeshBackend, type MeshSourceRect } from './DomRenderer.js';
|
|
3
|
-
export { type PageLayout, type PageRegion, type RegionEncoding, type RegionImage, revokeRegions, type UnpackRegionsOptions, unpackRegions } from './DomTexture.js';
|
|
3
|
+
export { type AtlasRegion, createAtlasRegions, type PageLayout, type PageRegion, type RegionEncoding, type RegionImage, revokeRegions, type UnpackRegionsOptions, unpackRegions } from './DomTexture.js';
|
|
4
4
|
export { type LoadModelOptions, loadModel, type ModelAssets, type ModelDocument, readSetupMesh, type RegionLoading, type RigSet, type SetupMesh, type SetupMeshTarget } from './loadModel.js';
|
|
5
|
-
export { type AdjustableBones, type BoneAdjust, type BoneAdjustContext, type BoneLocals, type BoneWorld, type PhysicsParameters, type PhysicsParameterPatch, type PhysicsParameterRead, type PlayOptions, type PoseBounds, type QueueOptions, type RenderMode, type RigComplete, type RigEnvironment, type RigEvent, RigPlayer, type RigPlayerOptions, type SetActivationOptions, type SlotFilter, type SlotIdentity, type SlotIdentityReason, type SlotIdentitySnapshot, type TrackEntry } from './player.js';
|
|
5
|
+
export { type AdjustableBones, type BoneAdjust, type BoneAdjustContext, type BoneLocals, type BoneWorld, type PhysicsMotion, type PhysicsMotionScope, type PhysicsParameters, type PhysicsParameterPatch, type PhysicsParameterRead, type PlayOptions, type PoseBounds, type QueueOptions, type RenderMode, type RigComplete, type RigEnvironment, type RigEvent, RigPlayer, type RigPlayerOptions, type SetActivationOptions, type SlotFilter, type SlotIdentity, type SlotIdentityReason, type SlotIdentitySnapshot, type TrackEntry } from './player.js';
|
|
6
6
|
export type { BlendMode, PosedClip, PosedFrame, PosedMesh, PosedRegion, PosedSlot, } from './posedFrame.js';
|
|
7
7
|
export type { LiveFrame, LiveNumbers, LiveAttachment, LiveClip } from './liveFrame.js';
|
|
8
8
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,WAAW,EAAE,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACtF,OAAO,EAAE,KAAK,WAAW,EAAE,kBAAkB,EAAE,KAAK,UAAU,EAAE,KAAK,UAAU,EAAE,KAAK,cAAc,EAAE,KAAK,WAAW,EAAE,aAAa,EAAE,KAAK,oBAAoB,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACzM,OAAO,EAAE,KAAK,gBAAgB,EAAE,SAAS,EAAE,KAAK,WAAW,EAAE,KAAK,aAAa,EAAE,aAAa,EAAE,KAAK,aAAa,EAAE,KAAK,MAAM,EAAE,KAAK,SAAS,EAAE,KAAK,eAA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