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

+23
View File
@@ -0,0 +1,23 @@
// The geo ↔ Cesium boundary of the Cesium engine: Cesium values in, fresh
// src/geo values out, so no Cesium instance reaches the shell.
import * as Cesium from 'cesium';
import * as geo from '../../geo/index.js';
/** A fresh geo Cartesian3 from any {x, y, z}, or undefined. */
export const toGeo3 = (value) =>
value ? geo.cartesian3.create(value.x, value.y, value.z) : undefined;
/** A fresh geo Cartesian2 from any {x, y}, or undefined. */
export const toGeo2 = (value) =>
value ? geo.cartesian2.create(value.x, value.y) : undefined;
/** A new Cesium.Cartesian3 for a Cesium call. */
export const toCesium3 = (value) =>
new Cesium.Cartesian3(value.x, value.y, value.z);
/**
* A new Cesium.Cartesian2 for a window position. Always a new instance: Cesium
* caches pickPosition by windowPosition.toString() (phase 1a rule 9).
*/
export const toCesium2 = (value) => new Cesium.Cartesian2(value.x, value.y);