Draw the aircraft family, Wildlife Sightings and the Cockpit through the contract

The layers that still had one Cesium and one Navara implementation, or
drew on Cesium only, now draw through engine.movers, engine.lines and
engine.camera on both engines, and application code holds the engine
instead of guessing it from a viewer.

- Aircraft family: flights, military and local ADS-B share one display
  (src/layers/aircraft/render/display.js). The Cesium and Navara
  renderers are gone. Where they differed, the display follows Cesium:
  - attach and visibility tracking, live disableDepthTestDistance
    changes, the tracked glyph's distance scale, model ids that change,
    local ADS-B markers hidden until shown and its UAT ring as a point;
  - the trail head's hidden alpha is 0.45, the contract's
    depthFailAlpha scaled by the head's 0.9.
  The tracked glyph stays over the fleet, as on Navara. The movers
  contract reports readiness per model and reads model axes as the
  glTF's own on every engine. Cesium's follow takes any native target
  through a proxy entity in the ENU frame and mirrors its readout fields.
- Wildlife Sightings draws badges and the density glow as sprite sets
  and its privacy cells as line outlines (no fill yet). It takes clicks
  from engine.input and its card anchors to the engine's canvas and
  camera, so the layer is in both engines' catalogs again and a switch
  keeps the session's layer set.
- Cockpit: cockpitHost takes the engine only. The ridden aircraft is the
  engine follow's target, hidden through its sprite; only the Cesium
  Viewer's stock double-click is still routed around.
- About forty camera, navigation, share-link, HUD, voice, detection and
  layer-lifecycle callers take the engine. isGlobeEngine and
  engineFromViewer calls outside src/globe fall from 51 to 14.

The coupling baseline drops accordingly: layer renderer lines from
5239/12331 to 4546/11106 (Cesium/Navara), `viewer` lines from 2424 to
2209, Cesium-importing files from 69 to 66.
This commit is contained in:
German Khokhlov committed 2026-11-07 02:34:34 +04:00
1 parent 48988015f1
commit 35e70ec280
145 files changed
+4716 -4212

No files matched your search

+10 -9
View File
@@ -10,6 +10,7 @@ import { readStylesheet } from './testSupport/readStylesheet.mjs';
import { SceneControls } from './ui/sceneControls.js';
import { isRenderedOnScreen } from './ui/cockpitPresentation.js';
import { onKeyDown as cockpitKeyDown } from './ui/cockpitInput.js';
import { cockpitHost } from './ui/cockpitHost.js';
import {
enter as cockpitEnter,
exit as cockpitExit,
@@ -223,11 +224,11 @@ test('Cockpit Escape handling precedes form-control shortcut suppression and foc
assert.match(enter, /activeElement/);
assert.match(enter, /mapViewButton.*focus|focus.*mapViewButton/s);
assert.match(exit, /focus\(\{ preventScroll: true \}\)/);
assert.match(exit, /this\.host\.restore\(entity, this\.restoreTrackingFrame\)/);
assert.match(exit, /this\.host\.restore\(entity\)/);
assert.doesNotMatch(exit, /applyTrackedCameraFrame/);
assert.match(
ui,
/restoreTrackingFrame: \(entity\) => \{[\s\S]*?gevTrackedId[\s\S]*?flightsLayer\.refocusTrackedById[\s\S]*?militaryFlightsLayer\.refocusTrackedById/,
cockpitHost.toString(),
/restore: \(target\) => target\.resumeAircraftFollow\(\)/,
'Cockpit exit must return camera-frame ownership through the source layer so Contact Focus cannot accumulate a second owner',
);
});
@@ -295,13 +296,13 @@ test('the Contact panel never hides itself out from under its own NEXT button',
);
});
test('the cockpit reads its aircraft from the layer that owns Cesium tracking', () => {
test('the cockpit reads its aircraft from the layer that owns the tracking', () => {
const read = readAircraftInfo.toString();
assert.ok(read, 'readAircraftInfo is missing');
assert.match(read, /resolveTrackedAircraftInfo\(\{/);
assert.match(read, /gevTrackedId/);
// In cockpit mode the controller moves the entity off viewer.trackedEntity,
// so its own handle is the tracked identity there.
// In cockpit mode the controller releases the engine's follow of the
// aircraft, so its own handle is the tracked identity there.
assert.match(read, /this\.host\.followed\(\) \|\| this\.trackedEntity/);
});
@@ -1380,9 +1381,9 @@ test('voice Cockpit entry refuses when the entry gate is shut', () => {
});
test('cockpit state cannot report entryAllowed while already active', () => {
// Cockpit takes the entity off viewer.trackedEntity on entry and NEXT puts
// one back, so this flipped true/false between calls while active stayed
// true — read by the voice model as a broken half-entered state.
// Cockpit releases the engine's follow on entry and NEXT starts another,
// so this flipped true/false between calls while active stayed true —
// read by the voice model as a broken half-entered state.
const state = ui.slice(
ui.indexOf(' getCockpitState() {'),
ui.indexOf(' _retargetCockpitEntryLayer({'),