@glissade/scene 0.55.0-pre.0 → 0.55.0-pre.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/dist/describe.js +1 -1
- package/dist/motion.d.ts +12 -3
- package/dist/motion.js +20 -1
- package/package.json +2 -2
package/dist/describe.js
CHANGED
|
@@ -23,7 +23,7 @@ import { easings, listValueTypes } from "@glissade/core";
|
|
|
23
23
|
* never pulled onto the base embed path — a scene that never calls `describe()`
|
|
24
24
|
* pays zero bytes for it.
|
|
25
25
|
*/
|
|
26
|
-
const RAW_VERSION = "0.55.0-pre.
|
|
26
|
+
const RAW_VERSION = "0.55.0-pre.2";
|
|
27
27
|
const PACKAGE_VERSION = RAW_VERSION.includes("GLISSADE_".concat("VERSION")) ? "0.0.0-dev" : RAW_VERSION;
|
|
28
28
|
/**
|
|
29
29
|
* Parse the documented positional-arg count from a helper `usage` string — the
|
package/dist/motion.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as DisplayListBuilder } from "./displayList.js";
|
|
1
|
+
import { C as Mat2x3, r as DisplayListBuilder } from "./displayList.js";
|
|
2
2
|
import { B as Node, H as NodeProps, R as EvalContext, U as PropInit, a as Group, l as Path } from "./nodes.js";
|
|
3
3
|
import { BindableSignal, PathValue, Vec2, Vec2Signal } from "@glissade/core";
|
|
4
4
|
|
|
@@ -123,6 +123,9 @@ interface ShakeSpec {
|
|
|
123
123
|
/** Noise cycles per second (higher = twitchier); default 8. */
|
|
124
124
|
frequency?: number;
|
|
125
125
|
}
|
|
126
|
+
/** The shake spec applied to `node` via {@link shake}, or undefined — the seam an
|
|
127
|
+
* exporter uses to emit an honest "shake is render-only" warn (never a silent drop). */
|
|
128
|
+
declare function shakenSpec(node: Node): ShakeSpec | undefined;
|
|
126
129
|
/**
|
|
127
130
|
* The pure per-time shake offset for a spec: `{ dx, dy }` px + `dr` degrees, each
|
|
128
131
|
* a deterministic function of `(seed, t)`. Both the {@link shake} node driver and
|
|
@@ -182,7 +185,10 @@ interface CameraProps extends NodeProps {
|
|
|
182
185
|
* the PAN by the layer's depth (far layers, depth<1, pan less). `centerRel` is the
|
|
183
186
|
* RELATIVE focal point ([0.5,0.5]=screen center); `roll` is degrees.
|
|
184
187
|
*/
|
|
185
|
-
|
|
188
|
+
declare function cameraLayerMatrix(size: {
|
|
189
|
+
w: number;
|
|
190
|
+
h: number;
|
|
191
|
+
}, centerRel: Vec2, zoom: number, roll: number, depth: number): Mat2x3;
|
|
186
192
|
declare class Camera extends Group {
|
|
187
193
|
#private;
|
|
188
194
|
get describeType(): string;
|
|
@@ -194,6 +200,9 @@ declare class Camera extends Group {
|
|
|
194
200
|
readonly roll: BindableSignal<number>;
|
|
195
201
|
/** Resolved layers (content + depth), parallel to `children`. */
|
|
196
202
|
readonly layers: readonly Required<CameraLayer>[];
|
|
203
|
+
/** The whole-frame shake spec, if any — read by exporters (render-only, so it is
|
|
204
|
+
* warned + not baked into Lottie keyframes). */
|
|
205
|
+
get shakeSpec(): ShakeSpec | undefined;
|
|
197
206
|
constructor(layers: CameraLayer[], props?: CameraProps);
|
|
198
207
|
protected draw(out: DisplayListBuilder, ctx: EvalContext): void;
|
|
199
208
|
}
|
|
@@ -207,4 +216,4 @@ declare class Camera extends Group {
|
|
|
207
216
|
*/
|
|
208
217
|
declare function camera(layers: CameraLayer[], props?: CameraProps): Camera;
|
|
209
218
|
//#endregion
|
|
210
|
-
export { Camera, CameraError, type CameraLayer, type CameraProps, FollowPath, type FollowPathProps, LookAt, type LookAtProps, OrientToPath, type OrientToPathProps, type PathSampler, type ShakeSpec, camera, followPath, lookAt, motionPath, orientToPath, pathLength, pointAtLength, shake, shakeOffset };
|
|
219
|
+
export { Camera, CameraError, type CameraLayer, type CameraProps, FollowPath, type FollowPathProps, LookAt, type LookAtProps, OrientToPath, type OrientToPathProps, type PathSampler, type ShakeSpec, camera, cameraLayerMatrix, followPath, lookAt, motionPath, orientToPath, pathLength, pointAtLength, shake, shakeOffset, shakenSpec };
|
package/dist/motion.js
CHANGED
|
@@ -29,6 +29,19 @@ function snoise(seed, t) {
|
|
|
29
29
|
return valueNoise(seed, t) * 2 - 1;
|
|
30
30
|
}
|
|
31
31
|
/**
|
|
32
|
+
* Render-INVISIBLE marker: which nodes a {@link shake} driver is applied to, and
|
|
33
|
+
* with what spec. The render path NEVER reads this (shake works purely by wrapping
|
|
34
|
+
* `emit`), so it is byte-neutral for goldens — it exists ONLY so an EXPORTER
|
|
35
|
+
* (which reads signals, not `emit`) can detect the render-only jitter and warn
|
|
36
|
+
* honestly instead of silently dropping it. A WeakMap keeps it off the Node type.
|
|
37
|
+
*/
|
|
38
|
+
const SHAKEN = /* @__PURE__ */ new WeakMap();
|
|
39
|
+
/** The shake spec applied to `node` via {@link shake}, or undefined — the seam an
|
|
40
|
+
* exporter uses to emit an honest "shake is render-only" warn (never a silent drop). */
|
|
41
|
+
function shakenSpec(node) {
|
|
42
|
+
return SHAKEN.get(node);
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
32
45
|
* The pure per-time shake offset for a spec: `{ dx, dy }` px + `dr` degrees, each
|
|
33
46
|
* a deterministic function of `(seed, t)`. Both the {@link shake} node driver and
|
|
34
47
|
* the Camera whole-frame shake fold this in.
|
|
@@ -89,6 +102,7 @@ function shake(node, spec) {
|
|
|
89
102
|
const tr = spec.translate ?? 0;
|
|
90
103
|
const rot = spec.rotate ?? 0;
|
|
91
104
|
if (tr === 0 && rot === 0) throw new Error("shake(): pass a nonzero `translate` (px) or `rotate` (deg) amplitude — both are 0/omitted, so nothing would move.");
|
|
105
|
+
SHAKEN.set(node, spec);
|
|
92
106
|
const origEmit = node.emit.bind(node);
|
|
93
107
|
node.emit = (out, ctx) => {
|
|
94
108
|
const { dx, dy, dr } = shakeOffset(spec, ctx.time);
|
|
@@ -196,6 +210,11 @@ var Camera = class extends Group {
|
|
|
196
210
|
/** Resolved layers (content + depth), parallel to `children`. */
|
|
197
211
|
layers;
|
|
198
212
|
#shake;
|
|
213
|
+
/** The whole-frame shake spec, if any — read by exporters (render-only, so it is
|
|
214
|
+
* warned + not baked into Lottie keyframes). */
|
|
215
|
+
get shakeSpec() {
|
|
216
|
+
return this.#shake;
|
|
217
|
+
}
|
|
199
218
|
constructor(layers, props = {}) {
|
|
200
219
|
if (!Array.isArray(layers) || layers.length === 0) throw new CameraError("camera(layers, props?): needs at least one layer — pass [{ content }] (a node per depth plane).");
|
|
201
220
|
const resolved = layers.map((l, i) => {
|
|
@@ -265,4 +284,4 @@ function camera(layers, props = {}) {
|
|
|
265
284
|
return new Camera(layers, props);
|
|
266
285
|
}
|
|
267
286
|
//#endregion
|
|
268
|
-
export { Camera, CameraError, FollowPath, LookAt, OrientToPath, camera, followPath, lookAt, motionPath, orientToPath, pathLength, pointAtLength, shake, shakeOffset };
|
|
287
|
+
export { Camera, CameraError, FollowPath, LookAt, OrientToPath, camera, cameraLayerMatrix, followPath, lookAt, motionPath, orientToPath, pathLength, pointAtLength, shake, shakeOffset, shakenSpec };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@glissade/scene",
|
|
3
|
-
"version": "0.55.0-pre.
|
|
3
|
+
"version": "0.55.0-pre.2",
|
|
4
4
|
"description": "glissade scene graph: nodes, transforms, DisplayList emission. Renderer-agnostic; zero DOM/Node dependencies.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"engines": {
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
],
|
|
78
78
|
"dependencies": {
|
|
79
79
|
"yoga-layout": "^3.2.1",
|
|
80
|
-
"@glissade/core": "0.55.0-pre.
|
|
80
|
+
"@glissade/core": "0.55.0-pre.2"
|
|
81
81
|
},
|
|
82
82
|
"repository": {
|
|
83
83
|
"type": "git",
|