Draw transit vehicles through the renderer ports, off the Cesium list

Transit drew its vehicles into two Cesium billboard collections and culled,
turned and floored them through the Cesium scene. It now draws them as two
draw-port icon sets, still and moving, registered with the sprite order by
set id in the same places. Each marker is a plain record; a frame writes the
changed ones in one upsert per set, and markers taken out in one task go in
one removal. Clicks read the draw-port hit.

Visibility uses the query port's horizon test and the frustum planes of the
camera port's pose. Icons stay turned in screen space by an exact projection
through the query port, the same answer the Cesium helper gave. The flat
globe is told from terrain by asking the height service once per surface
change; floors are read again when the answer flips. The mesh floor sampler
sees through the layer's sets by id. The camera pose and surface version are
read once per task.

The Cesium draw port now moves and turns an icon without restyling it. The
GL upload probe moves to src/render/cesium/uploadProbe.js, which the QA
scripts hand to the frame probe; the QA scripts read the billboards drawn for
each set.
This commit is contained in:
Sameh Khamis committed 2026-11-08 21:44:22 -08:00
1 parent 00ae80908c
commit 347427f83d
24 files changed
+1618 -452

No files matched your search

+27 -14
View File
@@ -966,21 +966,29 @@ export function createCesiumDraw({
};
}
/** Whether `item` draws as `style` (`iconStyleOf`) says, but its position. */
function sameIconStyle(style, record, item) {
const sameList = (a, b) => {
if (!a || !b) return a === b;
if (a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
return true;
};
const sameCurve = (a, c) =>
!a || !c
? !a && !c
: a[0] === c.near &&
/** Two lists, or two missing ones, alike element by element. */
function sameList(a, b) {
if (!a || !b) return a === b;
if (a.length !== b.length) return false;
for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false;
return true;
}
/** A curve as `iconStyleOf` keeps it, and one as an item gives it. */
function sameCurve(a, c) {
return !a || !c
? !a && !c
: a[0] === c.near &&
a[1] === c.nearValue &&
a[2] === c.far &&
a[3] === c.farValue;
}
/**
* Whether `item` draws as `style` (`iconStyleOf`) says, but its position
* and, turned on screen, its rotation (`moveIcon` writes both).
*/
function sameIconStyle(style, record, item) {
const color = item.color;
return (
style.width === item.size[0] &&
@@ -1000,7 +1008,7 @@ export function createCesiumDraw({
sameCurve(style.scaleByDistance, item.scaleByDistance) &&
sameCurve(style.fadeByDistance, item.fadeByDistance) &&
style.rotationMode === item.rotationMode &&
style.rotation === item.rotation &&
(item.rotationMode === 'screen' || style.rotation === item.rotation) &&
style.course === item.course
);
}
@@ -1009,7 +1017,8 @@ export function createCesiumDraw({
const movedAxis = new Cesium.Cartesian3();
/**
* Move a drawn icon whose look is unchanged (`sameIconStyle`): its
* position, the course rotation that follows it, and its pick record.
* position, the course rotation that follows it or the screen rotation
* it is given, and its pick record.
*/
function moveIcon(record, entry, item) {
const { billboard, placed } = entry;
@@ -1024,6 +1033,10 @@ export function createCesiumDraw({
movedAxis,
);
}
if (item.rotationMode === 'screen') {
billboard.rotation = item.rotation ?? 0;
entry.style.rotation = item.rotation;
}
billboard.id.meta = item.meta;
billboard.id.lodGroup = item.lodGroup;
billboard.show = shownNow(record, placed);