feat(globe): implement the engine on Cesium

createCesiumEngine wraps an existing viewer without changing it: camera, picker, projector, frames, render (through the render governor), surface, input, credits and maps, with geo values out and Cesium values in at the boundary. Map and surface code is shared with src/maps and services/groundSnap instead of copied. scripts/qa-globe-contract.mjs runs the contract suite against the engine in headless Chrome; the camera-events check now waits for the previous move to end, as Cesium's moveStart marks a move from rest.
This commit is contained in:
German Khokhlov committed 2026-10-15 17:43:05 +04:00
1 parent cd94a26b9f
commit d831cbd23a
33 files changed
+2374 -32

No files matched your search

+15 -6
View File
@@ -144,18 +144,27 @@ const SAMPLE_WINDOW_MS = 250;
function _tilesReady(viewer) {
const prims = viewer?.scene?.primitives;
if (!prims) return false;
for (let i = 0; i < prims.length; i++) {
const tileset = firstVisibleTileset(prims);
return tileset ? tileset.tilesLoaded === true : true;
}
/**
* The first shown primitive that reports a boolean `tilesLoaded` (a 3D
* tileset, duck-typed), or null.
* @param {{ length: number, get: (index: number) => any }} primitives
* @returns {object | null}
*/
export function firstVisibleTileset(primitives) {
for (let i = 0; i < primitives.length; i++) {
let p = null;
try {
p = prims.get(i);
p = primitives.get(i);
} catch {
continue;
}
if (p && p.show !== false && typeof p.tilesLoaded === 'boolean') {
return p.tilesLoaded === true;
}
if (p && p.show !== false && typeof p.tilesLoaded === 'boolean') return p;
}
return true;
return null;
}
/**