feat(globe): engine members and the viewer bridge for the shell

Contract: camera.position(result?) and camera.height() for per-frame
readers, render.request(reason?), maps.releasePhotorealTiles, sources
with a caller-owned ready provider, isGlobeEngine. engine.maps now hides
every tileset it has shown, lets the last imagery/photoreal call win, and
setPhotorealTiles(null) restores the last base imagery and its credit
instead of leaving the photoreal credit on a bare globe.

Cesium engine: reads the Viewer camera/canvas aliases, detaches bridged
events through the remover Cesium returns, raises frame timestamps
without allocating, re-aims the horizon occluder only when the camera
moved, and renders the scene directly when the governor governs another
viewer (or none yet). engineFromViewer returns the registered scene
engine of a viewer, else builds and caches one. The render governor stays
the Cesium render backend under engine.render and gains
isRenderGovernorInstalled.
This commit is contained in:
German Khokhlov committed 2026-10-15 18:18:19 +04:00
1 parent a5c98c6b07
commit 58a196374f
26 files changed
+657 -45

No files matched your search

+35
View File
@@ -176,6 +176,41 @@ export function createContractSuite(
near(cartesian3.dot(pose.up, up), 1, 1e-9, 'up·expected');
},
],
[
'camera.position and camera.height: the pose position and height, without a pose',
async () => {
camera.setView({
destination: cartesian3.fromDegrees(-3.7, 40.4, 12000),
orientation: { heading: 0.4, pitch: -0.5, roll: 0 },
});
await settle();
const pose = camera.pose();
const result = cartesian3.create();
const filled = camera.position(result);
ensure(
filled === result,
'position(result) returns the result it filled',
);
near(
cartesian3.distance(filled, pose.position),
0,
1e-6,
'position(result) vs pose().position',
);
const fresh = camera.position();
ensure(
isCartesian3(fresh) && fresh !== filled,
'position() returns a fresh Cartesian3',
);
near(
cartesian3.distance(fresh, pose.position),
0,
1e-6,
'position() vs pose().position',
);
near(camera.height(), pose.cartographic.height, 0.01, 'height()');
},
],
[
'camera.pose: cartographic, frame vectors and fovy are consistent',
async () => {