Share the camera events and the stub's drawn positions with other cameras

The geo export now has geodesicAt and horizonFrom. The camera events module
is a public export (./render/camera/events) and holds move detection and the
command hooks as well as the per-listener changed measure; the stub camera
uses them. Each onCommand registration is now its own, so removing one twin
leaves the other. The stub's testing.drawnPosition says where it draws an
item, so a camera that is not the stub's can follow drawn items.
This commit is contained in:
Sameh Khamis committed 2026-11-08 19:22:42 -08:00
1 parent afd8dba67b
commit ef616b7905
9 files changed
+320 -70

No files matched your search

+8
View File
@@ -1600,6 +1600,13 @@ export function createStubRenderer(options = {}) {
canvas.width = viewport.width;
canvas.height = viewport.height;
},
/**
* Where a drawn item is drawn now (or `aheadMs` from now), ECEF, or
* null: what the stub's own camera follows for a target's `item`, for
* a camera of someone else's driving the stub (the `camera.followItem`
* conformance check).
*/
drawnPosition: (ref, aheadMs = 0) => drawnPosition(ref, aheadMs),
/** What a set holds. */
setRecord: (id) => sets.get(id) ?? null,
sets: () => [...sets.keys()],
@@ -1624,6 +1631,7 @@ export function createStubRenderer(options = {}) {
* @property {(point: object, height: number) => void} cacheHeight
* @property {(kind: string, value: boolean) => void} setSettled
* @property {(size: {width?: number, height?: number}) => void} setViewport
* @property {(ref: {set: string, id: string|number}, aheadMs?: number) => {x: number, y: number, z: number}|null} drawnPosition
* @property {(id: string) => object|null} setRecord
* @property {() => string[]} sets
* @property {Array<{port: string, member: string, args: unknown[]}>} calls