Draw clamped points, draped lines and ground fills through the Cesium draw port

Clamped items now follow the ground the way Cesium's own entities do: a
clamped point is a billboard of a drawn dot, a draped line a ground
polyline, and a clamped fill a ground primitive, packed so no two fills in
one overlap. A rebuilt set keeps its old ground primitives until the new
ones are ready and swaps them in one frame, and whenSettled waits for
them. Sets with horizonCull hide their points and icons past the horizon
before each frame, and a change to what a set clamps to rebuilds it.
This commit is contained in:
Sameh Khamis committed 2026-11-06 19:15:01 -08:00
1 parent 99ad51048f
commit 8b2859e501
3 files changed
+644 -31

No files matched your search

+5 -2
View File
@@ -215,7 +215,8 @@ export function createCesiumPorts(widget, { capabilities, credentials = {} }) {
scene.preRender.addEventListener(onPhase('preRender')),
scene.postRender.addEventListener(drew),
scene.postRender.addEventListener(onPhase('postRender')),
scene.postRender.addEventListener(() => watchClamp()),
scene.preRender.addEventListener(() => drawPart.beforeRender()),
scene.postRender.addEventListener(() => drawPart.afterRender()),
scene.postRender.addEventListener(() => trimGlobeAfterDraw()),
];
@@ -356,7 +357,7 @@ export function createCesiumPorts(widget, { capabilities, credentials = {} }) {
// --- Draw ------------------------------------------------------------------
const drawPart = createCesiumDraw({ scene, report });
const { port: draw, sets, tilesets, watchClamp } = drawPart;
const { port: draw, sets, tilesets } = drawPart;
const cameraPart = createCesiumCamera({ scene, camera, report, widget });
const cameraPort = cameraPart.port;
@@ -898,6 +899,7 @@ export function createCesiumPorts(widget, { capabilities, credentials = {} }) {
if (!tilesLoaded()) blockers.push('tiles');
if (modelSets().some((r) => r.host.loading > 0)) blockers.push('models');
if (iconState() !== 'settled') blockers.push('icons');
if (drawPart.building()) blockers.push('draw');
if (busy) blockers.push('redraw');
if (performance.now() - lastTick >= STALL_MS) blockers.push('frames');
return { state: 'timeout', blockers };
@@ -913,6 +915,7 @@ export function createCesiumPorts(widget, { capabilities, credentials = {} }) {
globeLoaded() &&
tilesLoaded() &&
icons === 'settled' &&
!drawPart.building() &&
!modelSets().some((r) => r.host.loading > 0 || r.host.failed > 0)
);
}