mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-22 03:02:20 +00:00
Stop Navara's memory growth on engine switches, hide polygon zones reliably, and drop the Cesium camera rig
- Navara 0.2.1 never frees pick batch ids, and the mover banks rebuilt their instanced meshes on each attach, leaking about 260 KiB of WebAssembly memory per switch. A per-view pool hands released ids back out; the long soak now asserts native growth of at most 32 KiB per switch. - Navara 0.2.1 sometimes drops the first show:false update on a new vector layer, so a zone turned off right after a switch back stayed drawn. Polygon displays hide by deleting their layers and rebuild them when shown. - Camera verbs drive both engines through the globe contract; the Cesium viewer rig and the tests of states it can no longer reach are gone. - Flights and military tracking share src/layers/aircraft/tracking.js. - The geo import scenario reads movers only where the engine has them. - Add the Navara section to docs/CURRENT-STATE.md and a changelog fragment.
This commit is contained in:
1 parent
7abf74518f
commit
a6c64713ee
46 files changed
+2367
-2894
No files matched your search
@@ -375,9 +375,8 @@ export function createGevActionRunner({
|
||||
{ memory: analystMemory },
|
||||
));
|
||||
installViewTargetPrewarm(engine);
|
||||
// Keep Cesium's viewer rig; viewerless engines use the contract rig.
|
||||
if (cameraVerbsSupported(viewer ?? engine))
|
||||
initCameraVerbs(viewer ?? engine, () => getViewTargetCartesian(engine), {
|
||||
if (cameraVerbsSupported(engine))
|
||||
initCameraVerbs(engine, () => getViewTargetCartesian(engine), {
|
||||
isCockpitActive: () => Boolean(styleManager?.getCockpitState?.()?.active),
|
||||
});
|
||||
const annotationsAvailable = (method) =>
|
||||
@@ -398,11 +397,9 @@ export function createGevActionRunner({
|
||||
case 'clear_annotations':
|
||||
return annotationsAvailable('clear');
|
||||
case 'move_camera':
|
||||
return cameraVerbsSupported(viewer ?? engine);
|
||||
return cameraVerbsSupported(engine);
|
||||
case 'fly_route':
|
||||
return (
|
||||
cameraVerbsSupported(viewer ?? engine) && annotationsAvailable('list')
|
||||
);
|
||||
return cameraVerbsSupported(engine) && annotationsAvailable('list');
|
||||
case 'set_visual_style':
|
||||
return renderSupported('visualStyles', 'setStyle');
|
||||
case 'set_cyber_sonar':
|
||||
|
||||
@@ -163,6 +163,8 @@ function createVoiceNavigationHarness({ cockpitActive = false } = {}) {
|
||||
},
|
||||
globe: { getHeight: () => 0 },
|
||||
tweens: [],
|
||||
// The frame event a camera verb advances on (through the engine).
|
||||
preRender: new Cesium.Event(),
|
||||
},
|
||||
camera: {
|
||||
moveEnd: { addEventListener() {} },
|
||||
|
||||
@@ -93,7 +93,7 @@ function fixture(t, kind, { native = kind === 'cesium' } = {}) {
|
||||
...options,
|
||||
floorServices: { cachedGroundFloor: () => 0, warmGroundFloor: () => {} },
|
||||
});
|
||||
t.after(() => releaseCameraVerbs(viewer ?? engine));
|
||||
t.after(() => releaseCameraVerbs(engine));
|
||||
return { engine, viewer, annotations, styleManager, calls, build };
|
||||
}
|
||||
|
||||
@@ -129,12 +129,9 @@ for (const kind of ['cesium', 'navara']) {
|
||||
const result = await f.build()(action, args);
|
||||
assert.equal(result.ok, true, JSON.stringify(result));
|
||||
assert.equal(result.engine, kind);
|
||||
// The camera verbs drive the engine on both.
|
||||
if (call) assert.equal(f.calls[0][0], call);
|
||||
else
|
||||
assert.equal(
|
||||
getActiveCameraMotion().rig,
|
||||
f.viewer ? 'viewer' : 'engine',
|
||||
);
|
||||
else assert.equal(getActiveCameraMotion().rig, 'engine');
|
||||
if (action === 'set_post_processing') {
|
||||
assert.deepEqual(
|
||||
f.calls.map(([name]) => name),
|
||||
@@ -154,10 +151,7 @@ for (const kind of ['cesium', 'navara']) {
|
||||
if (action === 'annotate_map') delete f.annotations.annotate;
|
||||
if (action === 'clear_annotations') delete f.annotations.clear;
|
||||
if (action === 'fly_route') delete f.annotations.list;
|
||||
if (action === 'move_camera') {
|
||||
if (f.viewer) delete f.viewer.clock.onTick;
|
||||
else delete f.engine.camera.lookAt;
|
||||
}
|
||||
if (action === 'move_camera') delete f.engine.camera.lookAt;
|
||||
if (action === 'set_visual_style') {
|
||||
if (f.viewer) delete f.styleManager.setStyle;
|
||||
else delete f.engine.render.setStyle;
|
||||
@@ -203,8 +197,7 @@ for (const kind of ['cesium', 'navara']) {
|
||||
|
||||
test(`${kind}: fly_route also requires camera verbs`, async (t) => {
|
||||
const f = fixture(t, kind);
|
||||
if (f.viewer) delete f.viewer.clock.onTick;
|
||||
else delete f.engine.camera.lookAt;
|
||||
delete f.engine.camera.lookAt;
|
||||
assert.equal((await f.build()('fly_route')).code, UNAVAILABLE_ON_ENGINE);
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user