feat(rerun): retain live playback and recover isolated viewer resources
This commit is contained in:
@@ -32,6 +32,26 @@ const additions = {
|
||||
},
|
||||
};
|
||||
|
||||
// Preserve the exact previous patch as an audited upgrade path.
|
||||
for (const [name, addition] of Object.entries(additions)) {
|
||||
addition.previousCode = addition.code;
|
||||
if (name === "index.d.ts") {
|
||||
addition.code += " set_height_slice(lower: number | null, upper: number | null): boolean;\n get_height_bounds(): {min: number; max: number} | null;\n";
|
||||
} else {
|
||||
const typed = name === "index.ts";
|
||||
addition.code += ` set_height_slice(lower${typed ? ": number | null" : ""}, upper${typed ? ": number | null" : ""})${typed ? ": boolean" : ""} {
|
||||
if (!this.#handle) throw new Error("Rerun viewer is stopped");
|
||||
const off = lower === null && upper === null;
|
||||
return this.#handle.nodedc_height_slice(off ? undefined : (lower ?? -3e38), off ? undefined : (upper ?? 3e38));
|
||||
}
|
||||
get_height_bounds()${typed ? ": {min: number; max: number} | null" : ""} {
|
||||
if (!this.#handle) throw new Error("Rerun viewer is stopped");
|
||||
return JSON.parse(this.#handle.nodedc_height_bounds() ?? "null");
|
||||
}
|
||||
`;
|
||||
}
|
||||
}
|
||||
|
||||
// Validate the complete set before changing any installed file. A package
|
||||
// upgrade, corrupt artifact or independently modified wrapper fails closed.
|
||||
const writes = [];
|
||||
@@ -39,9 +59,9 @@ for (const [name, identity] of Object.entries(manifest.files)) {
|
||||
const current = readFileSync(resolve(packageRoot, name));
|
||||
let output;
|
||||
if (additions[name]) {
|
||||
const { marker, code } = additions[name];
|
||||
const { marker, code, previousCode } = additions[name];
|
||||
const source = current.toString("utf8");
|
||||
const original = source.includes(code) ? source.replace(code, "") : source;
|
||||
const original = source.includes(code) ? source.replace(code, "") : source.replace(previousCode, "");
|
||||
if (sha(original) !== identity.upstreamSha256 || original.split(marker).length !== 2) {
|
||||
throw new Error(`Unexpected upstream wrapper: ${name}`);
|
||||
}
|
||||
@@ -49,7 +69,7 @@ for (const [name, identity] of Object.entries(manifest.files)) {
|
||||
} else {
|
||||
output = readFileSync(resolve(vendorRoot, identity.artifact));
|
||||
if (sha(output) !== identity.sha256) throw new Error(`Corrupt navigation artifact: ${name}`);
|
||||
if (![identity.upstreamSha256, identity.sha256].includes(sha(current))) {
|
||||
if (![identity.upstreamSha256, identity.previousArtifactSha256, identity.sha256].includes(sha(current))) {
|
||||
throw new Error(`Unexpected installed runtime: ${name}`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,8 +2,7 @@ import { useEffect, useRef, useState } from "react";
|
||||
import { createIsolatedRerunHost } from "./rerun/isolatedRerunHost";
|
||||
import { keepRecordedBlueprintSession } from "../core/observation/recordedBlueprintLifecycle";
|
||||
import {
|
||||
RECORDED_RERUN_ORBITAL_EYE,
|
||||
RECORDED_RERUN_PLAN_EYE,
|
||||
selectRecordedRerunCameraEye,
|
||||
type RecordedRerunCameraEye,
|
||||
} from "./rerun/recordedRerunCameraJournal";
|
||||
|
||||
@@ -148,10 +147,7 @@ export interface RerunViewportProps {
|
||||
interface RerunBlueprintChannel {
|
||||
endpointUrl: string;
|
||||
cameraContract?: string | null;
|
||||
appliedFollowTrajectory?: boolean | null;
|
||||
pendingFollowCameraEye?: RecordedRerunCameraEye | null;
|
||||
getCameraEye?: () => RecordedRerunCameraEye | null;
|
||||
getCurrentTimeNs?: () => number | null;
|
||||
channel: {
|
||||
readonly ready: boolean;
|
||||
send_rrd: (rrdBytes: Uint8Array) => void;
|
||||
@@ -1649,16 +1645,9 @@ function RerunViewportInstance({
|
||||
blueprintChannel = {
|
||||
endpointUrl: recordedBlueprintUrl,
|
||||
cameraContract: null,
|
||||
appliedFollowTrajectory: null,
|
||||
pendingFollowCameraEye: null,
|
||||
getCameraEye: () => "get_camera_eye" in viewer
|
||||
? viewer.get_camera_eye()
|
||||
: null,
|
||||
getCurrentTimeNs: () => {
|
||||
const currentIdentity = recordedIdentityRef.current;
|
||||
if (!currentIdentity) return null;
|
||||
return viewer.get_current_time(currentIdentity.recordingId, "session_time");
|
||||
},
|
||||
channel,
|
||||
};
|
||||
blueprintChannelRef.current = blueprintChannel;
|
||||
@@ -2114,29 +2103,7 @@ function RerunViewportInstance({
|
||||
);
|
||||
const cameraContractChanged = active.cameraContract !== cameraContract;
|
||||
const abort = new AbortController();
|
||||
const previousFollow = active.appliedFollowTrajectory ?? false;
|
||||
const enablingFollow = recordedFollowTrajectory && !previousFollow;
|
||||
const disablingFollow = !recordedFollowTrajectory && previousFollow;
|
||||
const transitionEye = (enablingFollow || disablingFollow)
|
||||
? active.getCameraEye?.()
|
||||
: null;
|
||||
if (enablingFollow && transitionEye) {
|
||||
active.pendingFollowCameraEye = transitionEye;
|
||||
} else if (disablingFollow) {
|
||||
active.pendingFollowCameraEye = null;
|
||||
}
|
||||
const pendingFollowEye = recordedFollowTrajectory
|
||||
? active.pendingFollowCameraEye ?? null
|
||||
: null;
|
||||
const requestBlueprint = async (
|
||||
cameraEye?: RecordedRerunCameraEye,
|
||||
eyeRelativeToTracking = false,
|
||||
reactivateUpdates = false,
|
||||
) => {
|
||||
const currentTimeNs = active.getCurrentTimeNs?.();
|
||||
if (eyeRelativeToTracking && currentTimeNs == null) {
|
||||
throw new Error("Recorded tracking cursor is unavailable");
|
||||
}
|
||||
const requestBlueprint = async (cameraEye?: RecordedRerunCameraEye) => {
|
||||
return fetchRecordedBlueprintRrd(recordedBlueprintUrl,
|
||||
{...sceneSettings, showPoints: sceneSettings.showPoints && !pointDisplay.hidePoints}, identity, {
|
||||
displayPointBank: pointDisplay.bank,
|
||||
@@ -2152,12 +2119,11 @@ function RerunViewportInstance({
|
||||
unifiedCameraShare: recordedUnifiedCameraShare,
|
||||
planView: recordedPlanView,
|
||||
cameraEye,
|
||||
eyeRelativeToTracking,
|
||||
// Only following-eye transitions need a pose at the cursor. Supplying
|
||||
// time for display-only updates makes the API scan the entire archive
|
||||
// for camera bounds, although neither the camera nor its pose changed.
|
||||
currentTimeNs: eyeRelativeToTracking ? currentTimeNs : undefined,
|
||||
reactivateUpdates,
|
||||
// The native controller owns continuous tracking and its world eye.
|
||||
// Reinterpreting this as a rig-relative eye snaps an off-centre view
|
||||
// back onto the rig. It also needlessly scans the recording for a pose.
|
||||
eyeRelativeToTracking: false,
|
||||
reactivateUpdates: true,
|
||||
});
|
||||
};
|
||||
const canApply = () => (
|
||||
@@ -2175,43 +2141,14 @@ function RerunViewportInstance({
|
||||
return true;
|
||||
};
|
||||
void (async () => {
|
||||
const firstEye = disablingFollow
|
||||
? transitionEye ?? undefined
|
||||
: !enablingFollow && (cameraContractChanged || pendingFollowEye)
|
||||
? pendingFollowEye ?? (recordedPlanView ? RECORDED_RERUN_PLAN_EYE : RECORDED_RERUN_ORBITAL_EYE)
|
||||
: !enablingFollow ? active.getCameraEye?.() ?? undefined : undefined;
|
||||
const firstEyeIsTrackingRelative = Boolean(firstEye) && (
|
||||
disablingFollow || recordedFollowTrajectory
|
||||
// Reactivating a blueprint replaces the edited native store. Carry its
|
||||
// actual eye through follow/layer/display changes in one update; only
|
||||
// explicit reset and plan/3D changes select a startup preset.
|
||||
const cameraEye = selectRecordedRerunCameraEye(
|
||||
cameraContractChanged, recordedPlanView, active.getCameraEye?.() ?? null,
|
||||
);
|
||||
const firstPayload = await requestBlueprint(
|
||||
firstEye,
|
||||
firstEyeIsTrackingRelative,
|
||||
// Upstream copies incoming blueprints into an active store. Every
|
||||
// settings update must activate it; merely appending rows is invisible.
|
||||
// Activation copies the incoming blueprint store, not the operator's
|
||||
// edited store. Preserve its actual native eye on display-only updates;
|
||||
// omitting the eye resurrects the embedded startup camera.
|
||||
true,
|
||||
);
|
||||
if (!applyPayload(firstPayload)) return;
|
||||
active.cameraContract = cameraContract;
|
||||
active.appliedFollowTrajectory = recordedFollowTrajectory;
|
||||
if (!enablingFollow || !transitionEye) {
|
||||
if (pendingFollowEye && firstEye === pendingFollowEye) {
|
||||
active.pendingFollowCameraEye = null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
// Rerun 0.36.3 intentionally fits a newly tracked transform to its
|
||||
// bounding box. Apply the operator's relative eye on the next native
|
||||
// frame, after tracking is established, to retain direction and zoom.
|
||||
await new Promise<void>((resolve) => window.requestAnimationFrame(() => resolve()));
|
||||
await new Promise<void>((resolve) => window.requestAnimationFrame(() => resolve()));
|
||||
if (!canApply()) return;
|
||||
const stabilizedPayload = await requestBlueprint(transitionEye, true, true);
|
||||
if (!applyPayload(stabilizedPayload)) return;
|
||||
active.pendingFollowCameraEye = null;
|
||||
const payload = await requestBlueprint(cameraEye);
|
||||
if (applyPayload(payload)) active.cameraContract = cameraContract;
|
||||
})().catch((error: unknown) => {
|
||||
// The recording remains usable with its embedded default blueprint.
|
||||
// A later settings change retries through the same small channel.
|
||||
|
||||
@@ -7,18 +7,58 @@ export function createIsolatedRerunHost(host: HTMLElement) {
|
||||
let frame: HTMLIFrameElement | null = host.ownerDocument.createElement("iframe");
|
||||
frame.title = "Синхронизированная запись";
|
||||
frame.className = "rerun-viewport__runtime";
|
||||
frame.src = "/rerun-runtime.html";
|
||||
frame.loading = "eager";
|
||||
let navigation: number | undefined;
|
||||
let disposed = false;
|
||||
let releaseFacade: (() => void) | null = null;
|
||||
let releaseInput: (() => void) | null = null;
|
||||
let frameWindow: RerunFrameWindow | null = null;
|
||||
let rejectReady: ((reason: Error) => void) | null = null;
|
||||
let timer: ReturnType<typeof setTimeout> | undefined;
|
||||
const bootstrapAbort = new AbortController();
|
||||
let markup: string | null = null;
|
||||
let fetching = false;
|
||||
const scheduleNavigation = () => {
|
||||
if (disposed || navigation !== undefined) return;
|
||||
const window = host.ownerDocument.defaultView;
|
||||
const navigate = () => {
|
||||
navigation = undefined;
|
||||
if (disposed) return;
|
||||
// Observation portals may exist before the asynchronous dock is mounted.
|
||||
// Start the isolated realm only once its host belongs to the document.
|
||||
if (host.isConnected === false) {
|
||||
scheduleNavigation();
|
||||
return;
|
||||
}
|
||||
frame!.src = "/rerun-runtime.html";
|
||||
if (markup === null) {
|
||||
if (fetching) return;
|
||||
fetching = true;
|
||||
// Fetch only the bundled, same-origin document. Inline it into the
|
||||
// isolated realm so startup does not depend on a deferred iframe
|
||||
// document navigation inside a dock/portal. Its assets use root URLs.
|
||||
void fetch("/rerun-runtime.html", {signal: bootstrapAbort.signal, credentials: "same-origin", redirect: "error"})
|
||||
.then(response => { if (!response.ok) throw new Error("Recorded viewer host failed to load"); return response.text(); })
|
||||
.then(value => { if (!disposed) { markup = value; scheduleNavigation(); } })
|
||||
.catch(() => { if (!disposed) { rejectReady?.(new Error("Recorded viewer host failed to load")); dispose(); } });
|
||||
return;
|
||||
}
|
||||
frame!.srcdoc = markup;
|
||||
if (frame!.parentNode !== host) host.append(frame!);
|
||||
};
|
||||
// A background operator tab may suspend animation frames completely.
|
||||
// Bootstrap must progress independently of painting or focus.
|
||||
if (window?.setTimeout) navigation = window.setTimeout(navigate, 50);
|
||||
else navigate();
|
||||
};
|
||||
|
||||
const dispose = () => {
|
||||
if (disposed) return;
|
||||
disposed = true;
|
||||
if (navigation !== undefined) host.ownerDocument.defaultView?.clearTimeout(navigation);
|
||||
clearTimeout(timer);
|
||||
bootstrapAbort.abort();
|
||||
delete host.dataset.rerunCamera;
|
||||
frame!.onload = null;
|
||||
frame!.onerror = null;
|
||||
releaseInput?.();
|
||||
@@ -32,6 +72,7 @@ export function createIsolatedRerunHost(host: HTMLElement) {
|
||||
frameWindow = null;
|
||||
frame!.remove();
|
||||
frame = null;
|
||||
markup = null;
|
||||
rejectReady?.(new Error("Recorded viewer was disposed"));
|
||||
rejectReady = null;
|
||||
}
|
||||
@@ -39,21 +80,38 @@ export function createIsolatedRerunHost(host: HTMLElement) {
|
||||
|
||||
const ready = new Promise<{ viewer: RecordedRerunViewer; mount: HTMLElement }>((resolve, reject) => {
|
||||
rejectReady = reject;
|
||||
frame!.onload = () => {
|
||||
const handleLoad = () => {
|
||||
if (disposed) return;
|
||||
try {
|
||||
frameWindow = frame!.contentWindow as RerunFrameWindow | null;
|
||||
const api = frameWindow?.missionCoreRerun;
|
||||
if (!api && frame!.contentDocument?.URL === "about:blank") {
|
||||
return;
|
||||
}
|
||||
if (!api || api.version !== 2) throw new Error("Recorded viewer host is unavailable");
|
||||
const owner = createRecordedRerunFacade((request, bytes) => {
|
||||
const current = frameWindow?.missionCoreRerun;
|
||||
if (!current) throw new Error("Recorded viewer was disposed");
|
||||
return current.invoke(request, bytes);
|
||||
const response = current.invoke(request, bytes);
|
||||
// Bounded, read-only evidence of the rendered eye at the existing
|
||||
// playback poll. No extra timer, transport, history or camera writes.
|
||||
if (JSON.parse(request).method === "get_current_time") {
|
||||
try {
|
||||
const eye = JSON.parse(current.invoke('{"method":"get-camera-eye"}'));
|
||||
host.dataset.rerunCamera = JSON.stringify({
|
||||
timeNs: JSON.parse(response).result ?? null, eye: eye.result ?? null,
|
||||
});
|
||||
} catch { delete host.dataset.rerunCamera; }
|
||||
}
|
||||
return response;
|
||||
});
|
||||
releaseFacade = owner.dispose;
|
||||
api.connect(owner.notify);
|
||||
releaseInput = relayIsolatedRerunInput(host, frameWindow, frame);
|
||||
clearTimeout(timer);
|
||||
bootstrapAbort.abort();
|
||||
if (navigation !== undefined) host.ownerDocument.defaultView?.clearTimeout(navigation);
|
||||
navigation = undefined;
|
||||
rejectReady = null;
|
||||
frame!.onload = null;
|
||||
frame!.onerror = null;
|
||||
@@ -63,15 +121,21 @@ export function createIsolatedRerunHost(host: HTMLElement) {
|
||||
dispose();
|
||||
}
|
||||
};
|
||||
frame!.onerror = () => {
|
||||
const handleError = () => {
|
||||
reject(new Error("Recorded viewer host failed to load"));
|
||||
dispose();
|
||||
};
|
||||
const bind = (element: HTMLIFrameElement) => {
|
||||
element.onload = () => { if (frame === element) handleLoad(); };
|
||||
element.onerror = () => { if (frame === element) handleError(); };
|
||||
};
|
||||
bind(frame!);
|
||||
timer = setTimeout(() => {
|
||||
reject(new Error("Recorded viewer host timed out"));
|
||||
dispose();
|
||||
}, 30_000);
|
||||
|
||||
});
|
||||
host.append(frame);
|
||||
scheduleNavigation();
|
||||
return { ready, dispose };
|
||||
}
|
||||
|
||||
@@ -26,3 +26,14 @@ export function readNativeRerunCameraEye(value: unknown): RecordedRerunCameraEye
|
||||
};
|
||||
return { position: vector("position"), lookTarget: vector("lookTarget"), eyeUp: vector("eyeUp") };
|
||||
}
|
||||
|
||||
/** Select an eye for blueprint replacement, never implement camera motion. */
|
||||
export function selectRecordedRerunCameraEye(
|
||||
cameraContractChanged: boolean,
|
||||
planView: boolean,
|
||||
currentEye: RecordedRerunCameraEye | null,
|
||||
): RecordedRerunCameraEye | undefined {
|
||||
return cameraContractChanged
|
||||
? (planView ? RECORDED_RERUN_PLAN_EYE : RECORDED_RERUN_ORBITAL_EYE)
|
||||
: currentEye ?? undefined;
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@ export type RecordedRerunViewer = Pick<WebViewer,
|
||||
> & {
|
||||
open_channel: (name?: string) => Channel;
|
||||
get_camera_eye: () => RecordedRerunCameraEye | null;
|
||||
set_height_slice: (lower:number|null,upper:number|null)=>boolean;
|
||||
get_height_bounds: ()=>{min:number;max:number}|null;
|
||||
};
|
||||
|
||||
/** Parent-owned values only. No SDK Promise or foreign prototype escapes. */
|
||||
@@ -88,6 +90,8 @@ export function createRecordedRerunFacade(invoke: RerunInvoke | null) {
|
||||
set_current_time: (...args) => command("set_current_time", args),
|
||||
set_playing: (...args) => command("set_playing", args),
|
||||
get_camera_eye: () => command("get-camera-eye"),
|
||||
set_height_slice: (lower,upper) => command("set-height-slice",[lower,upper]),
|
||||
get_height_bounds: () => command("get-height-bounds"),
|
||||
};
|
||||
return { facade, dispose, notify };
|
||||
}
|
||||
|
||||
@@ -80,6 +80,13 @@ export function createRecordedRerunOwner(create: () => WebViewer, mount: HTMLEle
|
||||
case "get-camera-eye": result = readNativeRerunCameraEye(
|
||||
(required() as WebViewer & { get_camera_eye?(): unknown }).get_camera_eye?.(),
|
||||
); break;
|
||||
case "set-height-slice": {
|
||||
const [lower,upper]=args;
|
||||
if ([lower,upper].some(v=>v!==null&&(typeof v!=="number"||!Number.isFinite(v))) ||
|
||||
(lower!==null&&upper!==null&&lower>upper)) throw new Error("Invalid height slice");
|
||||
result=(required() as WebViewer & {set_height_slice?(lower:number|null,upper:number|null):boolean}).set_height_slice?.(lower,upper)??false;
|
||||
} break;
|
||||
case "get-height-bounds": result=(required() as WebViewer & {get_height_bounds?():{min:number;max:number}|null}).get_height_bounds?.()??null; break;
|
||||
case "open": required().open(args[0]); break;
|
||||
case "close": required().close(args[0]); break;
|
||||
case "override_panel_state": required().override_panel_state(args[0], args[1]); break;
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import {before,after,test} from 'node:test';
|
||||
import {createServer} from './support/vite-server.mjs';
|
||||
let server,create;
|
||||
before(async()=>{server=await createServer({appType:'custom',logLevel:'silent'});({liveRerunPlayback:create}=await server.ssrLoadModule('../../packages/sensor-ui/src/liveRerunPlayback.ts'));});
|
||||
after(async()=>{await server?.close();});
|
||||
function fixture(){
|
||||
const data={id:'a',range:{min:0,max:10e9},time:10e9,playing:false,calls:[]};
|
||||
const viewer={get_active_recording_id:()=>data.id,get_time_range:()=>({...data.range}),get_current_time:()=>data.time,get_playing:()=>data.playing,set_current_time:(_id,_timeline,time)=>{data.calls.push(['time',time]);data.time=time;},set_playing:(_id,playing)=>{data.calls.push(['play',playing]);data.playing=playing;}};
|
||||
return {data,controller:create(viewer)};
|
||||
}
|
||||
test('rewind pauses only the playhead, retains new data and returns to the latest received frame',()=>{
|
||||
const {data,controller:c}=fixture();assert.equal(c.read().live,true);
|
||||
const count=data.calls.length;c.read();assert.equal(data.calls.length,count,'an unchanged range must not enqueue native commands');
|
||||
c.seek(3e9);assert.equal(data.time,3e9);assert.equal(data.playing,false);
|
||||
data.range.max=20e9;const paused=c.read();assert.equal(paused.currentNs,3e9);assert.equal(paused.rangeNs.max,20e9);assert.equal(paused.live,false);
|
||||
c.setPlaying(true);assert.equal(data.time,3e9);assert.equal(data.playing,true);
|
||||
data.time=4e9;assert.equal(c.read().currentNs,4e9);
|
||||
assert.equal(c.jumpToLive().currentNs,20e9);data.range.max=21e9;assert.equal(c.read().currentNs,21e9);
|
||||
});
|
||||
test('native retention and acquisition changes cannot expose an expired history cursor',()=>{
|
||||
const {data,controller:c}=fixture();c.read();c.seek(-1);assert.equal(data.time,0);
|
||||
data.range.min=5e9;assert.equal(c.read().currentNs,5e9);
|
||||
c.seek(Infinity);assert.equal(data.time,5e9);
|
||||
data.id='b';data.range={min:50e9,max:51e9};assert.equal(c.read().live,true);assert.equal(data.time,51e9);
|
||||
});
|
||||
@@ -3,11 +3,11 @@ import { readFileSync } from "node:fs";
|
||||
import { after, before, test } from "node:test";
|
||||
import { createServer } from "./support/vite-server.mjs";
|
||||
|
||||
let server, readNativeRerunCameraEye;
|
||||
let server, readNativeRerunCameraEye, selectRecordedRerunCameraEye;
|
||||
before(async () => {
|
||||
server = await createServer({ appType: "custom", logLevel: "silent",
|
||||
server: { middlewareMode: true } });
|
||||
({ readNativeRerunCameraEye } = await server.ssrLoadModule(
|
||||
({ readNativeRerunCameraEye, selectRecordedRerunCameraEye } = await server.ssrLoadModule(
|
||||
"/src/components/rerun/recordedRerunCameraJournal.ts"));
|
||||
});
|
||||
after(async () => { await server?.close(); });
|
||||
@@ -34,9 +34,22 @@ test("iframe owner reads the native camera and installs no shadow input listener
|
||||
assert.doesNotMatch(owner + camera, /createRecordedRerunCameraJournal|addEventListener|Math\.exp/);
|
||||
});
|
||||
|
||||
test("display blueprint activation carries the current native eye, not the embedded preset", () => {
|
||||
test("follow and display changes preserve an off-centre world eye, including looking away", () => {
|
||||
const eye = { position: [120, 40, 25], lookTarget: [120, 40, 45], eyeUp: [0, 1, 0] };
|
||||
assert.deepEqual(selectRecordedRerunCameraEye(false, false, eye), eye);
|
||||
assert.deepEqual(selectRecordedRerunCameraEye(false, true, eye), eye);
|
||||
assert.equal(selectRecordedRerunCameraEye(false, false, null), undefined);
|
||||
});
|
||||
|
||||
test("only explicit reset or plan/3D changes choose a camera preset", () => {
|
||||
const eye = { position: [120, 40, 25], lookTarget: [120, 40, 45], eyeUp: [0, 1, 0] };
|
||||
assert.deepEqual(selectRecordedRerunCameraEye(true, false, eye).lookTarget, [0, 0, 0]);
|
||||
assert.deepEqual(selectRecordedRerunCameraEye(true, true, eye).position, [0, 0, 30]);
|
||||
});
|
||||
|
||||
test("recorded adapter preserves the native eye in one world-space activation", () => {
|
||||
const viewport = readFileSync(new URL("../src/components/RerunViewport.tsx", import.meta.url), "utf8");
|
||||
assert.match(viewport, /!enablingFollow \? active\.getCameraEye\?\.\(\) \?\? undefined : undefined/);
|
||||
assert.match(viewport, /requestBlueprint\(\s*firstEye,\s*firstEyeIsTrackingRelative,/);
|
||||
assert.match(viewport, /currentTimeNs: eyeRelativeToTracking \? currentTimeNs : undefined/);
|
||||
assert.match(viewport, /selectRecordedRerunCameraEye\(\s*cameraContractChanged, recordedPlanView, active\.getCameraEye/);
|
||||
assert.match(viewport, /eyeRelativeToTracking: false/);
|
||||
assert.doesNotMatch(viewport, /pendingFollowCameraEye|stabilizedPayload|firstEyeIsTrackingRelative/);
|
||||
});
|
||||
|
||||
@@ -26,6 +26,7 @@ function fixture(t, { stopFails = false } = {}) {
|
||||
timers.set(++timerId, fn); return timerId;
|
||||
});
|
||||
t.mock.method(globalThis, "clearTimeout", (id) => timers.delete(id));
|
||||
t.mock.method(globalThis, "fetch", async () => ({ok: true, text: async () => "<!doctype html><div id=viewer></div>"}));
|
||||
const listeners = new Map();
|
||||
const viewer = { stop() { stops++; if (stopFails) throw new Error("partial start"); } };
|
||||
const mount = {};
|
||||
@@ -39,7 +40,10 @@ function fixture(t, { stopFails = false } = {}) {
|
||||
};
|
||||
const host = { dataset: {}, ownerDocument: { createElement(name) {
|
||||
assert.equal(name, "iframe"); return frame;
|
||||
} }, append(child) { assert.equal(child, frame); } };
|
||||
} }, append(child) {
|
||||
assert.equal(child, frame);
|
||||
assert.equal(child.src, '/rerun-runtime.html', 'URL must precede browsing-context insertion');
|
||||
} };
|
||||
return { host, frame, viewer, mount, timers, listeners,
|
||||
counts: () => ({ creates, stops, removals }) };
|
||||
}
|
||||
@@ -87,6 +91,27 @@ test("recorded realm terminates on close even if upstream stop throws", async (t
|
||||
assert.equal(ready.viewer.ready, false);
|
||||
});
|
||||
|
||||
test("playback poll publishes only the latest native eye and removes it on disposal", async (t) => {
|
||||
const f = fixture(t);
|
||||
let time = 1;
|
||||
let position = [300, 7, 8];
|
||||
f.viewer.get_current_time = () => time;
|
||||
f.viewer.get_camera_eye = () => ({ position, lookTarget: [298, 9, 0], eyeUp: [0, 0, 1] });
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
f.frame.onload();
|
||||
const { viewer } = await scope.ready;
|
||||
assert.equal(viewer.get_current_time("recording", "session_time"), 1);
|
||||
assert.deepEqual(JSON.parse(f.host.dataset.rerunCamera).eye.position, [300, 7, 8]);
|
||||
time = 2;
|
||||
position = [310, 9, 8];
|
||||
assert.equal(viewer.get_current_time("recording", "session_time"), 2);
|
||||
const latest = JSON.parse(f.host.dataset.rerunCamera);
|
||||
assert.equal(latest.timeNs, 2);
|
||||
assert.deepEqual(latest.eye.position, position);
|
||||
scope.dispose();
|
||||
assert.equal(f.host.dataset.rerunCamera, undefined);
|
||||
});
|
||||
|
||||
test("native frame input relays Escape and leaves pointer ownership inside Rerun", () => {
|
||||
const listeners = new Map(), events = [];
|
||||
class ParentEvent { constructor(type, init) { this.type = type; Object.assign(this, init); } }
|
||||
@@ -146,6 +171,95 @@ test("close before frame load cancels startup and cannot reopen", async (t) => {
|
||||
assert.equal(f.timers.size, 0);
|
||||
});
|
||||
|
||||
test("detached observation portal navigates only after attachment and cancels pending navigation", async (t) => {
|
||||
const f = fixture(t), frames = new Map(); let sequence = 0;
|
||||
f.host.isConnected = f.frame.isConnected = false;
|
||||
f.host.ownerDocument.defaultView = {
|
||||
requestAnimationFrame() { throw new Error('Background tab does not paint'); },
|
||||
setTimeout(fn) { frames.set(++sequence, fn); return sequence; },
|
||||
clearTimeout(id) { frames.delete(id); },
|
||||
};
|
||||
const tick = () => { const [id, fn] = frames.entries().next().value; frames.delete(id); fn(); };
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
tick(); tick();
|
||||
assert.equal(f.frame.src, undefined);
|
||||
f.host.isConnected = f.frame.isConnected = true;
|
||||
tick(); assert.equal(f.frame.src, '/rerun-runtime.html');
|
||||
f.frame.onload(); await scope.ready; scope.dispose();
|
||||
assert.equal(frames.size, 0);
|
||||
|
||||
f.host.isConnected = f.frame.isConnected = false;
|
||||
const pending = createIsolatedRerunHost(f.host);
|
||||
const rejection = assert.rejects(pending.ready, /disposed/);
|
||||
pending.dispose(); await rejection;
|
||||
assert.equal(frames.size, 0);
|
||||
});
|
||||
|
||||
test("initial blank load is ignored while the bundled document is fetched within its deadline", async (t) => {
|
||||
const f = fixture(t), navigations = new Map(); let sequence = 0;
|
||||
f.host.ownerDocument.defaultView = {
|
||||
setTimeout(fn) { navigations.set(++sequence, fn); return sequence; },
|
||||
clearTimeout(id) { navigations.delete(id); },
|
||||
};
|
||||
const tick = () => { const [id, fn] = navigations.entries().next().value; navigations.delete(id); fn(); };
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
const deadline = [...f.timers.keys()];
|
||||
tick();
|
||||
const api = f.frame.contentWindow.missionCoreRerun;
|
||||
delete f.frame.contentWindow.missionCoreRerun;
|
||||
f.frame.contentDocument = {URL: "about:blank"};
|
||||
f.frame.onload(); f.frame.onload();
|
||||
assert.equal(navigations.size, 0);
|
||||
assert.deepEqual([...f.timers.keys()], deadline);
|
||||
assert.equal(f.frame.src, "/rerun-runtime.html");
|
||||
f.frame.contentWindow.missionCoreRerun = api;
|
||||
f.frame.contentDocument.URL = "http://localhost/rerun-runtime.html";
|
||||
f.frame.onload(); await scope.ready;
|
||||
assert.equal(navigations.size, 0);
|
||||
scope.dispose();
|
||||
assert.equal(f.timers.size, 0);
|
||||
});
|
||||
|
||||
test("bundled document is fetched once and installed before the isolated realm is attached", async (t) => {
|
||||
const f = fixture(t); let requests = 0, attached = 0;
|
||||
t.mock.method(globalThis, 'fetch', async (url, options) => {
|
||||
assert.equal(url, '/rerun-runtime.html');
|
||||
assert.equal(options.redirect, 'error'); requests++;
|
||||
return {ok:true, text:async()=>'<html>runtime</html>'};
|
||||
});
|
||||
f.host.append = frame => { assert.equal(frame.srcdoc, '<html>runtime</html>'); attached++; };
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
await new Promise(setImmediate);
|
||||
assert.equal(requests, 1); assert.equal(attached, 1);
|
||||
f.frame.onload(); await scope.ready; scope.dispose();
|
||||
assert.equal(f.timers.size, 0);
|
||||
});
|
||||
|
||||
test("closing during document fetch cancels it and late content cannot attach a frame", async (t) => {
|
||||
const f = fixture(t); let finish, signal, attached = 0;
|
||||
t.mock.method(globalThis, 'fetch', (_url, options) => {
|
||||
signal=options.signal; return new Promise(resolve=>{finish=resolve;});
|
||||
});
|
||||
f.host.append = () => attached++;
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
const rejected = assert.rejects(scope.ready, /disposed/);
|
||||
scope.dispose(); await rejected;
|
||||
assert.equal(signal.aborted, true);
|
||||
finish({ok:true,text:async()=>'<html>late</html>'});
|
||||
await new Promise(setImmediate);
|
||||
assert.equal(attached, 0); assert.equal(f.counts().creates, 0);
|
||||
assert.equal(f.timers.size, 0);
|
||||
});
|
||||
|
||||
test("document fetch failure releases the empty realm and its deadline", async (t) => {
|
||||
const f = fixture(t);
|
||||
t.mock.method(globalThis, 'fetch', async()=>({ok:false}));
|
||||
const scope = createIsolatedRerunHost(f.host);
|
||||
await assert.rejects(scope.ready, /failed to load/);
|
||||
assert.equal(f.counts().removals, 1);
|
||||
assert.equal(f.timers.size, 0);
|
||||
});
|
||||
|
||||
test("closing during SDK startup also releases a late successful start", async () => {
|
||||
let finish, stops = 0;
|
||||
const owner = bridge({
|
||||
|
||||
@@ -252,9 +252,9 @@ test("recorded RRD bytes are never split across LogChannel.send_rrd calls", asyn
|
||||
assert.match(source, /recordedPerceptionLayers\.costmap !== undefined && status !== "ready"/);
|
||||
assert.match(source, /perceptionLayers\.costmap === undefined \? \{\} : \{\s*show_costmap: perceptionLayers\.costmap,\s*reactivate_updates: true/s);
|
||||
// Ordinary archives need activation too, not only the LAB costmap path.
|
||||
assert.match(source, /requestBlueprint\(\s*firstEye,\s*firstEyeIsTrackingRelative,[\s\S]*?\n\s*true,\s*\);/);
|
||||
assert.match(source, /cameraEye,\s*[\s\S]*?eyeRelativeToTracking: false,\s*reactivateUpdates: true,/);
|
||||
// Display changes must not trigger a full-file camera-bounds scan.
|
||||
assert.match(source, /currentTimeNs: eyeRelativeToTracking \? currentTimeNs : undefined/);
|
||||
assert.doesNotMatch(source, /currentTimeNs: eyeRelativeToTracking|Recorded tracking cursor is unavailable/);
|
||||
assert.match(source, /viewer\.start\(\s*rerunViewerInitialSource\(resolvedSource\)/s);
|
||||
assert.doesNotMatch(source, /rerunViewerOpenOptions/);
|
||||
assert.match(
|
||||
|
||||
@@ -37,6 +37,8 @@ test("generated JS and native WASM share one ABI including the camera snapshot",
|
||||
const wasm = new WebAssembly.Module(readFileSync(resolve(packageRoot, "re_viewer_bg.wasm")));
|
||||
const names = new Set(WebAssembly.Module.exports(wasm).map(item => item.name));
|
||||
assert.ok(names.has("webhandle_nodedc_camera_eye"));
|
||||
assert.ok(names.has("webhandle_nodedc_height_slice"));
|
||||
assert.ok(names.has("webhandle_nodedc_height_bounds"));
|
||||
for (const [, name] of glue.matchAll(/\bwasm\.([a-zA-Z_$][\w$]*)/g)) {
|
||||
assert.ok(names.has(name), `Missing WASM export: ${name}`);
|
||||
}
|
||||
|
||||
+418
-49
@@ -1,3 +1,93 @@
|
||||
--- a/crates/viewer/re_renderer/shader/point_cloud.wgsl
|
||||
+++ b/crates/viewer/re_renderer/shader/point_cloud.wgsl
|
||||
@@ -19,7 +19,7 @@
|
||||
// 256bytes in order to allow them to be buffer-suballocations.
|
||||
// However, wgpu doesn't know this at this point and therefore requires `DownlevelFlags::BUFFER_BINDINGS_NOT_16_BYTE_ALIGNED`
|
||||
// if we wouldn't add padding here, which isn't available on WebGL.
|
||||
- _padding: vec4f,
|
||||
+ height_slice: vec4f,
|
||||
};
|
||||
@group(1) @binding(3)
|
||||
var<uniform> draw_data: DrawDataUniformBuffer;
|
||||
@@ -147,6 +147,12 @@
|
||||
out.point_center = point_data.pos;
|
||||
out.quad_offset_from_center = quad.pos_in_world - point_data.pos;
|
||||
out.picking_instance_id = point_data.picking_instance_id;
|
||||
+ // Whole point quads outside the display slice are clipped in every pass.
|
||||
+ // This preserves point IDs and affects retained history immediately.
|
||||
+ if draw_data.height_slice.z > 0.0 &&
|
||||
+ (point_data.pos.z < draw_data.height_slice.x || point_data.pos.z > draw_data.height_slice.y) {
|
||||
+ out.position = vec4f(2.0, 2.0, 2.0, 1.0);
|
||||
+ }
|
||||
|
||||
return out;
|
||||
}
|
||||
--- a/crates/viewer/re_renderer/src/point_cloud_builder.rs
|
||||
+++ b/crates/viewer/re_renderer/src/point_cloud_builder.rs
|
||||
@@ -24,6 +24,7 @@
|
||||
pub(crate) batches: Vec<PointCloudBatchInfo>,
|
||||
|
||||
pub(crate) radius_boost_in_ui_points_for_outlines: f32,
|
||||
+ pub(crate) nodedc_height_slice: Option<[f32; 2]>,
|
||||
}
|
||||
|
||||
impl<'ctx> PointCloudBuilder<'ctx> {
|
||||
@@ -35,7 +36,14 @@
|
||||
picking_instance_ids_buffer: DataTextureSource::new(ctx),
|
||||
batches: Vec::with_capacity(16),
|
||||
radius_boost_in_ui_points_for_outlines: 0.0,
|
||||
- }
|
||||
+ nodedc_height_slice: None,
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /// Clip in world coordinates in the existing point vertex shader, including
|
||||
+ /// picking/outlines. Cached geometry and source point indices stay intact.
|
||||
+ pub fn nodedc_height_slice(&mut self, range: Option<[f32; 2]>) {
|
||||
+ self.nodedc_height_slice = range.filter(|r| r[0].is_finite() && r[1].is_finite() && r[0] <= r[1]);
|
||||
}
|
||||
|
||||
/// Returns number of points that can be added without reallocation.
|
||||
--- a/crates/viewer/re_renderer/src/renderer/point_cloud.rs
|
||||
+++ b/crates/viewer/re_renderer/src/renderer/point_cloud.rs
|
||||
@@ -132,7 +132,8 @@
|
||||
#[derive(Clone, Copy, bytemuck::Pod, bytemuck::Zeroable)]
|
||||
pub struct DrawDataUniformBuffer {
|
||||
pub radius_boost_in_ui_points: wgpu_buffer_types::F32RowPadded,
|
||||
- pub end_padding: [wgpu_buffer_types::PaddingRow; 16 - 1],
|
||||
+ pub height_slice: wgpu_buffer_types::Vec4,
|
||||
+ pub end_padding: [wgpu_buffer_types::PaddingRow; 16 - 2],
|
||||
}
|
||||
|
||||
/// Uniform buffer that changes for every batch of points.
|
||||
@@ -340,6 +341,7 @@
|
||||
picking_instance_ids_buffer,
|
||||
batches,
|
||||
radius_boost_in_ui_points_for_outlines,
|
||||
+ nodedc_height_slice,
|
||||
} = builder;
|
||||
|
||||
let point_renderer = ctx.renderer::<PointCloudRenderer>();
|
||||
@@ -388,16 +390,19 @@
|
||||
"PointCloudDrawData::picking_instance_id_texture",
|
||||
)?;
|
||||
|
||||
+ let height_slice = nodedc_height_slice.map_or(glam::Vec4::ZERO, |r| glam::vec4(r[0], r[1], 1.0, 0.0));
|
||||
let draw_data_uniform_buffer_bindings = create_and_fill_uniform_buffer_batch(
|
||||
ctx,
|
||||
"PointCloudDrawData::DrawDataUniformBuffer".into(),
|
||||
[
|
||||
gpu_data::DrawDataUniformBuffer {
|
||||
radius_boost_in_ui_points: 0.0.into(),
|
||||
+ height_slice: height_slice.into(),
|
||||
end_padding: Default::default(),
|
||||
},
|
||||
gpu_data::DrawDataUniformBuffer {
|
||||
radius_boost_in_ui_points: radius_boost_in_ui_points_for_outlines.into(),
|
||||
+ height_slice: height_slice.into(),
|
||||
end_padding: Default::default(),
|
||||
},
|
||||
]
|
||||
--- a/crates/viewer/re_view_spatial/src/eye.rs
|
||||
+++ b/crates/viewer/re_view_spatial/src/eye.rs
|
||||
@@ -2,7 +2,7 @@
|
||||
@@ -9,7 +99,16 @@
|
||||
use re_sdk_types::blueprint::components::{AngularSpeed, Eye3DKind};
|
||||
use re_sdk_types::components::{LinearSpeed, Position3D, Vector3D};
|
||||
use re_view::controls::{
|
||||
@@ -214,6 +214,8 @@
|
||||
@@ -199,6 +199,8 @@
|
||||
/// This should not be used to get the current tracked entity, get that
|
||||
/// via view properties instead.
|
||||
pub last_tracked_entity: Option<EntityPath>,
|
||||
+ // NODE.DC: prior entity position, not a replacement camera controller.
|
||||
+ last_tracked_position: Option<Vec3>,
|
||||
|
||||
interpolation: Option<EyeInterpolation>,
|
||||
|
||||
@@ -214,6 +216,8 @@
|
||||
pub last_look_target: Option<Vec3>,
|
||||
pub last_orbit_radius: Option<f32>,
|
||||
pub last_eye_up: Option<Vec3>,
|
||||
@@ -18,7 +117,7 @@
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, re_byte_size::SizeBytes)]
|
||||
@@ -241,6 +243,7 @@
|
||||
@@ -241,6 +245,7 @@
|
||||
fov_y: Option<f32>,
|
||||
|
||||
did_interact: bool,
|
||||
@@ -26,7 +125,7 @@
|
||||
}
|
||||
|
||||
impl EyeController {
|
||||
@@ -250,16 +253,8 @@
|
||||
@@ -250,16 +255,8 @@
|
||||
/// Avoids breaking the view by zooming in too far.
|
||||
pub const MIN_ORBIT_DISTANCE: f32 = Eye::PERSPECTIVE_NEAR_PLANE * 2.0;
|
||||
|
||||
@@ -45,7 +144,7 @@
|
||||
|
||||
fn get_eye(&self) -> Eye {
|
||||
Eye {
|
||||
@@ -317,6 +312,10 @@
|
||||
@@ -317,6 +314,10 @@
|
||||
.0,
|
||||
);
|
||||
|
||||
@@ -56,7 +155,7 @@
|
||||
Ok(Self {
|
||||
pos,
|
||||
look_target,
|
||||
@@ -325,6 +324,7 @@
|
||||
@@ -325,6 +326,7 @@
|
||||
eye_up,
|
||||
did_interact: false,
|
||||
fov_y,
|
||||
@@ -64,7 +163,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
@@ -482,12 +482,45 @@
|
||||
@@ -482,10 +484,68 @@
|
||||
let up = rot * Vec3::Y;
|
||||
let right = rot * -Vec3::X; // TODO(emilk): why do we need a negation here? O.o
|
||||
|
||||
@@ -84,8 +183,24 @@
|
||||
|
||||
self.pos += translate;
|
||||
self.look_target += translate;
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
+ /// Move the existing eye by the tracked entity's translation, retaining
|
||||
+ /// the operator's offset, orientation and radius. Admission does not jump.
|
||||
+ fn follow_translation(&mut self, previous: Option<Vec3>, current: Vec3) {
|
||||
+ if let Some(previous) = previous {
|
||||
+ let delta = current - previous;
|
||||
+ if delta.is_finite() && delta != Vec3::ZERO {
|
||||
+ self.pos += delta;
|
||||
+ self.look_target += delta;
|
||||
+ // The next frame reconstructs this rig from the blueprint.
|
||||
+ // Its existing write gate must also commit autonomous tracking,
|
||||
+ // otherwise every frame falls back to the last manual eye.
|
||||
+ self.did_interact = true;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /// Translate the whole rig, not its orientation/radius, onto the grid.
|
||||
+ /// Called only by deliberate navigation while not following an entity.
|
||||
+ fn anchor_orbit_to_grid(&mut self) {
|
||||
@@ -97,6 +212,15 @@
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /// Ground only an automatic fallback; explicit/saved eyes retain height.
|
||||
+ fn anchor_fallback_orbit_to_grid(&mut self, has_explicit_target: bool) {
|
||||
+ if !has_explicit_target && self.kind == Eye3DKind::Orbital {
|
||||
+ let before = self.look_target;
|
||||
+ self.anchor_orbit_to_grid();
|
||||
+ self.did_interact |= self.look_target != before;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ fn zoom_orbit(&mut self, zoom_factor: f32) {
|
||||
+ if !zoom_factor.is_finite() || zoom_factor <= 0.0 {
|
||||
+ return;
|
||||
@@ -105,12 +229,10 @@
|
||||
+ .clamp(Self::MIN_ORBIT_DISTANCE, Self::MAX_ORBITAL_RADIUS);
|
||||
+ self.pos = self.look_target - self.fwd() * new_radius;
|
||||
+ self.did_interact = true;
|
||||
+ }
|
||||
+
|
||||
}
|
||||
|
||||
fn handle_drag(&mut self, response: &egui::Response, drag_threshold: f32) {
|
||||
if response.drag_delta().length() > drag_threshold {
|
||||
let roll = response.dragged_by(ROLL_MOUSE)
|
||||
@@ -513,7 +546,7 @@
|
||||
@@ -513,7 +573,7 @@
|
||||
}
|
||||
|
||||
/// Handle zoom/scroll input.
|
||||
@@ -119,7 +241,7 @@
|
||||
let zoom_factor = egui_ctx.input(|input| {
|
||||
// egui's default horizontal_scroll_modifier is shift, which is also our speed-up modifier.
|
||||
// This means that a user who wants to speed up scroll-to-zoom will generate a horizontal scroll delta.
|
||||
@@ -528,22 +561,7 @@
|
||||
@@ -528,22 +588,7 @@
|
||||
|
||||
match self.kind {
|
||||
Eye3DKind::Orbital => {
|
||||
@@ -143,7 +265,7 @@
|
||||
}
|
||||
Eye3DKind::FirstPerson => {
|
||||
// Move along the forward axis when zooming in first person mode.
|
||||
@@ -707,25 +725,6 @@
|
||||
@@ -707,25 +752,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -169,7 +291,7 @@
|
||||
pub fn find_camera(cameras: &[PinholeWrapper], needle: &EntityPath) -> Option<Eye> {
|
||||
let mut found_camera = None;
|
||||
|
||||
@@ -744,6 +743,103 @@
|
||||
@@ -744,6 +770,173 @@
|
||||
|
||||
fn ease_out(t: f32) -> f32 {
|
||||
1. - (1. - t) * (1. - t)
|
||||
@@ -193,6 +315,76 @@
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
+ fn following_commits_motion_without_manual_input_across_frames() {
|
||||
+ let initial = controller();
|
||||
+ let mut saved = (initial.pos, initial.look_target, initial.eye_up);
|
||||
+ let mut previous = Vec3::ZERO;
|
||||
+ for target in [vec3(1.0, 2.0, 0.5), vec3(5.0, -3.0, 1.0), vec3(9.0, 7.0, 2.0)] {
|
||||
+ // Each native frame reads the last saved blueprint, not the previous
|
||||
+ // temporary controller. No mouse interaction opens the write gate.
|
||||
+ let mut frame = controller();
|
||||
+ (frame.pos, frame.look_target, frame.eye_up) = saved;
|
||||
+ frame.follow_translation(Some(previous), target);
|
||||
+ assert!(frame.did_interact, "tracking must reach save_to_blueprint");
|
||||
+ assert!((frame.pos - initial.pos - target).length() < 0.001);
|
||||
+ assert!((frame.look_target - initial.look_target - target).length() < 0.001);
|
||||
+ assert_eq!(frame.eye_up, initial.eye_up);
|
||||
+ assert!((frame.radius() - initial.radius()).abs() < 0.001);
|
||||
+ saved = (frame.pos, frame.look_target, frame.eye_up);
|
||||
+ previous = target;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
+ fn following_admission_idle_and_invalid_pose_do_not_write_camera() {
|
||||
+ for (previous, current) in [
|
||||
+ (None, vec3(12.0, 8.0, 2.0)),
|
||||
+ (Some(Vec3::ZERO), Vec3::ZERO),
|
||||
+ (Some(Vec3::ZERO), Vec3::splat(f32::NAN)),
|
||||
+ (Some(Vec3::ZERO), Vec3::splat(f32::INFINITY)),
|
||||
+ ] {
|
||||
+ let mut c = controller();
|
||||
+ let before = (c.pos, c.look_target, c.eye_up);
|
||||
+ c.follow_translation(previous, current);
|
||||
+ assert_eq!((c.pos, c.look_target, c.eye_up), before);
|
||||
+ assert!(!c.did_interact);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
+ fn following_keeps_admission_eye_and_manual_offset() {
|
||||
+ let mut c = controller();
|
||||
+ let before = (c.pos, c.look_target, c.eye_up);
|
||||
+ c.follow_translation(None, vec3(12.0, 8.0, 2.0));
|
||||
+ assert_eq!((c.pos, c.look_target, c.eye_up), before);
|
||||
+ c.translate(egui::vec2(4.0, 3.0));
|
||||
+ c.rotate(egui::vec2(2.0, 1.0));
|
||||
+ c.zoom_orbit(2.0);
|
||||
+ let before = (c.pos, c.look_target, c.eye_up, c.radius());
|
||||
+ let movement = vec3(900.0, -230.0, 3.0);
|
||||
+ c.follow_translation(Some(Vec3::ZERO), movement);
|
||||
+ assert!((c.pos - before.0 - movement).length() < 0.001);
|
||||
+ assert!((c.look_target - before.1 - movement).length() < 0.001);
|
||||
+ assert_eq!(c.eye_up, before.2);
|
||||
+ assert!((c.radius() - before.3).abs() < 0.001);
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
+ fn saved_eye_keeps_height_when_tracking_is_disabled() {
|
||||
+ let mut c = controller();
|
||||
+ c.pos += vec3(0.0, 0.0, 40.0);
|
||||
+ c.look_target += vec3(0.0, 0.0, 40.0);
|
||||
+ let before = (c.pos, c.look_target, c.radius());
|
||||
+ c.anchor_fallback_orbit_to_grid(true);
|
||||
+ assert_eq!((c.pos, c.look_target, c.radius()), before);
|
||||
+ assert!(!c.did_interact);
|
||||
+ c.anchor_fallback_orbit_to_grid(false);
|
||||
+ assert_eq!(c.look_target.z, 0.0);
|
||||
+ assert!((c.radius() - before.2).abs() < 0.0001);
|
||||
+ assert!(c.did_interact);
|
||||
+ }
|
||||
+
|
||||
+ #[test]
|
||||
+ fn pan_is_on_grid_and_moves_the_whole_rig() {
|
||||
+ let mut c = controller();
|
||||
+ let offset = c.pos - c.look_target;
|
||||
@@ -273,23 +465,24 @@
|
||||
}
|
||||
|
||||
impl EyeState {
|
||||
@@ -804,9 +900,32 @@
|
||||
@@ -804,8 +997,32 @@
|
||||
}
|
||||
}
|
||||
|
||||
+ // Anchor before the first paint, not on the first orbit drag. This
|
||||
+ // avoids a one-off camera jump when the scene-bounds fallback is high.
|
||||
+ if tracking_entity.is_none() && eye_controller.kind == Eye3DKind::Orbital
|
||||
+ && (eye_controller.grid_plane.normal.dot(eye_controller.look_target)
|
||||
+ - eye_controller.grid_plane.d).abs() > 1.0e-5
|
||||
+ {
|
||||
+ eye_controller.anchor_orbit_to_grid();
|
||||
+ eye_controller.did_interact = true;
|
||||
+ // Anchor scene-bounds fallbacks before first paint, but never project
|
||||
+ // an explicitly saved eye onto the grid when tracking is switched off.
|
||||
+ if tracking_entity.is_none() {
|
||||
+ let has_explicit_target = eye_property
|
||||
+ .component_or_empty::<Position3D>(
|
||||
+ EyeControls3D::descriptor_look_target().component,
|
||||
+ )?
|
||||
+ .is_some();
|
||||
+ eye_controller.anchor_fallback_orbit_to_grid(has_explicit_target);
|
||||
+ }
|
||||
+
|
||||
// Handle spinning before inputs because some inputs depend on view direction.
|
||||
self.handle_spinning(ctx, eye_property, &mut eye_controller)?;
|
||||
|
||||
+
|
||||
+ // NODE.DC: pin manual map navigation to the XY grid. Tracking and
|
||||
+ // explicit camera presets retain their own target until manual input.
|
||||
+ let manual_input = response.drag_delta().length_sq() > 0.0
|
||||
@@ -302,11 +495,125 @@
|
||||
+ eye_controller.anchor_orbit_to_grid();
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
|
||||
// We do input before tracking entity, because the input can cause the eye
|
||||
// to stop tracking.
|
||||
let gamepad_navigation_status = eye_controller.handle_input(
|
||||
@@ -1241,6 +1360,7 @@
|
||||
@@ -892,15 +1109,14 @@
|
||||
|
||||
let new_tracking = self.last_tracked_entity.as_ref() != Some(&tracking_entity);
|
||||
if new_tracking {
|
||||
- self.start_interpolation();
|
||||
+ self.last_tracked_position = None;
|
||||
self.last_tracked_entity = Some(tracking_entity.clone());
|
||||
- }
|
||||
-
|
||||
- // If the position that doesn't move by changing the eye's rotation changed.
|
||||
- let did_eye_orbit_center_change = match eye_controller.kind {
|
||||
- Eye3DKind::FirstPerson => eye_controller.pos != old_pos,
|
||||
- Eye3DKind::Orbital => eye_controller.look_target != old_look_target,
|
||||
- };
|
||||
+ if find_camera(cameras, &tracking_entity).is_some() {
|
||||
+ self.start_interpolation();
|
||||
+ } else {
|
||||
+ self.stop_interpolation();
|
||||
+ }
|
||||
+ }
|
||||
|
||||
if let Some(target_eye) = find_camera(cameras, &tracking_entity) {
|
||||
if eye_controller.did_interact
|
||||
@@ -942,51 +1158,12 @@
|
||||
.region_of_interest_per_entity
|
||||
.get(&tracking_entity.hash())
|
||||
{
|
||||
- // If we're tracking something new, set the current position & look target to the correct view.
|
||||
- if new_tracking {
|
||||
- let fwd = eye_controller.fwd();
|
||||
- let radius = entity_bbox.centered_bounding_sphere_radius() * 1.5;
|
||||
- let radius = if radius < 0.0001 {
|
||||
- // Handle zero-sized bounding boxes:
|
||||
- (bounding_boxes
|
||||
- .region_of_interest_current
|
||||
- .centered_bounding_sphere_radius()
|
||||
- * 1.5)
|
||||
- .at_least(0.02)
|
||||
- } else {
|
||||
- radius
|
||||
- };
|
||||
- eye_controller.pos = eye_controller.look_target - fwd * radius;
|
||||
- // Force write of pos and look target to not use fallbacks for that.
|
||||
- eye_property.save_blueprint_component(
|
||||
- ctx.viewer_ctx,
|
||||
- &EyeControls3D::descriptor_position(),
|
||||
- &Position3D::from(eye_controller.pos),
|
||||
- );
|
||||
-
|
||||
- eye_property.save_blueprint_component(
|
||||
- ctx.viewer_ctx,
|
||||
- &EyeControls3D::descriptor_look_target(),
|
||||
- &Position3D::from(eye_controller.look_target),
|
||||
- );
|
||||
- }
|
||||
-
|
||||
- let orbit_radius = eye_controller.pos.distance(eye_controller.look_target);
|
||||
-
|
||||
+ // Preserve the entire eye at admission, including off-center pan.
|
||||
+ // Subsequent target translation moves the same native rig. Manual
|
||||
+ // orbit/pan/zoom has already run above and remains authoritative.
|
||||
let pos = entity_bbox.center();
|
||||
-
|
||||
- let fwd = eye_controller.fwd();
|
||||
-
|
||||
- match eye_controller.kind {
|
||||
- Eye3DKind::FirstPerson => {
|
||||
- eye_controller.pos = pos;
|
||||
- eye_controller.look_target = pos + fwd;
|
||||
- }
|
||||
- Eye3DKind::Orbital => {
|
||||
- eye_controller.look_target = pos;
|
||||
- eye_controller.pos = pos - fwd * orbit_radius;
|
||||
- }
|
||||
- }
|
||||
+ eye_controller.follow_translation(self.last_tracked_position, pos);
|
||||
+ self.last_tracked_position = Some(pos);
|
||||
}
|
||||
|
||||
self.last_look_target = Some(eye_controller.look_target);
|
||||
@@ -994,26 +1171,17 @@
|
||||
self.last_orbit_radius =
|
||||
Some(eye_controller.pos.distance(eye_controller.look_target));
|
||||
|
||||
- // When we stop tracking, set the blueprint eye state to the tracked view.
|
||||
- if eye_controller.did_interact && did_eye_orbit_center_change {
|
||||
- eye_controller.save_to_blueprint(
|
||||
- ctx.viewer_ctx,
|
||||
- eye_property,
|
||||
- old_pos,
|
||||
- old_look_target,
|
||||
- old_eye_up,
|
||||
- );
|
||||
-
|
||||
- eye_property.clear_blueprint_component(
|
||||
- ctx.viewer_ctx,
|
||||
- EyeControls3D::descriptor_tracking_entity(),
|
||||
- );
|
||||
- } else {
|
||||
- return Some(eye_controller.get_eye());
|
||||
- }
|
||||
+ // Commit only changed native components. This keeps the next frame
|
||||
+ // relative to the displayed eye, without HTTP, pointer replay or a
|
||||
+ // second navigation loop. Panning never silently disables Follow.
|
||||
+ eye_controller.save_to_blueprint(
|
||||
+ ctx.viewer_ctx, eye_property, old_pos, old_look_target, old_eye_up,
|
||||
+ );
|
||||
+ return Some(eye_controller.get_eye());
|
||||
}
|
||||
} else {
|
||||
self.last_tracked_entity = None;
|
||||
+ self.last_tracked_position = None;
|
||||
}
|
||||
|
||||
None
|
||||
@@ -1241,6 +1409,7 @@
|
||||
};
|
||||
|
||||
self.last_eye = Some(eye);
|
||||
@@ -314,28 +621,66 @@
|
||||
|
||||
Ok(eye)
|
||||
}
|
||||
--- a/crates/viewer/re_viewer_context/src/view/view_states.rs
|
||||
+++ b/crates/viewer/re_viewer_context/src/view/view_states.rs
|
||||
@@ -173,6 +173,13 @@
|
||||
}
|
||||
--- a/crates/viewer/re_view_spatial/src/ui.rs
|
||||
+++ b/crates/viewer/re_view_spatial/src/ui.rs
|
||||
@@ -51,6 +51,8 @@
|
||||
#[derive(Clone, Default, re_byte_size::SizeBytes)]
|
||||
pub struct SpatialViewState {
|
||||
pub bounding_boxes: SceneBoundingBoxes,
|
||||
+ /// Optional display-only world-Z slice. No data/store/accumulation mutation.
|
||||
+ pub nodedc_height_slice: Option<[f32; 2]>,
|
||||
pub show_bounding_box: bool,
|
||||
|
||||
impl ViewStates {
|
||||
+ /// NODE.DC: read-only per-recording state access for native camera snapshots.
|
||||
+ pub fn states_for_store<'a>(&'a self, store_id: &'a StoreId) -> impl Iterator<Item = &'a dyn ViewState> {
|
||||
+ self.states.iter().filter_map(move |((id, _), state)| {
|
||||
+ (id == store_id).then_some(state.as_ref())
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
pub fn get(&self, store_id: &StoreId, view_id: ViewId) -> Option<&dyn ViewState> {
|
||||
self.states
|
||||
.get(&(store_id.clone(), view_id))
|
||||
pub show_smoothed_bbox: bool,
|
||||
--- a/crates/viewer/re_view_spatial/src/visualizers/points3d.rs
|
||||
+++ b/crates/viewer/re_view_spatial/src/visualizers/points3d.rs
|
||||
@@ -416,6 +416,9 @@
|
||||
let output = VisualizerExecutionOutput::default();
|
||||
|
||||
let mut point_builder = PointCloudBuilder::new(ctx.viewer_ctx.render_ctx());
|
||||
+ if let Some(state) = ctx.view_state.as_any().downcast_ref::<crate::SpatialViewState>() {
|
||||
+ point_builder.nodedc_height_slice(state.nodedc_height_slice);
|
||||
+ }
|
||||
point_builder.radius_boost_in_ui_points_for_outlines(
|
||||
re_view::SIZE_BOOST_IN_POINTS_FOR_POINT_OUTLINES,
|
||||
);
|
||||
--- a/crates/viewer/re_viewer/src/web.rs
|
||||
+++ b/crates/viewer/re_viewer/src/web.rs
|
||||
@@ -384,6 +384,26 @@
|
||||
let recording = hub.entity_db(recording_id)?;
|
||||
|
||||
@@ -386,6 +386,59 @@
|
||||
Some(recording.store_id().recording_id().to_string())
|
||||
}
|
||||
|
||||
+ /// Local presentation only; finite bounds are validated before any state changes.
|
||||
+ #[wasm_bindgen]
|
||||
+ pub fn nodedc_height_slice(&self, lower: Option<f32>, upper: Option<f32>) -> bool {
|
||||
+ let range = match (lower, upper) {
|
||||
+ (None, None) => None,
|
||||
+ (Some(lo), Some(hi)) if lo.is_finite() && hi.is_finite() && lo <= hi => Some([lo, hi]),
|
||||
+ _ => return false,
|
||||
+ };
|
||||
+ let Some(mut app) = self.runner.app_mut::<crate::App>() else { return false; };
|
||||
+ let Some(store_id) = app.active_recording_id().cloned() else { return false; };
|
||||
+ let mut found = false;
|
||||
+ for state in app.state.view_states.states_for_store_mut(&store_id) {
|
||||
+ if let Some(state) = state.as_any_mut().downcast_mut::<re_view_spatial::SpatialViewState>() {
|
||||
+ state.nodedc_height_slice = range;
|
||||
+ found = true;
|
||||
+ }
|
||||
+ }
|
||||
+ if found { app.egui_ctx.request_repaint(); }
|
||||
+ found
|
||||
+ }
|
||||
+
|
||||
+ #[wasm_bindgen]
|
||||
+ pub fn nodedc_height_bounds(&self) -> Option<String> {
|
||||
+ let app = self.runner.app_mut::<crate::App>()?;
|
||||
+ let store_id = app.active_recording_id()?;
|
||||
+ let state = app.state.view_states.states_for_store(store_id)
|
||||
+ .filter_map(|state| state.as_any().downcast_ref::<re_view_spatial::SpatialViewState>())
|
||||
+ .max_by(|a,b| a.state_3d.eye_state.last_render_time.total_cmp(&b.state_3d.eye_state.last_render_time))?;
|
||||
+ let bounds = state.bounding_boxes.region_of_interest_current;
|
||||
+ if !bounds.is_finite() { return None; }
|
||||
+ Some(serde_json::json!({"min":bounds.min.z,"max":bounds.max.z}).to_string())
|
||||
+ }
|
||||
+
|
||||
+ /// NODE.DC navigation/v1. Last rendered native eye, never a replay of DOM deltas.
|
||||
@@ -356,6 +701,30 @@
|
||||
+ "lookTarget": eye_state.last_look_target?.to_array(),
|
||||
+ "eyeUp": eye_state.last_eye_up?.to_array(),
|
||||
+ }).to_string())
|
||||
}
|
||||
|
||||
+ }
|
||||
+
|
||||
//TODO(#10737): we should refer to logical recordings using store id (recording id is ambiguous)
|
||||
#[wasm_bindgen]
|
||||
pub fn set_active_recording_id(&self, recording_id: &str) {
|
||||
--- a/crates/viewer/re_viewer_context/src/view/view_states.rs
|
||||
+++ b/crates/viewer/re_viewer_context/src/view/view_states.rs
|
||||
@@ -173,6 +173,19 @@
|
||||
}
|
||||
|
||||
impl ViewStates {
|
||||
+ /// NODE.DC: read-only per-recording state access for native camera snapshots.
|
||||
+ pub fn states_for_store<'a>(&'a self, store_id: &'a StoreId) -> impl Iterator<Item = &'a dyn ViewState> {
|
||||
+ self.states.iter().filter_map(move |((id, _), state)| {
|
||||
+ (id == store_id).then_some(state.as_ref())
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
+ pub fn states_for_store_mut<'a>(&'a mut self, store_id: &'a StoreId) -> impl Iterator<Item = &'a mut (dyn ViewState + 'static)> {
|
||||
+ self.states.iter_mut().filter_map(move |((id, _), state)| {
|
||||
+ (id == store_id).then_some(state.as_mut())
|
||||
+ })
|
||||
+ }
|
||||
+
|
||||
pub fn get(&self, store_id: &StoreId, view_id: ViewId) -> Option<&dyn ViewState> {
|
||||
self.states
|
||||
.get(&(store_id.clone(), view_id))
|
||||
|
||||
@@ -15,6 +15,8 @@ portable source patch and paired generated runtime. Keep the upstream licenses.
|
||||
are not shaders and must not enter the build.
|
||||
4. On Worker006, create a temporary container from the pinned Rust image in
|
||||
the manifest, with 4 CPUs, 16 GB memory, no GPU, no ports and no private data.
|
||||
This build raised its own CPU quota to 8, then 16 after checking spare host
|
||||
capacity; no Docker Desktop resource settings or other containers changed.
|
||||
Use the `ndc-` name and NODE.DC ownership labels required by AGENTS.md.
|
||||
Copy the archive to `/work/patched-source.tar.gz` and the repository's
|
||||
`scripts/build-rerun-navigation.sh` to `/work/build-rerun-navigation.sh`.
|
||||
|
||||
+27
-10
@@ -3,33 +3,50 @@
|
||||
"upstreamVersion": "0.36.3",
|
||||
"upstreamCommit": "6ded109d33c549e98185f7c95fa8009d44e4adef",
|
||||
"upstreamArchiveSha256": "3f92aef3f33f63c79b275b5c66a65d73192e75967cbcd3d1f16c75010996f896",
|
||||
"patchSha256": "a893a4b4e7523cca88284316c88b930c3b91ba973ed3f954c9ca632f71252e64",
|
||||
"patchSha256": "91ac2a6edb93f20e8f38670a2f58e99f1218fe07f8a3fceefec136df509537d6",
|
||||
"cargoLockSha256": "74cdf9c3c8c5dbe5a368f1a9a58b011e2a45720843b30e552bc7b1d8ac21d791",
|
||||
"buildScriptSha256": "e3cbd5da889403eda3ffba7c020b6075bdfb025b823d1bf503b639f59688135a",
|
||||
"buildDate": "2026-09-21",
|
||||
"buildDate": "2026-11-03",
|
||||
"rustImage": "rust:1.95-bookworm@sha256:6258907abe69656e41cd992e0b705cdcfabcbbe3db374f92ed2d47121282d4a1",
|
||||
"binaryenVersion": "117",
|
||||
"binaryenArchiveSha256": "3dc677006555b355ea2da5e82602065a161d5e83eaefd3f759afa00b96e83212",
|
||||
"wasmBindgenVersion": "0.2.126",
|
||||
"nativeTestsPassed": 6,
|
||||
"nativeTestsPassed": 10,
|
||||
"files": {
|
||||
"index.js": { "upstreamSha256": "009aa5f66c8674ea268a91926c00e2f82cc7a7b7e5535056d93bd4656d6f6812" },
|
||||
"index.ts": { "upstreamSha256": "087b25170f720a28aa69c411903133286238900050ac775d2cc511b919846696" },
|
||||
"index.d.ts": { "upstreamSha256": "649637dad4e50ef4f2310fc1920b580d16832226a0dda5238355059bf167efba" },
|
||||
"index.js": {
|
||||
"upstreamSha256": "009aa5f66c8674ea268a91926c00e2f82cc7a7b7e5535056d93bd4656d6f6812"
|
||||
},
|
||||
"index.ts": {
|
||||
"upstreamSha256": "087b25170f720a28aa69c411903133286238900050ac775d2cc511b919846696"
|
||||
},
|
||||
"index.d.ts": {
|
||||
"upstreamSha256": "649637dad4e50ef4f2310fc1920b580d16832226a0dda5238355059bf167efba"
|
||||
},
|
||||
"re_viewer.js": {
|
||||
"upstreamSha256": "d2a94836dd0e6de40538c4d657cfb423b1803e354e6ee0cd550735eb5aaab09b",
|
||||
"artifact": "re_viewer.nodedc.js",
|
||||
"sha256": "610d89abffcc5c329797e77794ae2ab5b426c80a5b23fd24064c7d47c6583d3a"
|
||||
"sha256": "7cf2396b18d1b6ab80af03826b94ed8a658071704fbe7b58b860265aab46d19c",
|
||||
"previousArtifactSha256": "7cf2396b18d1b6ab80af03826b94ed8a658071704fbe7b58b860265aab46d19c"
|
||||
},
|
||||
"re_viewer.d.ts": {
|
||||
"upstreamSha256": "9a77a4e1e1aa8311185a3f275bf326a8fff2844e468e561c59d5f0ee7aa6debe",
|
||||
"artifact": "re_viewer.nodedc.d.ts",
|
||||
"sha256": "cfbf010d66560af919aa68d255a6ddc7120829f8ee8f27a41f56d943cd54e598"
|
||||
"sha256": "cafb702c9d3c37d01012afa358f337cfcc8ba3e101bfdacfb03455de972166c7",
|
||||
"previousArtifactSha256": "cafb702c9d3c37d01012afa358f337cfcc8ba3e101bfdacfb03455de972166c7"
|
||||
},
|
||||
"re_viewer_bg.wasm": {
|
||||
"upstreamSha256": "02d6d9c3a569d3faceb01cf89104342d970fc85e7c31a08dedd357b6c7104d2f",
|
||||
"artifact": "re_viewer_bg.nodedc.wasm",
|
||||
"sha256": "2b661de545ac90bb950eda1a28fc5a7c3ce4ca7f5bb24894789acf7589495185"
|
||||
"sha256": "309ff802d9be926fd58cbf3e36819d7da02bd4e580f44d2f636214d18ec3eac3",
|
||||
"previousArtifactSha256": "18e4d6fa8889ac73ecfc366df720a88678d9de2fcabd3302bb8b259147c78906"
|
||||
}
|
||||
}
|
||||
},
|
||||
"buildCpuRange": [
|
||||
8,
|
||||
16
|
||||
],
|
||||
"buildMemoryGiB": 16,
|
||||
"qualificationScriptSha256": "ebd65eb3b2143ffe5f8b3e0f718653a836a4cdb76375f47c93fdaf616a041e50",
|
||||
"regressionBeforeFix": "following_commits_motion_without_manual_input_across_frames: expected failure",
|
||||
"patchedSourceArchiveSha256": "bfc8297d5cb73059981aff47c7b7638e07a782b854f57fe65a92c16fe041ee1e"
|
||||
}
|
||||
|
||||
@@ -69,6 +69,11 @@ declare namespace wasm_bindgen {
|
||||
* excludes states retained for a previously selected/reset pane.
|
||||
*/
|
||||
nodedc_camera_eye(): string | undefined;
|
||||
nodedc_height_bounds(): string | undefined;
|
||||
/**
|
||||
* Local presentation only; finite bounds are validated before any state changes.
|
||||
*/
|
||||
nodedc_height_slice(lower?: number | null, upper?: number | null): boolean;
|
||||
/**
|
||||
* Open a new channel for streaming data.
|
||||
*
|
||||
@@ -115,6 +120,8 @@ declare interface InitOutput {
|
||||
readonly webhandle_has_panicked: (a: number) => number;
|
||||
readonly webhandle_new: (a: any) => [number, number, number];
|
||||
readonly webhandle_nodedc_camera_eye: (a: number) => [number, number];
|
||||
readonly webhandle_nodedc_height_bounds: (a: number) => [number, number];
|
||||
readonly webhandle_nodedc_height_slice: (a: number, b: number, c: number) => number;
|
||||
readonly webhandle_open_channel: (a: number, b: number, c: number, d: number, e: number) => void;
|
||||
readonly webhandle_override_panel_state: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
||||
readonly webhandle_panic_callstack: (a: number) => [number, number];
|
||||
|
||||
@@ -256,6 +256,28 @@ const exports = { __proto__: null };
|
||||
}
|
||||
return v1;
|
||||
}
|
||||
/**
|
||||
* @returns {string | undefined}
|
||||
*/
|
||||
nodedc_height_bounds() {
|
||||
const ret = wasm.webhandle_nodedc_height_bounds(this.__wbg_ptr);
|
||||
let v1;
|
||||
if (ret[0] !== 0) {
|
||||
v1 = getStringFromWasm0(ret[0], ret[1]).slice();
|
||||
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
||||
}
|
||||
return v1;
|
||||
}
|
||||
/**
|
||||
* Local presentation only; finite bounds are validated before any state changes.
|
||||
* @param {number | null} [lower]
|
||||
* @param {number | null} [upper]
|
||||
* @returns {boolean}
|
||||
*/
|
||||
nodedc_height_slice(lower, upper) {
|
||||
const ret = wasm.webhandle_nodedc_height_slice(this.__wbg_ptr, isLikeNone(lower) ? Number.MAX_SAFE_INTEGER : Math.fround(lower), isLikeNone(upper) ? Number.MAX_SAFE_INTEGER : Math.fround(upper));
|
||||
return ret !== 0;
|
||||
}
|
||||
/**
|
||||
* Open a new channel for streaming data.
|
||||
*
|
||||
|
||||
BIN
Binary file not shown.
Reference in New Issue
Block a user