Follow, credits, embed views and FPS through the engine on Navara

Five places still read the Cesium viewer and so did nothing, or the wrong
thing, on Navara. Each now goes through the globe contract, and Cesium
behaves as before.

- The Navara ground floor stands aside while the camera inputs are
  suspended, not only while they are switched off. The cockpit suspends
  them, so its eye 12 m up no longer jumps to the floor's 30 m between
  updates. A follow's own suspension keeps the floor on, as before.
- Follow state comes from engine.camera.following() and followChanged
  instead of viewer.trackedEntity. Enabling CCTV during a follow no longer
  flies away and ends it, a new follow stamps navigation, Director cards
  wait while a subject is followed, and an explicit navigation stops the
  follow on both engines.
- Navara registers every data credit, as Cesium does. The allowlist left
  out the layers that moved to Navara later (CCTV agencies, street-level
  imagery, GIBS, routing, bike feeds and others).
- Annotation links and embed mode attach on every engine; their camera
  flights use engine.camera.flyTo. Only Cesium adds the timer that keeps
  an inline panel drawing.
- The FPS readout counts engine.frames.postRender, so it shows on Navara.

Each fix has a test that fails without it.
This commit is contained in:
German Khokhlov committed 2026-11-08 17:05:27 +04:00
1 parent e1095ee553
commit 18f69c2699
23 files changed
+144 -158

No files matched your search

+14 -19
View File
@@ -13,7 +13,7 @@ import {
currentSceneOf,
detachPartsOnTeardown,
} from './sceneParts.js';
import { installViews, isEmbeddedInline } from './embed.js';
import { installViews, isEmbeddedInline, keepPanelRendering } from './embed.js';
import {
installScopeMask,
destroyScopeMask,
@@ -310,20 +310,8 @@ function cesiumToolBackend({ engine, tileset }) {
viewer.useDefaultRenderLoop = !hidden;
cockpitCloudEffects?.setSuspended?.(hidden);
},
attachViews(
{ styleManager, dataManager, voiceCommands },
{ signal, defer },
) {
defer(
installViews({
shell: styleManager,
viewer,
dataManager,
run: (name, args) => voiceCommands.runner(name, args, { signal }),
signal,
}),
);
},
// An inline panel the host reports hidden stops Cesium's render loop.
keepRendering: (options) => keepPanelRendering(viewer, options),
};
}
@@ -336,7 +324,7 @@ function cesiumToolBackend({ engine, tileset }) {
* this engine), `recentImagery(layer)` the panel's globe,
* `attach(context, attachment)` adds
* the engine's own tools, `suspend(hidden, controls)` its hidden-tab
* handling and `attachViews(context, attachment)` its embedded views. The
* handling and `keepRendering` what keeps an inline panel drawing. The
* shared tools keep their session state across engines. Returns the
* annotation board (null without one) and voice commands.
*/
@@ -460,9 +448,16 @@ async function attachEngineTools(
signal,
defer,
});
backend.attachViews?.(
{ styleManager, dataManager, voiceCommands },
{ signal, defer },
// Annotation links and embed mode, on every engine.
defer(
installViews({
shell: styleManager,
engine,
keepRendering: backend.keepRendering ?? null,
dataManager,
run: (name, args) => voiceCommands.runner(name, args, { signal }),
signal,
}),
);
return { annotations, voiceCommands, startupChrome: backend.startupChrome };
}