Project the annotation whiteboard through the renderer's ports

The screen annotation renderer no longer imports Cesium. Each projection
pass reads the eye from the camera port's pose and projects through the
query port: behind-camera and horizon rejection, then project. It
repaints on the frame port's postRender, and asks for ground heights
through the height gateway, which now sees through draw sets not drawn as
ground. It sizes the board from the renderer's canvas. It leaves the
Cesium allow-list.

The Cesium query port's project reuses a scratch point and window
position, as the renderer's own projection did.

Its tests bind fake camera, query and frame ports over their viewer
doubles. The hybrid renderer's shared fixture binds them too, so its
screen marks are projected and checked to be on screen.
This commit is contained in:
Sameh Khamis committed 2026-11-07 04:13:18 -08:00
1 parent ed8f89db74
commit 8d586e5ff9
5 files changed
+94 -57

No files matched your search

+8 -1
View File
@@ -197,6 +197,9 @@ export function createCesiumQuery({
let occluderEllipsoid = null;
const occluderEye = new Cesium.Cartesian3(NaN, NaN, NaN);
const occludedPoint = new Cesium.Cartesian3();
/** `project`'s scratch point and window position. */
const projectedPoint = new Cesium.Cartesian3();
const projectedWindow = new Cesium.Cartesian2();
const query = {
pick(x, y, window = {}) {
@@ -233,9 +236,13 @@ export function createCesiumQuery({
return { origin: ecef(ray.origin), direction: ecef(ray.direction) };
},
project(position) {
projectedPoint.x = position.x;
projectedPoint.y = position.y;
projectedPoint.z = position.z;
const s = Cesium.SceneTransforms.worldToWindowCoordinates(
scene,
toCartesian(position),
projectedPoint,
projectedWindow,
);
return s ? { x: s.x, y: s.y } : null;
},