@rig-c/play 1.27.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 +3 -2
- package/dist/MeshGlBlitter.d.ts.map +1 -1
- package/dist/_play-runtime.js +68 -11
- package/dist/_play-runtime.js.map +1 -1
- package/dist/composed-take.d.ts +54 -4
- package/dist/composed-take.d.ts.map +1 -1
- package/dist/composed-take.js +685 -55
- package/dist/composed-take.js.map +1 -1
- package/dist/index.js +6 -6
- package/dist/scene-camera.d.ts +28 -0
- package/dist/scene-camera.d.ts.map +1 -0
- package/docs/REFERENCE.md +66 -3
- package/docs/STABILITY.md +26 -1
- package/package.json +3 -1
package/dist/composed-take.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { l as loadModel,
|
|
1
|
+
import { r as readModel, C as CORE_DOCUMENT_SPEC, p as poseRawAnimation, a as CoreInputError, l as loadModel, b as CanvasRenderer, R as RigPlayer, d as discoverTurnDials, n as normalizedDial, u as underNoSkin, c as poseRawSetup, f as frameOf, e as frameSource, g as rememberComposedClip } from "./_play-runtime.js";
|
|
2
2
|
const ORIGIN = { x: 0, y: 0 };
|
|
3
3
|
const GAINS = { background: -0.55, figure: 0, foreground: 0.55 };
|
|
4
4
|
const TIME_CONSTANT = 0.12;
|
|
@@ -87,12 +87,417 @@ function planeOffsets(camera, mode) {
|
|
|
87
87
|
foreground: planeShift(camera, mode === "pan" ? 1 : GAINS.foreground)
|
|
88
88
|
};
|
|
89
89
|
}
|
|
90
|
+
const SCENE_CAMERA_REPORT_MAX_BYTES = 8 * 1024 * 1024;
|
|
91
|
+
const PAN_CURVE_LENGTH = 8;
|
|
92
|
+
const SHA256 = /^[a-f0-9]{64}$/;
|
|
93
|
+
const floatBits = new DataView(new ArrayBuffer(4));
|
|
94
|
+
const typedArrayPrototype = Object.getPrototypeOf(Uint8Array.prototype);
|
|
95
|
+
function isReportBytes(value) {
|
|
96
|
+
return ArrayBuffer.isView(value) && Reflect.get(typedArrayPrototype, Symbol.toStringTag, value) === "Uint8Array";
|
|
97
|
+
}
|
|
98
|
+
function checkSceneCameraReportSize(byteLength, refuse) {
|
|
99
|
+
if (byteLength > SCENE_CAMERA_REPORT_MAX_BYTES) {
|
|
100
|
+
refuse(
|
|
101
|
+
"SCENE_CAMERA_REPORT_TOO_LARGE",
|
|
102
|
+
`observed ${byteLength} raw report bytes with a cap of ${SCENE_CAMERA_REPORT_MAX_BYTES} bytes`
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
function decodeSceneCameraReport(bytes, refuse) {
|
|
107
|
+
const byteLength = Reflect.get(typedArrayPrototype, "byteLength", bytes);
|
|
108
|
+
checkSceneCameraReportSize(byteLength, refuse);
|
|
109
|
+
try {
|
|
110
|
+
const buffer = Reflect.get(typedArrayPrototype, "buffer", bytes);
|
|
111
|
+
const byteOffset = Reflect.get(typedArrayPrototype, "byteOffset", bytes);
|
|
112
|
+
const view = new Uint8Array(buffer, byteOffset, byteLength);
|
|
113
|
+
return JSON.parse(new TextDecoder("utf-8", { fatal: true }).decode(view));
|
|
114
|
+
} catch (error) {
|
|
115
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", "the scene report is not valid UTF-8 JSON", error);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
const isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
119
|
+
const finite = (value) => typeof value === "number" && Number.isFinite(value);
|
|
120
|
+
const durationValue = (value) => finite(value) && value >= 0;
|
|
121
|
+
const positive = (value) => finite(value) && value > 0;
|
|
122
|
+
const usableZoom = (zoom) => positive(zoom) && positive(1 / zoom);
|
|
123
|
+
const isDigest = (value) => typeof value === "string" && SHA256.test(value);
|
|
124
|
+
const matchesSample = (a, b) => a.pan[0] === b.pan[0] && a.pan[1] === b.pan[1] && a.zoom === b.zoom;
|
|
125
|
+
function readCameraHeader(report, refuse) {
|
|
126
|
+
if (isRecord(report) && report.spec === "spine-parts-scene-report/1") return null;
|
|
127
|
+
if (!isRecord(report) || report.spec !== "spine-parts-scene-report/2" || !isRecord(report.camera)) {
|
|
128
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", "expected a scene report /1 or a scene report /2 with a camera record");
|
|
129
|
+
}
|
|
130
|
+
const { canvas, camera } = report;
|
|
131
|
+
const { backdrop, fps, coverage, tracks, model_sha256: digest } = camera;
|
|
132
|
+
if (typeof backdrop !== "string" || !backdrop.length || fps !== 12 || !isRecord(tracks) || Object.keys(tracks).length === 0 || !isRecord(coverage) || coverage.status !== "PASS" || coverage.max_edge_overrun_px !== 0 || coverage.nonopaque_source_texels !== 0 || coverage.nonopaque_output_pixels !== 0 || !isRecord(canvas) || !positive(canvas.width) || !positive(canvas.height)) {
|
|
133
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", "expected a canvas and a keyed 12 fps camera with PASS coverage and zero overruns and alpha counts");
|
|
134
|
+
}
|
|
135
|
+
return { width: canvas.width, height: canvas.height, backdrop, fps, tracks, digest };
|
|
136
|
+
}
|
|
137
|
+
function requireDigest(digest, refuse) {
|
|
138
|
+
if (digest === void 0 || digest === null) {
|
|
139
|
+
return refuse("SCENE_CAMERA_MODEL_MISMATCH", "the scene camera report needs a model SHA-256");
|
|
140
|
+
}
|
|
141
|
+
if (!isDigest(digest)) return refuse("SCENE_CAMERA_REPORT_INVALID", "the model SHA-256 must be 64 lowercase hexadecimal digits");
|
|
142
|
+
return digest;
|
|
143
|
+
}
|
|
144
|
+
function sceneCameraModelDigest(report, refuse) {
|
|
145
|
+
const camera = readCameraHeader(report, refuse);
|
|
146
|
+
return camera === null ? null : requireDigest(camera.digest, refuse);
|
|
147
|
+
}
|
|
148
|
+
function finiteTuple(value, length) {
|
|
149
|
+
return Array.isArray(value) && value.length === length && [...value].every(finite);
|
|
150
|
+
}
|
|
151
|
+
function sceneCameraDriftEvidence(report, refuse) {
|
|
152
|
+
const camera = readCameraHeader(report, refuse);
|
|
153
|
+
if (!camera) return null;
|
|
154
|
+
const { backdrop, width, height, fps, tracks } = camera;
|
|
155
|
+
return {
|
|
156
|
+
backdrop,
|
|
157
|
+
failure(animation, pointer, sweep, backingPixel) {
|
|
158
|
+
const track = tracks[animation];
|
|
159
|
+
if (!isRecord(track) || !durationValue(track.duration) || !durationValue(track.compiled_duration) || !Array.isArray(track.frames)) return "missing sampled backdrop geometry";
|
|
160
|
+
const { duration, compiled_duration: compiled, frames } = track;
|
|
161
|
+
const ticks = Math.ceil(duration * fps);
|
|
162
|
+
const terminal = ticks > 0 && (ticks - 1) / fps >= duration ? ticks - 1 : ticks;
|
|
163
|
+
if (ticks >= 4294967295 || frames.length !== terminal + 1) {
|
|
164
|
+
return `incomplete sampled backdrop geometry at ${fps} fps through ${duration} s`;
|
|
165
|
+
}
|
|
166
|
+
for (const [i, row] of frames.entries()) {
|
|
167
|
+
const at = i === terminal ? duration : i / fps;
|
|
168
|
+
const label = `sample ${i} at ${at} authored s`;
|
|
169
|
+
if (!isRecord(row) || row.frame !== i || row.authored_time !== at || row.compiled_time !== (i === terminal ? compiled : at / duration * compiled) || !usableZoom(row.zoom) || !finiteTuple(row.view, 4) || !Array.isArray(row.backdrop_quad) || row.backdrop_quad.length !== 4 || ![...row.backdrop_quad].every((point) => finiteTuple(point, 2))) {
|
|
170
|
+
return `${label} has invalid backdrop evidence`;
|
|
171
|
+
}
|
|
172
|
+
const { zoom, view: [left, top, right, bottom], backdrop_quad: quad } = row;
|
|
173
|
+
const viewWidth = right - left, viewHeight = bottom - top;
|
|
174
|
+
const tolerance = 4 * Number.EPSILON * Math.max(1, Math.abs(left), Math.abs(top), Math.abs(right), Math.abs(bottom));
|
|
175
|
+
if (!positive(viewWidth) || !positive(viewHeight) || Math.abs(viewWidth - width / zoom) > tolerance || Math.abs(viewHeight - height / zoom) > tolerance) {
|
|
176
|
+
return `${label} has a view inconsistent with its output size and zoom`;
|
|
177
|
+
}
|
|
178
|
+
const px = pointer.x / zoom, py = pointer.y / zoom;
|
|
179
|
+
const sx = sweep.x / zoom, sy = sweep.y / zoom;
|
|
180
|
+
if (![px, py, sx, sy].every(finite)) return `${label} has a nonfinite scene excursion`;
|
|
181
|
+
const gx = backingPixel.x / zoom, gy = backingPixel.y / zoom;
|
|
182
|
+
if (!positive(gx) || !positive(gy)) return `${label} has an invalid backing-pixel edge guard`;
|
|
183
|
+
const edgeTolerance2 = Math.max(tolerance, 4 * Number.EPSILON * Math.max(...quad.flat().map(Math.abs)));
|
|
184
|
+
let winding = 0;
|
|
185
|
+
for (const [edge, [x, y]] of quad.entries()) {
|
|
186
|
+
const [nextX, nextY] = quad[(edge + 1) % 4];
|
|
187
|
+
const dx = nextX - x, dy = nextY - y;
|
|
188
|
+
const length = Math.hypot(dx, dy);
|
|
189
|
+
const nx = -dy / length, ny = dx / length;
|
|
190
|
+
const distance = ([a2, b2]) => nx * (a2 - x) + ny * (b2 - y);
|
|
191
|
+
const a = distance(quad[(edge + 2) % 4]), b = distance(quad[(edge + 3) % 4]);
|
|
192
|
+
if (edge === 0) winding = Math.sign(a);
|
|
193
|
+
const side = ["left", "top", "right", "bottom"][edge];
|
|
194
|
+
if (!positive(length) || !finite(a) || !finite(b) || !(a * winding > 0 && b * winding > 0)) {
|
|
195
|
+
return `${label} has an invalid convex backdrop quad at its ${side} edge`;
|
|
196
|
+
}
|
|
197
|
+
const margin = winding * distance([nx * winding >= 0 ? left : right, ny * winding >= 0 ? top : bottom]);
|
|
198
|
+
const excursion = Math.max(Math.abs(nx * px) + Math.abs(ny * py), Math.abs(nx * sx + ny * sy));
|
|
199
|
+
if (!finite(margin) || !finite(excursion)) return `${label} has nonfinite ${side} edge margin or excursion`;
|
|
200
|
+
const guard = Math.abs(nx) * gx + Math.abs(ny) * gy;
|
|
201
|
+
const requiredExcursion = excursion + guard;
|
|
202
|
+
if (!positive(guard) || !finite(requiredExcursion)) return `${label} has an invalid ${side} edge guard or guarded excursion`;
|
|
203
|
+
if (margin - requiredExcursion < -edgeTolerance2) {
|
|
204
|
+
return `${label}, ${side} edge margin ${margin} scene px, required excursion ${excursion} scene px, edge guard ${guard} scene px`;
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
return void 0;
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
function storedFloat32(value) {
|
|
213
|
+
const rounded = Math.fround(value);
|
|
214
|
+
if (rounded === 0 || !Number.isFinite(rounded)) return rounded === 0 ? 0 : rounded;
|
|
215
|
+
const magnitude = Math.abs(rounded);
|
|
216
|
+
const sign = rounded < 0 ? "-" : "";
|
|
217
|
+
floatBits.setFloat32(0, magnitude);
|
|
218
|
+
const word = floatBits.getUint32(0);
|
|
219
|
+
const exponent = word >>> 23;
|
|
220
|
+
const significand = BigInt(word & 8388607 | (exponent === 0 ? 0 : 8388608));
|
|
221
|
+
const doubledPower = (exponent === 0 ? -149 : exponent - 150) + 1;
|
|
222
|
+
for (let digits = 1; digits <= 9; digits++) {
|
|
223
|
+
const [mantissa, power] = magnitude.toExponential(digits - 1).split("e");
|
|
224
|
+
const nearest = BigInt(mantissa.replace(".", ""));
|
|
225
|
+
const scale = Number(power) - (digits - 1);
|
|
226
|
+
const candidates = [nearest - 1n, nearest, nearest + 1n].filter(
|
|
227
|
+
(candidate) => candidate > 0n && Math.fround(Number(`${candidate}e${scale}`)) === magnitude
|
|
228
|
+
);
|
|
229
|
+
if (candidates.length === 0) continue;
|
|
230
|
+
const chosen = candidates.reduce((a, b) => {
|
|
231
|
+
let midpoint = a + b;
|
|
232
|
+
let float = significand;
|
|
233
|
+
if (scale >= 0) midpoint *= 10n ** BigInt(scale);
|
|
234
|
+
else float *= 10n ** BigInt(-scale);
|
|
235
|
+
if (doubledPower >= 0) float <<= BigInt(doubledPower);
|
|
236
|
+
else midpoint <<= BigInt(-doubledPower);
|
|
237
|
+
return midpoint < float || midpoint === float && b % 2n === 0n ? b : a;
|
|
238
|
+
});
|
|
239
|
+
return Number(`${sign}${chosen}e${scale}`);
|
|
240
|
+
}
|
|
241
|
+
return rounded;
|
|
242
|
+
}
|
|
243
|
+
function storedTime(time) {
|
|
244
|
+
const named = storedFloat32(time);
|
|
245
|
+
const nearest = Math.fround(time);
|
|
246
|
+
if (named === time || nearest <= time || !Number.isFinite(nearest)) return named;
|
|
247
|
+
floatBits.setFloat32(0, nearest);
|
|
248
|
+
floatBits.setUint32(0, floatBits.getUint32(0) - 1);
|
|
249
|
+
return storedFloat32(floatBits.getFloat32(0));
|
|
250
|
+
}
|
|
251
|
+
function coreSampler(keys, duration, label, refuse) {
|
|
252
|
+
const times = keys.map((key) => storedTime(key.t));
|
|
253
|
+
for (const [i, key] of keys.entries()) {
|
|
254
|
+
if (!Number.isFinite(times[i]) || i > 0 && times[i] <= times[i - 1] || !key.pan.every((value) => Number.isFinite(Math.fround(value))) || !positive(Math.fround(1 / key.zoom))) {
|
|
255
|
+
refuse("SCENE_CAMERA_REPORT_INVALID", `${label} key ${i} cannot be stored in a float32 translation timeline`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const name = "camera";
|
|
259
|
+
try {
|
|
260
|
+
const doc = readModel(JSON.stringify({
|
|
261
|
+
spec: CORE_DOCUMENT_SPEC,
|
|
262
|
+
referenceScale: 1,
|
|
263
|
+
stage: null,
|
|
264
|
+
bones: [{ name: "pan" }, { name: "span" }],
|
|
265
|
+
slots: [],
|
|
266
|
+
skins: [],
|
|
267
|
+
constraints: [],
|
|
268
|
+
events: [],
|
|
269
|
+
animations: [{
|
|
270
|
+
name,
|
|
271
|
+
duration,
|
|
272
|
+
slots: [],
|
|
273
|
+
constraints: { ik: [], transform: [], path: [], physics: [], slider: [] },
|
|
274
|
+
attachments: [],
|
|
275
|
+
drawOrder: [],
|
|
276
|
+
events: [],
|
|
277
|
+
bones: [
|
|
278
|
+
{ name: "pan", timelines: [{ name: "translate", keys: keys.map((key, i) => ({
|
|
279
|
+
time: times[i],
|
|
280
|
+
x: storedFloat32(key.pan[0]),
|
|
281
|
+
y: storedFloat32(key.pan[1]),
|
|
282
|
+
curve: Array.isArray(key.curve) ? key.curve.slice(0, PAN_CURVE_LENGTH) : key.curve
|
|
283
|
+
})) }] },
|
|
284
|
+
{ name: "span", timelines: [{ name: "translatex", keys: keys.map((key, i) => ({
|
|
285
|
+
time: times[i],
|
|
286
|
+
value: storedFloat32(1 / key.zoom),
|
|
287
|
+
curve: Array.isArray(key.curve) ? key.curve.slice(PAN_CURVE_LENGTH) : key.curve
|
|
288
|
+
})) }] }
|
|
289
|
+
]
|
|
290
|
+
}],
|
|
291
|
+
editorOrder: { skins: [], animations: [name] },
|
|
292
|
+
images: [],
|
|
293
|
+
pageGrids: [],
|
|
294
|
+
droppedStates: [],
|
|
295
|
+
absentParts: [],
|
|
296
|
+
meshBones: [],
|
|
297
|
+
meshes: [],
|
|
298
|
+
physics: [],
|
|
299
|
+
deformTransforms: [],
|
|
300
|
+
trackDerivations: [],
|
|
301
|
+
rig: {},
|
|
302
|
+
pages: [],
|
|
303
|
+
spine: { sha256: "0".repeat(64) }
|
|
304
|
+
}), label);
|
|
305
|
+
return (time) => {
|
|
306
|
+
try {
|
|
307
|
+
const [pan, span] = poseRawAnimation(doc, name, time === 0 ? [] : [time]).at(-1).bones;
|
|
308
|
+
const zoom = 1 / span.worldX;
|
|
309
|
+
if (!finite(pan.worldX) || !finite(pan.worldY) || !usableZoom(zoom)) {
|
|
310
|
+
return refuse("SCENE_CAMERA_VIEW_INVALID", `${label} evaluates at ${time} s to nonfinite pan or unusable zoom`);
|
|
311
|
+
}
|
|
312
|
+
return { pan: [pan.worldX, pan.worldY], zoom };
|
|
313
|
+
} catch (error) {
|
|
314
|
+
if (!(error instanceof CoreInputError)) throw error;
|
|
315
|
+
return refuse("SCENE_CAMERA_VIEW_INVALID", `${label} cannot be evaluated at ${time} s`, error);
|
|
316
|
+
}
|
|
317
|
+
};
|
|
318
|
+
} catch (error) {
|
|
319
|
+
if (!(error instanceof CoreInputError)) throw error;
|
|
320
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", `${label} cannot be read as a Core timeline`, error);
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
function validViewport(view) {
|
|
324
|
+
return isRecord(view) && finite(view.x) && finite(view.y) && positive(view.width) && positive(view.height) && finite(view.x + view.width) && view.x + view.width > view.x && finite(view.y + view.height) && view.y + view.height > view.y;
|
|
325
|
+
}
|
|
326
|
+
function cameraView(stage, { pan, zoom }, label, refuse) {
|
|
327
|
+
const centerX = stage.x + stage.width / 2 + pan[0];
|
|
328
|
+
const centerY = stage.y + (stage.height - (stage.height / 2 + pan[1]));
|
|
329
|
+
const halfWidth = stage.width / zoom / 2;
|
|
330
|
+
const halfHeight = stage.height / zoom / 2;
|
|
331
|
+
const x = centerX - halfWidth;
|
|
332
|
+
const y = centerY - halfHeight;
|
|
333
|
+
const width = centerX + halfWidth - x;
|
|
334
|
+
const height = centerY + halfHeight - y;
|
|
335
|
+
const view = { x, y, width, height };
|
|
336
|
+
if (!usableZoom(zoom) || !validViewport(view) || !positive(width * zoom) || !positive(height * zoom)) {
|
|
337
|
+
refuse("SCENE_CAMERA_VIEW_INVALID", `${label} needs a finite, positive, noncollapsed camera view`);
|
|
338
|
+
}
|
|
339
|
+
return view;
|
|
340
|
+
}
|
|
341
|
+
function readTrack(raw, compiled, stage, label, refuse) {
|
|
342
|
+
if (!isRecord(raw) || !durationValue(raw.duration) || !durationValue(raw.compiled_duration) || typeof raw.loop !== "boolean" || !Array.isArray(raw.keys) || raw.keys.length === 0 || !Array.isArray(raw.frames)) {
|
|
343
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", `${label} needs keys, durations, a loop flag and a frames list`);
|
|
344
|
+
}
|
|
345
|
+
const { duration, loop } = raw;
|
|
346
|
+
if (raw.compiled_duration !== compiled || duration === 0 !== (compiled === 0)) {
|
|
347
|
+
refuse("SCENE_CAMERA_CLIP_MISMATCH", `${label} cannot map ${duration} authored s and ${raw.compiled_duration} reported compiled s to ${compiled} model s`);
|
|
348
|
+
}
|
|
349
|
+
const keys = [];
|
|
350
|
+
for (const [i, key] of raw.keys.entries()) {
|
|
351
|
+
const at = `${label} key ${i}`;
|
|
352
|
+
if (!isRecord(key) || Object.keys(key).some((field) => !["t", "pan", "zoom", "curve"].includes(field))) {
|
|
353
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", `${at} needs normalized t, pan, zoom and an optional outgoing curve`);
|
|
354
|
+
}
|
|
355
|
+
const { t, pan, zoom, curve } = key;
|
|
356
|
+
if (!finite(t) || (i === 0 ? t !== 0 : t <= keys[i - 1].t) || !Array.isArray(pan) || pan.length !== 2 || !finite(pan[0]) || !finite(pan[1]) || !usableZoom(zoom)) {
|
|
357
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", `${at} needs ordered finite seconds from zero, finite pan and positive zoom`);
|
|
358
|
+
}
|
|
359
|
+
if (curve !== void 0) {
|
|
360
|
+
const validCurve = curve === "stepped" || Array.isArray(curve) && curve.length === 12 && [...curve].every(
|
|
361
|
+
(value) => finite(value) && Number.isFinite(Math.fround(value)) && storedFloat32(value) === value
|
|
362
|
+
);
|
|
363
|
+
if (!validCurve || i === raw.keys.length - 1) {
|
|
364
|
+
return refuse("SCENE_CAMERA_REPORT_INVALID", `${at} needs a nonterminal outgoing curve (stepped or twelve float32 decimals)`);
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
const normalized = { t, pan: [pan[0], pan[1]], zoom, curve: Array.isArray(curve) ? [...curve] : curve };
|
|
368
|
+
cameraView(stage, normalized, at, refuse);
|
|
369
|
+
keys.push(normalized);
|
|
370
|
+
}
|
|
371
|
+
const first = keys[0], last = keys[keys.length - 1];
|
|
372
|
+
if (last.t !== duration || loop && !matchesSample(first, last)) {
|
|
373
|
+
refuse("SCENE_CAMERA_REPORT_INVALID", `${label} must end at its authored duration and close exactly when looped`);
|
|
374
|
+
}
|
|
375
|
+
const core = keys.some((key) => key.curve !== void 0) ? coreSampler(keys, duration, label, refuse) : void 0;
|
|
376
|
+
const start = core?.(0), end = core?.(Math.fround(storedTime(duration)));
|
|
377
|
+
if (start && end && loop && !matchesSample(start, end)) {
|
|
378
|
+
refuse("SCENE_CAMERA_REPORT_INVALID", `${label} must close exactly at the Core-evaluated loop endpoints`);
|
|
379
|
+
}
|
|
380
|
+
const easedStart = first.curve !== void 0;
|
|
381
|
+
const easedEnd = keys.at(-2)?.curve !== void 0;
|
|
382
|
+
const easedSeam = loop && (easedStart || easedEnd);
|
|
383
|
+
if (start && (easedSeam || easedStart)) cameraView(stage, start, label, refuse);
|
|
384
|
+
if (end && (easedSeam || easedEnd)) cameraView(stage, end, label, refuse);
|
|
385
|
+
return {
|
|
386
|
+
duration,
|
|
387
|
+
compiledDuration: compiled,
|
|
388
|
+
loop,
|
|
389
|
+
sample(time) {
|
|
390
|
+
if (time === 0 && (easedSeam || easedStart) && start) return start;
|
|
391
|
+
if (time === duration && (easedSeam || easedEnd) && end) return end;
|
|
392
|
+
let low = 0, high = keys.length - 1;
|
|
393
|
+
while (low < high) {
|
|
394
|
+
const mid = Math.ceil((low + high) / 2);
|
|
395
|
+
if (keys[mid].t <= time) low = mid;
|
|
396
|
+
else high = mid - 1;
|
|
397
|
+
}
|
|
398
|
+
const from = keys[low], to = keys[low + 1];
|
|
399
|
+
if (from.curve !== void 0 && core) return core(time);
|
|
400
|
+
if (time === from.t || to === void 0) return from;
|
|
401
|
+
const phase = (time - from.t) / (to.t - from.t);
|
|
402
|
+
const mix = (a, b) => a + (b - a) * phase;
|
|
403
|
+
return { pan: [mix(from.pan[0], to.pan[0]), mix(from.pan[1], to.pan[1])], zoom: 1 / mix(1 / from.zoom, 1 / to.zoom) };
|
|
404
|
+
}
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
function cameraTimes(track, clock, refuse) {
|
|
408
|
+
const { duration, compiledDuration, loop } = track;
|
|
409
|
+
if (isRecord(clock) && clock.endpoint === "terminal" && !("basis" in clock) && !("seconds" in clock)) {
|
|
410
|
+
return { authoredSeconds: duration, compiledSeconds: compiledDuration };
|
|
411
|
+
}
|
|
412
|
+
if (!isRecord(clock) || clock.endpoint !== void 0 && clock.endpoint !== "phase" || clock.basis !== "authored" && clock.basis !== "compiled" || !durationValue(clock.seconds)) {
|
|
413
|
+
return refuse("SCENE_CAMERA_CLOCK_INVALID", "expected terminal or finite nonnegative phase seconds on the authored or compiled clock");
|
|
414
|
+
}
|
|
415
|
+
const authored = clock.basis === "authored";
|
|
416
|
+
const limit = authored ? duration : compiledDuration;
|
|
417
|
+
const otherLimit = authored ? compiledDuration : duration;
|
|
418
|
+
const time = limit === 0 || clock.seconds === 0 ? 0 : loop ? clock.seconds % limit : Math.min(clock.seconds, limit);
|
|
419
|
+
const otherTime = time === limit ? otherLimit : time / limit * otherLimit;
|
|
420
|
+
return authored ? { authoredSeconds: time, compiledSeconds: otherTime } : { authoredSeconds: otherTime, compiledSeconds: time };
|
|
421
|
+
}
|
|
422
|
+
function bindSceneCameraReport(report, model, refuse) {
|
|
423
|
+
const document = isReportBytes(report) ? decodeSceneCameraReport(report, refuse) : report;
|
|
424
|
+
const camera = readCameraHeader(document, refuse);
|
|
425
|
+
if (camera === null) return null;
|
|
426
|
+
if (!validViewport(model?.stage)) return refuse("SCENE_CAMERA_VIEW_INVALID", "the model needs a finite, positive, noncollapsed stage");
|
|
427
|
+
if (model.sha256 !== requireDigest(camera.digest, refuse)) {
|
|
428
|
+
refuse("SCENE_CAMERA_MODEL_MISMATCH", "the scene camera SHA-256 does not match the consumed model");
|
|
429
|
+
}
|
|
430
|
+
const { x, y, width, height } = model.stage;
|
|
431
|
+
const stage = { x, y, width, height };
|
|
432
|
+
if (camera.width !== stage.width || camera.height !== stage.height) {
|
|
433
|
+
refuse("SCENE_CAMERA_MODEL_MISMATCH", "the report canvas dimensions must match the model stage");
|
|
434
|
+
}
|
|
435
|
+
const durations = /* @__PURE__ */ new Map();
|
|
436
|
+
if (!Array.isArray(model.animations)) refuse("SCENE_CAMERA_CLIP_MISMATCH", "the model needs an animation list");
|
|
437
|
+
for (const animation of model.animations) {
|
|
438
|
+
if (!isRecord(animation) || typeof animation.name !== "string" || !animation.name.length || durations.has(animation.name) || !durationValue(animation.duration)) {
|
|
439
|
+
refuse("SCENE_CAMERA_CLIP_MISMATCH", "the model needs unique animation names with finite nonnegative durations");
|
|
440
|
+
}
|
|
441
|
+
durations.set(animation.name, animation.duration);
|
|
442
|
+
}
|
|
443
|
+
const bound = /* @__PURE__ */ new Map();
|
|
444
|
+
for (const [animation, raw] of Object.entries(camera.tracks)) {
|
|
445
|
+
const label = `scene camera track ${JSON.stringify(animation)}`;
|
|
446
|
+
const duration = durations.get(animation);
|
|
447
|
+
if (duration === void 0) return refuse("SCENE_CAMERA_CLIP_MISMATCH", `${label} is absent from the model`);
|
|
448
|
+
bound.set(animation, readTrack(raw, duration, stage, label, refuse));
|
|
449
|
+
}
|
|
450
|
+
const output = Object.freeze({ width: stage.width, height: stage.height });
|
|
451
|
+
return Object.freeze({
|
|
452
|
+
sample(animation, clock) {
|
|
453
|
+
if (!durations.has(animation)) refuse("SCENE_CAMERA_CLIP_MISMATCH", `unknown model animation ${JSON.stringify(animation)}`);
|
|
454
|
+
const track = bound.get(animation);
|
|
455
|
+
if (!track) return null;
|
|
456
|
+
const times = cameraTimes(track, clock, refuse);
|
|
457
|
+
const { pan, zoom } = track.sample(times.authoredSeconds);
|
|
458
|
+
const viewWorld = cameraView(stage, { pan, zoom }, `scene camera track ${JSON.stringify(animation)} at ${times.authoredSeconds} s`, refuse);
|
|
459
|
+
return Object.freeze({
|
|
460
|
+
animation,
|
|
461
|
+
...times,
|
|
462
|
+
pan: Object.freeze([pan[0], pan[1]]),
|
|
463
|
+
zoom,
|
|
464
|
+
viewWorld: Object.freeze(viewWorld),
|
|
465
|
+
output,
|
|
466
|
+
loop: track.loop
|
|
467
|
+
});
|
|
468
|
+
}
|
|
469
|
+
});
|
|
470
|
+
}
|
|
471
|
+
function sceneCameraTransform(frame, refuse) {
|
|
472
|
+
if (!frame || !validViewport(frame.viewWorld) || !usableZoom(frame.zoom) || !frame.output || !positive(frame.output.width) || !positive(frame.output.height) || !positive(frame.viewWorld.width * frame.zoom) || !positive(frame.viewWorld.height * frame.zoom)) {
|
|
473
|
+
return refuse("SCENE_CAMERA_VIEW_INVALID", "expected finite authored output dimensions and a positive, noncollapsed camera view");
|
|
474
|
+
}
|
|
475
|
+
const { viewWorld, zoom, output } = frame;
|
|
476
|
+
return { origin: { x: viewWorld.x, y: viewWorld.y + viewWorld.height }, zoom, width: output.width, height: output.height };
|
|
477
|
+
}
|
|
478
|
+
function projectSceneCamera(frame, refuse) {
|
|
479
|
+
const { origin, zoom, width, height } = sceneCameraTransform(frame, refuse);
|
|
480
|
+
return {
|
|
481
|
+
worldToOutput: ({ x, y }) => ({ x: (x - origin.x) * zoom, y: (origin.y - y) * zoom }),
|
|
482
|
+
outputToWorld: ({ x, y }) => ({ x: origin.x + x / zoom, y: origin.y - y / zoom }),
|
|
483
|
+
outputClip: { x: 0, y: 0, width, height }
|
|
484
|
+
};
|
|
485
|
+
}
|
|
90
486
|
class ComposedTakeError extends Error {
|
|
91
487
|
constructor(code, detail, cause) {
|
|
92
488
|
super(`${code}: ${detail}`, { cause });
|
|
93
489
|
this.code = code;
|
|
94
490
|
}
|
|
95
491
|
}
|
|
492
|
+
function refuseSceneCamera(code, detail, cause) {
|
|
493
|
+
throw new ComposedTakeError(code, detail, cause);
|
|
494
|
+
}
|
|
495
|
+
function bindSceneCamera(report, model) {
|
|
496
|
+
return bindSceneCameraReport(report, model, refuseSceneCamera);
|
|
497
|
+
}
|
|
498
|
+
function sceneCameraProjection(frame) {
|
|
499
|
+
return projectSceneCamera(frame, refuseSceneCamera);
|
|
500
|
+
}
|
|
96
501
|
const NEUTRAL = { x: 0, y: 0 };
|
|
97
502
|
const PLANES = ["background", "figure", "foreground"];
|
|
98
503
|
const DEFAULT_TRANSITION_MS = 120;
|
|
@@ -153,7 +558,7 @@ function bindSlots(assets, options) {
|
|
|
153
558
|
}
|
|
154
559
|
return planes;
|
|
155
560
|
}
|
|
156
|
-
function checkFrame(frame, planes, backdropPlane = "background") {
|
|
561
|
+
function checkFrame(frame, planes, backdropPlane = "background", allowSharedClip = false) {
|
|
157
562
|
const seen = /* @__PURE__ */ new Set();
|
|
158
563
|
const clipPlanes = /* @__PURE__ */ new Map();
|
|
159
564
|
const backdrop = [];
|
|
@@ -163,7 +568,7 @@ function checkFrame(frame, planes, backdropPlane = "background") {
|
|
|
163
568
|
throw new ComposedTakeError("COMPOSED_SLOT_PARTITION", `unbound or repeated posed slot ${JSON.stringify(slot.slot)}`);
|
|
164
569
|
}
|
|
165
570
|
seen.add(slot.slot);
|
|
166
|
-
if (slot.clip) {
|
|
571
|
+
if (slot.clip && !allowSharedClip) {
|
|
167
572
|
const owner = clipPlanes.get(slot.clip);
|
|
168
573
|
if (owner !== void 0 && owner !== plane) {
|
|
169
574
|
throw new ComposedTakeError("COMPOSED_CROSS_PLANE_CLIP", `one clip covers ${owner} and ${plane} at ${JSON.stringify(slot.slot)}`);
|
|
@@ -177,12 +582,12 @@ function checkFrame(frame, planes, backdropPlane = "background") {
|
|
|
177
582
|
function trackError(id, detail) {
|
|
178
583
|
return new ComposedTakeError("COMPOSED_PLATE_TRACK", `plane ${JSON.stringify(id)} ${detail}`);
|
|
179
584
|
}
|
|
180
|
-
function namedPlanes(assets, options) {
|
|
585
|
+
function namedPlanes(assets, options, animationName = options.animation) {
|
|
181
586
|
if (!options.planes) return void 0;
|
|
182
587
|
const read = assets.document;
|
|
183
588
|
const doc = underNoSkin(read.doc);
|
|
184
589
|
const skin = doc.skins.find((skin2) => skin2.name === "default");
|
|
185
|
-
const animation = doc.animations.find((animation2) => animation2.name ===
|
|
590
|
+
const animation = doc.animations.find((animation2) => animation2.name === animationName);
|
|
186
591
|
const setup = poseRawSetup(doc);
|
|
187
592
|
const setupFrame = frameOf(frameSource(doc, read.parsed), setup);
|
|
188
593
|
const bones = new Map(doc.bones.map((bone) => [bone.name, bone]));
|
|
@@ -294,9 +699,15 @@ function transformFrame(frame, shiftFor, { origin = NEUTRAL, scale = { x: 1, y:
|
|
|
294
699
|
const transform = (xy, delta = shift) => xy.map((value, i) => i % 2 === 0 ? (value + delta.x - origin.x) * scale.x : (value - delta.y - origin.y) * scale.y);
|
|
295
700
|
let clip = slot.clip;
|
|
296
701
|
if (clip) {
|
|
297
|
-
const
|
|
298
|
-
|
|
299
|
-
clip =
|
|
702
|
+
const variants = clips.get(clip) ?? [];
|
|
703
|
+
const existing = variants.find((entry) => entry.shift.x === shift.x && entry.shift.y === shift.y);
|
|
704
|
+
if (existing) clip = existing.clip;
|
|
705
|
+
else {
|
|
706
|
+
const source2 = clip;
|
|
707
|
+
clip = { ...source2, polygon: transform(source2.polygon) };
|
|
708
|
+
variants.push({ shift, clip });
|
|
709
|
+
clips.set(source2, variants);
|
|
710
|
+
}
|
|
300
711
|
}
|
|
301
712
|
const positioned = slot.kind === "mesh" ? { ...slot, clip, vertices: transform(slot.vertices) } : { ...slot, clip, corners: setup ? native ? setup.corners : transform(setup.corners, NEUTRAL) : transform(slot.corners) };
|
|
302
713
|
if (!clipInStockSpace || !slot.clip) return positioned;
|
|
@@ -304,6 +715,31 @@ function transformFrame(frame, shiftFor, { origin = NEUTRAL, scale = { x: 1, y:
|
|
|
304
715
|
return rememberComposedClip(positioned, source, shift, origin, scale);
|
|
305
716
|
}) };
|
|
306
717
|
}
|
|
718
|
+
function drawSceneCamera(renderer, pose, frame, backing, shiftFor = () => NEUTRAL) {
|
|
719
|
+
const { origin, zoom, width, height } = sceneCameraTransform(frame, refuseSceneCamera);
|
|
720
|
+
const pixels = backing === void 0 ? { width: Math.ceil(width), height: Math.ceil(height) } : backing;
|
|
721
|
+
const backingDimension = (value) => Number.isInteger(value) && value > 0 && value <= 4294967295;
|
|
722
|
+
if (!pixels || !backingDimension(pixels.width) || !backingDimension(pixels.height)) {
|
|
723
|
+
refuseSceneCamera("SCENE_CAMERA_VIEW_INVALID", "the backing needs positive integer canvas dimensions");
|
|
724
|
+
}
|
|
725
|
+
const scale = { x: zoom * (pixels.width / width), y: zoom * (pixels.height / height) };
|
|
726
|
+
if (!Object.values(scale).every((value) => Number.isFinite(value) && value > 0)) {
|
|
727
|
+
refuseSceneCamera("SCENE_CAMERA_VIEW_INVALID", "the view cannot be projected into this backing");
|
|
728
|
+
}
|
|
729
|
+
const projected = transformFrame(pose, shiftFor, { origin, scale, clipInStockSpace: true });
|
|
730
|
+
const { viewport, pixelRatio } = renderer;
|
|
731
|
+
try {
|
|
732
|
+
renderer.viewport = { x: 0, y: -pixels.height, width: pixels.width, height: pixels.height };
|
|
733
|
+
renderer.pixelRatio = 1;
|
|
734
|
+
renderer.render(projected);
|
|
735
|
+
} finally {
|
|
736
|
+
renderer.viewport = viewport;
|
|
737
|
+
renderer.pixelRatio = pixelRatio;
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
function renderSceneCameraFrame(renderer, pose, frame, backing) {
|
|
741
|
+
drawSceneCamera(renderer, pose, frame, backing);
|
|
742
|
+
}
|
|
307
743
|
const stageTop = (stage) => stage.y + stage.height;
|
|
308
744
|
const edgeTolerance = (a, b) => Math.max(Math.abs(a), Math.abs(b), 1) * 2 ** -23;
|
|
309
745
|
function requireStage(stage) {
|
|
@@ -491,10 +927,82 @@ function checkPlateEnvelopes(stage, layout, mode, excursion, plates, gains, swee
|
|
|
491
927
|
if (uncovered.length) throw fail(`uncovered geometric edges ${uncovered.join(", ")}`);
|
|
492
928
|
}
|
|
493
929
|
}
|
|
930
|
+
async function fetchSceneReport(url) {
|
|
931
|
+
if (typeof url !== "string" || !url.trim()) {
|
|
932
|
+
return refuseSceneCamera("SCENE_CAMERA_REPORT_INVALID", "expected a scene report URL");
|
|
933
|
+
}
|
|
934
|
+
try {
|
|
935
|
+
const response = await fetch(url);
|
|
936
|
+
if (!response.ok) throw new Error(`HTTP ${response.status}`);
|
|
937
|
+
if (!response.body) throw new Error("missing response body");
|
|
938
|
+
const reader = response.body.getReader();
|
|
939
|
+
let bytes = new Uint8Array(0);
|
|
940
|
+
let total = 0;
|
|
941
|
+
try {
|
|
942
|
+
for (; ; ) {
|
|
943
|
+
const { value, done } = await reader.read();
|
|
944
|
+
if (done) break;
|
|
945
|
+
const observed = total + value.byteLength;
|
|
946
|
+
checkSceneCameraReportSize(observed, refuseSceneCamera);
|
|
947
|
+
if (observed > bytes.length) {
|
|
948
|
+
const capacity = Math.min(SCENE_CAMERA_REPORT_MAX_BYTES, Math.max(observed, bytes.length * 2, 4096));
|
|
949
|
+
const grown = new Uint8Array(capacity);
|
|
950
|
+
grown.set(bytes.subarray(0, total));
|
|
951
|
+
bytes = grown;
|
|
952
|
+
}
|
|
953
|
+
bytes.set(value, total);
|
|
954
|
+
total = observed;
|
|
955
|
+
}
|
|
956
|
+
} catch (error) {
|
|
957
|
+
void reader.cancel().catch(() => {
|
|
958
|
+
});
|
|
959
|
+
throw error;
|
|
960
|
+
} finally {
|
|
961
|
+
reader.releaseLock();
|
|
962
|
+
}
|
|
963
|
+
return decodeSceneCameraReport(bytes.subarray(0, total), refuseSceneCamera);
|
|
964
|
+
} catch (error) {
|
|
965
|
+
if (error instanceof ComposedTakeError) throw error;
|
|
966
|
+
return refuseSceneCamera("SCENE_CAMERA_REPORT_INVALID", `could not read the scene report at ${url}`, error);
|
|
967
|
+
}
|
|
968
|
+
}
|
|
969
|
+
async function hashModelResponse(response) {
|
|
970
|
+
const subtle = globalThis.crypto?.subtle;
|
|
971
|
+
if (typeof subtle?.digest !== "function") {
|
|
972
|
+
return refuseSceneCamera(
|
|
973
|
+
"SCENE_CAMERA_MODEL_MISMATCH",
|
|
974
|
+
"could not compute SHA-256 for the exact model response bytes because Web Crypto subtle.digest is unavailable (browsers require a secure context)"
|
|
975
|
+
);
|
|
976
|
+
}
|
|
977
|
+
try {
|
|
978
|
+
const bytes = await response.clone().arrayBuffer();
|
|
979
|
+
const digest = await subtle.digest("SHA-256", bytes);
|
|
980
|
+
return Array.from(new Uint8Array(digest), (byte) => byte.toString(16).padStart(2, "0")).join("");
|
|
981
|
+
} catch (error) {
|
|
982
|
+
return refuseSceneCamera("SCENE_CAMERA_MODEL_MISMATCH", "could not compute SHA-256 for the exact model response bytes with Web Crypto", error);
|
|
983
|
+
}
|
|
984
|
+
}
|
|
985
|
+
function keyedPlaneGains(planes) {
|
|
986
|
+
if (!planes) return void 0;
|
|
987
|
+
const gains = /* @__PURE__ */ new Map();
|
|
988
|
+
for (const [id, { role, gain, baked }] of Object.entries(planes)) {
|
|
989
|
+
if (gain !== void 0 && !Number.isFinite(gain)) {
|
|
990
|
+
throw new ComposedTakeError("COMPOSED_INVALID_DISPLACEMENT", `plane ${JSON.stringify(id)} needs a finite gain`);
|
|
991
|
+
}
|
|
992
|
+
if (role === "figure" && (baked !== void 0 || gain !== void 0 && gain !== 0)) {
|
|
993
|
+
throw trackError(id, "must stay at focal gain 0 without a baked camera track");
|
|
994
|
+
}
|
|
995
|
+
gains.set(id, gain ?? (role === "backdrop" ? BACKDROP_GAIN : 0));
|
|
996
|
+
}
|
|
997
|
+
return gains;
|
|
998
|
+
}
|
|
494
999
|
async function mountComposedTake(root, options) {
|
|
495
1000
|
const initial = options.camera ?? "fixed";
|
|
496
1001
|
checkMode(initial);
|
|
497
|
-
|
|
1002
|
+
const { loop, sceneReportUrl } = options;
|
|
1003
|
+
if (loop !== true && (loop !== false || sceneReportUrl === void 0)) {
|
|
1004
|
+
throw new ComposedTakeError("COMPOSED_LOOP_REQUIRED", "declare the existing take as loop: true");
|
|
1005
|
+
}
|
|
498
1006
|
const override = options.maxDisplacement;
|
|
499
1007
|
const validLimit = (limit) => limit && Number.isFinite(limit.x) && limit.x >= 0 && Number.isFinite(limit.y) && limit.y >= 0;
|
|
500
1008
|
if (override !== void 0 && !validLimit(override)) {
|
|
@@ -511,8 +1019,26 @@ async function mountComposedTake(root, options) {
|
|
|
511
1019
|
if (!Number.isFinite(options.transitionMs ?? DEFAULT_TRANSITION_MS) || !(transitionSeconds > 0)) {
|
|
512
1020
|
throw new ComposedTakeError("COMPOSED_INVALID_DISPLACEMENT", "transitionMs must be positive and finite");
|
|
513
1021
|
}
|
|
514
|
-
const
|
|
1022
|
+
const report = sceneReportUrl === void 0 ? void 0 : await fetchSceneReport(sceneReportUrl);
|
|
1023
|
+
const digest = sceneReportUrl === void 0 ? null : sceneCameraModelDigest(report, refuseSceneCamera);
|
|
1024
|
+
if (digest === null && loop !== true) throw new ComposedTakeError("COMPOSED_LOOP_REQUIRED", "declare the existing take as loop: true");
|
|
1025
|
+
let sha256 = "";
|
|
1026
|
+
const assets = await loadModel({
|
|
1027
|
+
modelUrl: options.modelUrl,
|
|
1028
|
+
regions: "none",
|
|
1029
|
+
setsUrl: null,
|
|
1030
|
+
crossOrigin: "anonymous",
|
|
1031
|
+
...digest === null ? {} : { fetch: async (input, init) => {
|
|
1032
|
+
const response = await fetch(input, init);
|
|
1033
|
+
if (response.ok) {
|
|
1034
|
+
sha256 = await hashModelResponse(response);
|
|
1035
|
+
if (sha256 !== digest) refuseSceneCamera("SCENE_CAMERA_MODEL_MISMATCH", "the scene camera SHA-256 does not match the consumed model");
|
|
1036
|
+
}
|
|
1037
|
+
return response;
|
|
1038
|
+
} }
|
|
1039
|
+
}).catch((error) => {
|
|
515
1040
|
if (error instanceof Error && /(?:problem\(s\): |; )(?:stage[.: ]|section "stage" is missing(?=; | — |$))/.test(error.message)) {
|
|
1041
|
+
if (digest !== null) refuseSceneCamera("SCENE_CAMERA_VIEW_INVALID", "the compiled model needs a valid stage", error);
|
|
516
1042
|
throw new ComposedTakeError("COMPOSED_STAGE_REQUIRED", "the compiled model needs a valid stage", error);
|
|
517
1043
|
}
|
|
518
1044
|
throw error;
|
|
@@ -522,13 +1048,37 @@ async function mountComposedTake(root, options) {
|
|
|
522
1048
|
let player;
|
|
523
1049
|
let audit;
|
|
524
1050
|
try {
|
|
525
|
-
let
|
|
1051
|
+
let cameraFor = function(animation, animationTime, loop2) {
|
|
1052
|
+
const view = bound?.sample(animation, { basis: "compiled", seconds: animationTime }) ?? null;
|
|
1053
|
+
if (view && view.loop !== loop2) {
|
|
1054
|
+
refuseSceneCamera("SCENE_CAMERA_CLIP_MISMATCH", `loop must match the authored camera track for ${JSON.stringify(animation)}`);
|
|
1055
|
+
}
|
|
1056
|
+
return view;
|
|
1057
|
+
}, planesFor = function(animation) {
|
|
1058
|
+
if (!namedInput) return void 0;
|
|
1059
|
+
let named = legacyPlanes.get(animation);
|
|
1060
|
+
if (!named) {
|
|
1061
|
+
named = namedPlanes(assets, options, animation);
|
|
1062
|
+
legacyPlanes.set(animation, named);
|
|
1063
|
+
}
|
|
1064
|
+
return named;
|
|
1065
|
+
}, syncTurn = function(next) {
|
|
526
1066
|
if (!dials.length) return;
|
|
527
1067
|
const weight = mode === "parallax" && next === mode ? handoff.weight : 0;
|
|
528
1068
|
const pointer = weight === 0 ? NEUTRAL : handoff.pointer;
|
|
529
1069
|
if (weight !== turnInput.weight || pointer.x !== turnInput.pointer.x || pointer.y !== turnInput.pointer.y) {
|
|
530
1070
|
turnInput = { weight, pointer };
|
|
531
1071
|
}
|
|
1072
|
+
}, createCoverageChecks = function() {
|
|
1073
|
+
const renderer2 = audit = new CanvasRenderer(doc.createElement("div"), assets.pageImages);
|
|
1074
|
+
renderer2.backend = backend;
|
|
1075
|
+
const auditBackdrop = backdropAlphaAudit(renderer2);
|
|
1076
|
+
return { renderer: renderer2, auditBackdrop, requireCoverage: backdropGuard(auditBackdrop, stage) };
|
|
1077
|
+
}, applyLegacyLayout = function() {
|
|
1078
|
+
const { native, width, height } = layout;
|
|
1079
|
+
renderer.viewport = native ? stage : { x: 0, y: -height, width, height };
|
|
1080
|
+
renderer.pixelRatio = native ? width / stage.width : 1;
|
|
1081
|
+
legacyLayoutPending = false;
|
|
532
1082
|
}, measure = function() {
|
|
533
1083
|
const box = surface.getBoundingClientRect();
|
|
534
1084
|
const cssWidth = box.width || stage.width;
|
|
@@ -541,12 +1091,12 @@ async function mountComposedTake(root, options) {
|
|
|
541
1091
|
const native = [stage.x, stage.y, stage.width, stage.height].every(Number.isInteger) && stage.width * pixelRatio === width && stage.height * pixelRatio === height;
|
|
542
1092
|
const excursion = explicit ?? cameraLimits(cssWidth, cssHeight);
|
|
543
1093
|
layout = { cssWidth, cssHeight, width, height, dpr, native, excursion };
|
|
544
|
-
|
|
545
|
-
|
|
1094
|
+
legacyLayoutPending = true;
|
|
1095
|
+
if (!bound) applyLegacyLayout();
|
|
546
1096
|
}, cameraExcursionFor = function(next) {
|
|
547
1097
|
const { excursion } = layout;
|
|
548
1098
|
return next === "parallax" && dials.length ? { x: excursion.x, y: 0 } : excursion;
|
|
549
|
-
}, prepareFrame = function(frame, plates, next, excursion) {
|
|
1099
|
+
}, prepareFrame = function(frame, plates, next, excursion, named) {
|
|
550
1100
|
const worldX = stage.width / layout.cssWidth;
|
|
551
1101
|
const worldY = stage.height / layout.cssHeight;
|
|
552
1102
|
const centered = /* @__PURE__ */ new Map();
|
|
@@ -609,7 +1159,7 @@ async function mountComposedTake(root, options) {
|
|
|
609
1159
|
positioned = transformFrame(frame, shiftFor, { centered, clipInStockSpace: true });
|
|
610
1160
|
}
|
|
611
1161
|
return { frame: positioned, offsets: frameOffsets };
|
|
612
|
-
}, checkBackdropAlpha = function(frame, { figureSlots, backdrop }, next) {
|
|
1162
|
+
}, checkBackdropAlpha = function(frame, { figureSlots, backdrop }, next, coverage, auditBackdrop) {
|
|
613
1163
|
const isFigure = (slot) => figureSlots.has(slot.slot);
|
|
614
1164
|
const figures = frame.order.filter(isFigure);
|
|
615
1165
|
const firstFigure = figures.length === figureSlots.size ? figures[0] : poser.slotIdentity().slots.find(isFigure);
|
|
@@ -626,40 +1176,104 @@ async function mountComposedTake(root, options) {
|
|
|
626
1176
|
if (nonOpaque) {
|
|
627
1177
|
throw plateCoverageError(backdrop, next, `${nonOpaque} stage pixels have alpha below 255 at ${layout.width} × ${layout.height} backing px`);
|
|
628
1178
|
}
|
|
629
|
-
}, currentFrame = function(next) {
|
|
1179
|
+
}, currentFrame = function(next, named, keyed) {
|
|
630
1180
|
syncTurn(next);
|
|
631
1181
|
if (posedTurnInput !== turnInput) poser.repose();
|
|
632
1182
|
const frame = poser.posedFrame(null);
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
const
|
|
1183
|
+
return { frame, backdrop: checkFrame(frame, planes, named?.backdrop, keyed) };
|
|
1184
|
+
}, requireKeyedCoverage = function(view, next, excursion) {
|
|
1185
|
+
if (!driftEvidence || next === "fixed") return;
|
|
1186
|
+
const sweep2 = keyedGains && next === "parallax" ? sweepLimit : NEUTRAL;
|
|
1187
|
+
if (excursion.x === 0 && excursion.y === 0 && sweep2.x === 0 && sweep2.y === 0) return;
|
|
1188
|
+
const gain = next === "pan" ? 1 : keyedGains?.get(backdropPlane) ?? BACKDROP_GAIN;
|
|
1189
|
+
const sampledPlane = planes.get(driftEvidence.backdrop);
|
|
1190
|
+
if (gain === 0 && sampledPlane !== void 0 && keyedGains?.get(sampledPlane) === 0) return;
|
|
1191
|
+
const context = `take ${JSON.stringify(view.animation)}, sampled backdrop slot ${JSON.stringify(driftEvidence.backdrop)}, pointer excursion ±[${excursion.x}, ${excursion.y}] CSS px, sweep endpoint [${sweep2.x}, ${sweep2.y}] CSS px, backdrop gain ${gain}`;
|
|
1192
|
+
if (sampledPlane !== backdropPlane) {
|
|
1193
|
+
throw plateCoverageError(backdropPlane, next, `${context} needs that exact slot bound to the backdrop plane`);
|
|
1194
|
+
}
|
|
1195
|
+
const toOutput = ({ x, y }) => ({
|
|
1196
|
+
x: x === 0 ? 0 : x * (view.output.width / layout.cssWidth),
|
|
1197
|
+
y: y === 0 ? 0 : y * (view.output.height / layout.cssHeight)
|
|
1198
|
+
});
|
|
1199
|
+
const backingPixel = { x: view.output.width / layout.width, y: view.output.height / layout.height };
|
|
1200
|
+
const failure = driftEvidence.failure(
|
|
1201
|
+
view.animation,
|
|
1202
|
+
toOutput(planeShift(excursion, gain)),
|
|
1203
|
+
toOutput(planeShift(sweep2, gain)),
|
|
1204
|
+
backingPixel
|
|
1205
|
+
);
|
|
1206
|
+
if (failure) throw plateCoverageError(backdropPlane, next, `${context}; ${failure}`);
|
|
1207
|
+
}, drawKeyedFrame = function(frame, next, excursion, view) {
|
|
1208
|
+
let displayed = planeOffsets(cssTarget(camera, excursion), next);
|
|
1209
|
+
if (keyedGains) {
|
|
1210
|
+
const changingMode = mode !== next;
|
|
1211
|
+
const weight = changingMode ? 0 : handoff.weight;
|
|
1212
|
+
const pointer = cssTarget(changingMode ? NEUTRAL : next === "pan" ? camera : handoff.pointer, excursion);
|
|
1213
|
+
const phase = sweepPeriod === void 0 ? 0 : Math.sin(2 * Math.PI * (poser.time % sweepPeriod / sweepPeriod));
|
|
1214
|
+
const sweep2 = { x: sweepLimit.x * phase, y: sweepLimit.y * phase };
|
|
1215
|
+
const input = next === "pan" ? pointer : {
|
|
1216
|
+
x: (1 - weight) * sweep2.x + weight * pointer.x,
|
|
1217
|
+
y: (1 - weight) * sweep2.y + weight * pointer.y
|
|
1218
|
+
};
|
|
1219
|
+
displayed = Object.fromEntries([...keyedGains].map(([id, gain]) => [
|
|
1220
|
+
id,
|
|
1221
|
+
next === "fixed" ? NEUTRAL : planeShift(input, next === "pan" ? 1 : gain)
|
|
1222
|
+
]));
|
|
1223
|
+
}
|
|
1224
|
+
const worldX = view.output.width / layout.cssWidth / view.zoom;
|
|
1225
|
+
const worldY = view.output.height / layout.cssHeight / view.zoom;
|
|
1226
|
+
drawSceneCamera(renderer, frame, view, layout, (slot) => {
|
|
1227
|
+
const { x, y } = displayed[planes.get(slot.slot)];
|
|
1228
|
+
return { x: x === 0 ? 0 : x * worldX, y: y === 0 ? 0 : y * worldY };
|
|
1229
|
+
});
|
|
1230
|
+
return displayed;
|
|
1231
|
+
}, drawMode = function(frame, backdrop, next, switching, view, named) {
|
|
637
1232
|
const excursion = cameraExcursionFor(next);
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
1233
|
+
let displayed;
|
|
1234
|
+
if (view) {
|
|
1235
|
+
keyedGains ??= keyedPlaneGains(options.planes);
|
|
1236
|
+
if (keyedAdmission?.animation !== view.animation || keyedAdmission.layout !== layout || keyedAdmission.mode !== next) {
|
|
1237
|
+
requireKeyedCoverage(view, next, excursion);
|
|
1238
|
+
keyedAdmission = { animation: view.animation, layout, mode: next };
|
|
1239
|
+
}
|
|
1240
|
+
displayed = drawKeyedFrame(frame, next, excursion, view);
|
|
1241
|
+
} else {
|
|
1242
|
+
keyedAdmission = void 0;
|
|
1243
|
+
if (legacyLayoutPending) applyLegacyLayout();
|
|
1244
|
+
const checks = coverageChecks ??= createCoverageChecks();
|
|
1245
|
+
const plates = named ? livePlates(frame, named, next) : [];
|
|
1246
|
+
if (named) checkPlateEnvelopes(stage, layout, next, excursion, plates, named.gains, sweepLimit);
|
|
1247
|
+
else checks.requireCoverage(backdrop, layout, next);
|
|
1248
|
+
const prepared = prepareFrame(frame, plates, next, excursion, named);
|
|
1249
|
+
if (named) checkBackdropAlpha(prepared.frame, named, next, checks.renderer, checks.auditBackdrop);
|
|
1250
|
+
renderer.render(prepared.frame);
|
|
1251
|
+
displayed = prepared.offsets;
|
|
1252
|
+
}
|
|
1253
|
+
if (namedInput && mode !== next) {
|
|
644
1254
|
camera = NEUTRAL;
|
|
645
1255
|
handoff.reset();
|
|
646
1256
|
if (next === "parallax" && hover !== void 0) handoff.enter();
|
|
647
1257
|
}
|
|
648
1258
|
mode = next;
|
|
649
|
-
if (!
|
|
650
|
-
offsets =
|
|
651
|
-
if (
|
|
1259
|
+
if (!namedInput && switching && mode === "fixed") camera = target = NEUTRAL;
|
|
1260
|
+
offsets = displayed;
|
|
1261
|
+
if (namedInput && mode === "parallax") handoff.painted();
|
|
652
1262
|
canvas.style.visibility = "";
|
|
653
1263
|
Object.assign(canvas.style, { width: "100%", height: "100%", transform: "none", pointerEvents: "auto" });
|
|
654
1264
|
}, select = function(next, switching, allowFallback) {
|
|
655
|
-
const
|
|
1265
|
+
const entry = bound && poser.entry();
|
|
1266
|
+
const view = entry?.animation ? cameraFor(entry.animation, entry.animationTime, entry.loop) : null;
|
|
1267
|
+
drawingKeyed = view !== null;
|
|
1268
|
+
const named = view ? void 0 : planesFor(entry?.animation ?? initialAnimation);
|
|
1269
|
+
const { frame, backdrop } = currentFrame(next, named, drawingKeyed);
|
|
656
1270
|
try {
|
|
657
|
-
drawMode(frame, backdrop, next, switching);
|
|
1271
|
+
drawMode(frame, backdrop, next, switching, view, named);
|
|
658
1272
|
} catch (error) {
|
|
659
|
-
if (!(error instanceof ComposedTakeError) || error.code !== "COMPOSED_BACKDROP_COVERAGE" || next === "fixed" || !named && !allowFallback) throw error;
|
|
1273
|
+
if (!(error instanceof ComposedTakeError) || error.code !== "COMPOSED_BACKDROP_COVERAGE" || next === "fixed" || !named && !view && !allowFallback) throw error;
|
|
660
1274
|
try {
|
|
661
|
-
const fixed = turnInput.weight === 0 ? { frame, backdrop } : currentFrame("fixed");
|
|
662
|
-
drawMode(fixed.frame, fixed.backdrop, "fixed", true);
|
|
1275
|
+
const fixed = turnInput.weight === 0 ? { frame, backdrop } : currentFrame("fixed", named, drawingKeyed);
|
|
1276
|
+
drawMode(fixed.frame, fixed.backdrop, "fixed", true, view, named);
|
|
663
1277
|
} catch (fixedError) {
|
|
664
1278
|
canvas.style.visibility = "hidden";
|
|
665
1279
|
throw fixedError;
|
|
@@ -672,7 +1286,7 @@ async function mountComposedTake(root, options) {
|
|
|
672
1286
|
select(mode, false, true);
|
|
673
1287
|
} catch (error) {
|
|
674
1288
|
if (error instanceof ComposedTakeError) refusal = error;
|
|
675
|
-
if (
|
|
1289
|
+
if (namedInput || drawingKeyed) canvas.style.visibility = "hidden";
|
|
676
1290
|
stopped = true;
|
|
677
1291
|
if (frameId !== void 0) window.cancelAnimationFrame(frameId);
|
|
678
1292
|
throw error;
|
|
@@ -686,12 +1300,12 @@ async function mountComposedTake(root, options) {
|
|
|
686
1300
|
refusal = null;
|
|
687
1301
|
} catch (error) {
|
|
688
1302
|
if (error instanceof ComposedTakeError) refusal = error;
|
|
689
|
-
if (
|
|
1303
|
+
if ((namedInput || drawingKeyed) && next === "fixed") canvas.style.visibility = "hidden";
|
|
690
1304
|
throw error;
|
|
691
1305
|
}
|
|
692
1306
|
}, advanceCamera = function(elapsed) {
|
|
693
1307
|
if (!(elapsed > 0)) return;
|
|
694
|
-
if (
|
|
1308
|
+
if (namedInput && mode === "parallax") handoff.advance(elapsed, target);
|
|
695
1309
|
else camera = easeCamera(camera, target, elapsed);
|
|
696
1310
|
}, syncCamera = function(now) {
|
|
697
1311
|
const next = Math.max(lastCameraAt, now);
|
|
@@ -713,14 +1327,23 @@ async function mountComposedTake(root, options) {
|
|
|
713
1327
|
target = NEUTRAL;
|
|
714
1328
|
if (mode === "parallax") handoff.leave();
|
|
715
1329
|
};
|
|
1330
|
+
const bound = digest === null ? null : bindSceneCamera(report, { sha256, stage: assets.stage, animations: assets.animations });
|
|
1331
|
+
const driftEvidence = bound && sceneCameraDriftEvidence(report, refuseSceneCamera);
|
|
1332
|
+
const initialView = cameraFor(options.animation, 0, loop);
|
|
1333
|
+
if (!initialView && loop !== true) throw new ComposedTakeError("COMPOSED_LOOP_REQUIRED", "declare the existing take as loop: true");
|
|
716
1334
|
const stage = requireStage(assets.stage);
|
|
717
1335
|
const take = assets.animations.find((animation) => animation.name === options.animation);
|
|
718
|
-
if (!take || !Number.isFinite(take.duration) || take.duration <= 0) {
|
|
1336
|
+
if (!take || !initialView && (!Number.isFinite(take.duration) || take.duration <= 0)) {
|
|
719
1337
|
throw new ComposedTakeError("COMPOSED_LOOP_REQUIRED", `no positive-duration animation named ${JSON.stringify(options.animation)}`);
|
|
720
1338
|
}
|
|
1339
|
+
const initialAnimation = take.name;
|
|
721
1340
|
const planes = bindSlots(assets, options);
|
|
722
|
-
const
|
|
723
|
-
const
|
|
1341
|
+
const namedInput = options.planes !== void 0;
|
|
1342
|
+
const backdropPlane = Object.entries(options.planes ?? {}).find(([, plane]) => plane.role === "backdrop")?.[0] ?? "background";
|
|
1343
|
+
const legacyPlanes = /* @__PURE__ */ new Map();
|
|
1344
|
+
const initialNamed = initialView ? void 0 : planesFor(initialAnimation);
|
|
1345
|
+
let keyedGains = initialView ? keyedPlaneGains(options.planes) : void 0;
|
|
1346
|
+
const dials = namedInput && options.pointerTurn !== false ? discoverTurnDials(assets.document.parsed, assets.animations) : [];
|
|
724
1347
|
const handoff = createCameraHandoff(transitionSeconds);
|
|
725
1348
|
let mode = initial;
|
|
726
1349
|
let turnInput = { weight: 0, pointer: NEUTRAL };
|
|
@@ -750,32 +1373,35 @@ async function mountComposedTake(root, options) {
|
|
|
750
1373
|
root.appendChild(surface);
|
|
751
1374
|
const poser = player = new RigPlayer(surface, assets, { mode: "canvas", adjust: dials.length ? adjustTurn : null });
|
|
752
1375
|
const renderer = poser.renderer;
|
|
753
|
-
const
|
|
754
|
-
renderer.backend =
|
|
1376
|
+
const backend = options.backend ?? "webgl";
|
|
1377
|
+
renderer.backend = backend;
|
|
1378
|
+
let coverageChecks;
|
|
1379
|
+
if (!initialView) coverageChecks = createCoverageChecks();
|
|
755
1380
|
const canvas = renderer.canvas;
|
|
756
|
-
poser.play(
|
|
1381
|
+
poser.play(initialAnimation, { loop });
|
|
757
1382
|
let offsets = planeOffsets(NEUTRAL, "fixed");
|
|
758
1383
|
let camera = NEUTRAL;
|
|
759
1384
|
let target = NEUTRAL;
|
|
760
1385
|
let hover;
|
|
761
1386
|
let layout;
|
|
1387
|
+
let keyedAdmission;
|
|
1388
|
+
let legacyLayoutPending = true;
|
|
1389
|
+
let drawingKeyed = initialView !== null;
|
|
762
1390
|
let refusal = null;
|
|
763
1391
|
let stopped = false;
|
|
764
1392
|
let disposed = false;
|
|
765
1393
|
let frameId;
|
|
766
1394
|
const window = doc.defaultView;
|
|
767
|
-
const auditBackdrop = backdropAlphaAudit(coverage);
|
|
768
|
-
const requireCoverage = backdropGuard(auditBackdrop, stage);
|
|
769
1395
|
const origin = { x: stage.x, y: stageTop(stage) };
|
|
770
1396
|
const autoStart = options.autoStart !== false;
|
|
771
1397
|
let lastCameraAt = window.performance.now();
|
|
772
1398
|
const cssTarget = (point, excursion) => ({ x: point.x * excursion.x, y: point.y * excursion.y });
|
|
773
1399
|
measure();
|
|
774
|
-
select(initial, true,
|
|
1400
|
+
select(initial, true, initialNamed !== void 0 || initialView !== null);
|
|
775
1401
|
const boundaryEvent = (event) => event.target === root || event.bubbles;
|
|
776
1402
|
const aim = (event) => {
|
|
777
1403
|
if (!event.isPrimary || stopped) return;
|
|
778
|
-
if (
|
|
1404
|
+
if (namedInput) {
|
|
779
1405
|
if (event.pointerType === "touch" || event.type === "pointerenter" && !boundaryEvent(event) || hover !== void 0 && hover !== event.pointerId) return;
|
|
780
1406
|
if (event.pointerType === "pen" && event.buttons !== 0) {
|
|
781
1407
|
leave();
|
|
@@ -785,7 +1411,7 @@ async function mountComposedTake(root, options) {
|
|
|
785
1411
|
if (!Number.isFinite(event.clientX) || !Number.isFinite(event.clientY)) return;
|
|
786
1412
|
const box = surface.getBoundingClientRect();
|
|
787
1413
|
if (!(box.width > 0 && box.height > 0)) return;
|
|
788
|
-
if (
|
|
1414
|
+
if (namedInput) {
|
|
789
1415
|
if (autoStart) syncCamera(window.performance.now());
|
|
790
1416
|
if (hover === void 0 && mode === "parallax") handoff.enter();
|
|
791
1417
|
hover = event.pointerId;
|
|
@@ -794,7 +1420,7 @@ async function mountComposedTake(root, options) {
|
|
|
794
1420
|
};
|
|
795
1421
|
const recenter = (event) => {
|
|
796
1422
|
if (!event.isPrimary) return;
|
|
797
|
-
if (!
|
|
1423
|
+
if (!namedInput) {
|
|
798
1424
|
target = NEUTRAL;
|
|
799
1425
|
return;
|
|
800
1426
|
}
|
|
@@ -806,7 +1432,7 @@ async function mountComposedTake(root, options) {
|
|
|
806
1432
|
root.addEventListener("pointermove", aim, true);
|
|
807
1433
|
root.addEventListener("pointerleave", recenter, true);
|
|
808
1434
|
root.addEventListener("pointercancel", recenter, true);
|
|
809
|
-
if (
|
|
1435
|
+
if (namedInput) {
|
|
810
1436
|
root.addEventListener("pointerenter", aim, true);
|
|
811
1437
|
root.addEventListener("pointerdown", contact, true);
|
|
812
1438
|
root.addEventListener("lostpointercapture", recenter, true);
|
|
@@ -827,13 +1453,13 @@ async function mountComposedTake(root, options) {
|
|
|
827
1453
|
if (disposed || stopped) return;
|
|
828
1454
|
const elapsed = Math.max(0, (now - last) / 1e3);
|
|
829
1455
|
last = now;
|
|
830
|
-
if (
|
|
1456
|
+
if (namedInput) {
|
|
831
1457
|
syncCamera(now);
|
|
832
1458
|
advance(Math.min(elapsed, 1 / 15), 0);
|
|
833
1459
|
} else {
|
|
834
1460
|
advance(Math.min(elapsed, 1 / 15), elapsed);
|
|
835
1461
|
}
|
|
836
|
-
if (
|
|
1462
|
+
if (namedInput || layout.dpr !== window.devicePixelRatio) measure();
|
|
837
1463
|
try {
|
|
838
1464
|
renderCurrent();
|
|
839
1465
|
} catch (error) {
|
|
@@ -879,14 +1505,14 @@ async function mountComposedTake(root, options) {
|
|
|
879
1505
|
root.removeEventListener("pointermove", aim, true);
|
|
880
1506
|
root.removeEventListener("pointerleave", recenter, true);
|
|
881
1507
|
root.removeEventListener("pointercancel", recenter, true);
|
|
882
|
-
if (
|
|
1508
|
+
if (namedInput) {
|
|
883
1509
|
root.removeEventListener("pointerenter", aim, true);
|
|
884
1510
|
root.removeEventListener("pointerdown", contact, true);
|
|
885
1511
|
root.removeEventListener("lostpointercapture", recenter, true);
|
|
886
1512
|
window.removeEventListener("blur", leave);
|
|
887
1513
|
}
|
|
888
1514
|
poser.dispose();
|
|
889
|
-
|
|
1515
|
+
audit?.dispose();
|
|
890
1516
|
surface.remove();
|
|
891
1517
|
assets.dispose();
|
|
892
1518
|
}
|
|
@@ -901,6 +1527,10 @@ async function mountComposedTake(root, options) {
|
|
|
901
1527
|
}
|
|
902
1528
|
export {
|
|
903
1529
|
ComposedTakeError,
|
|
904
|
-
|
|
1530
|
+
SCENE_CAMERA_REPORT_MAX_BYTES,
|
|
1531
|
+
bindSceneCamera,
|
|
1532
|
+
mountComposedTake,
|
|
1533
|
+
renderSceneCameraFrame,
|
|
1534
|
+
sceneCameraProjection
|
|
905
1535
|
};
|
|
906
1536
|
//# sourceMappingURL=composed-take.js.map
|