Read the navigation and point-and-ask camera through the renderer's ports

The navigation controller and the location navigation cancel flights and
read the camera's place through the camera port. Point-and-ask's camera
pose key and its "around here" radius read the camera port's pose; its
entity pick moves into the input dispatcher (pickAt), which picks as a
click does, so the follow's helper still reads as its target.

navigationController, locationNavigation and pointerPick leave the Cesium
allow-list. Their package entries (./ui/navigation and three voice
entries) no longer load the Cesium adapter: given a viewer of a
caller's own, they find its camera once the caller loads
./render/cesium/unbound. They are listed as such in the unbound camera
test, which fails if one starts loading the factory again.
This commit is contained in:
Sameh Khamis committed 2026-11-07 03:11:51 -08:00
1 parent 3484bfa56d
commit a2c4d27b5a
9 files changed
+92 -35

No files matched your search

+23
View File
@@ -137,6 +137,29 @@ const dispatchers = new WeakMap();
* @property {() => void} destroy
*/
/**
* What is under canvas CSS pixel `x, y` now, as a click would see it (a hit
* on the follow's helper is a hit on its target), for a reader that is not
* handed a click (point-and-ask). Null when nothing is there or the pick
* fails.
* @param {object} viewer
* @param {number} x
* @param {number} y
* @returns {object|null}
*/
export function pickAt(viewer, x, y) {
try {
if (!viewer || viewer.isDestroyed?.()) return null;
const scene = viewer.scene;
if (typeof scene?.pick !== 'function') return null;
return (
pickThroughFollowHelper(scene.pick(new Cesium.Cartesian2(x, y))) ?? null
);
} catch {
return null;
}
}
/**
* The scene's dispatcher, made on first use.
* @param {object} viewer A Cesium viewer (or a test double with `scene`).