feat(military): render on Navara

Task 11b. src/layers/military/render/navara.js: the shared Navara aircraft
renderer with the military's sprite slot (SPRITE_LAYER_ORDER 'military',
under flights) and jet.glb's nose offset; registered by
registerNavaraLayerRenderers (now a table of lazily imported factories,
flights and military), so the Navara catalog offers military and the main
chunk stays without three/Navara.

- The follow passes between aircraft layers on Navara as on Cesium: the
  follow-handle → tracked-handle map and the "follow being started" handle
  are shared by every aircraft renderer of the page, so a layer whose follow
  another layer took reads the new owner's tracked handle (and its
  gevSelectionOrigin) — before, it read a bare follow handle and reported
  'programmatic'.
- trackById on a selected-but-not-followed contact follows it again (as
  flights since 10b; on Navara any camera command ends a follow).
- qaDrawn (the probe's drawn()) for military, shared with flights
  (src/layers/aircraft/qaDrawn.js).
- ?qaFeed=military:synthetic[:count]: seeded readsb rows (1 000 by
  default, 150 near JFK, 12 on the ground, 8 types), the first 25 hexes
  shared with the synthetic civil flights.
- qa-w1-layers: sections 4–6 read the --layer's module (were 'flights');
  section 5 keeps the queries beside the voice answers (the voice block
  overwrote them, so --compare never compared queries); for military: the
  follow passes military → flights → military, and flights leaves the 25
  shared aircraft to military while it is on (9 975 / 10 000 / 9 975).

qa-w1-layers --layer=military: Cesium 25/25, Navara 26/26, --compare parity
(queries included; the known 2.3 px camera offset at the global pose only).
This commit is contained in:
German Khokhlov committed 2026-10-17 05:05:40 +04:00
1 parent 3a0a3b0551
commit 9dc446bd24
13 files changed
+423 -56

No files matched your search

+15 -7
View File
@@ -189,6 +189,16 @@ const scalarKey = (scalar) =>
? `${scalar.near},${scalar.nearValue},${scalar.far},${scalar.farValue}`
: 'none';
// Follow handle → the tracked handle it follows, for every aircraft layer on
// the engine: a layer whose follow another aircraft layer took reads the
// new owner's tracked handle (its gevSelectionOrigin), as Cesium's
// viewer.trackedEntity gives it the other layer's entity.
const FOLLOWED_TRACKED = new WeakMap();
// The tracked handle whose follow is being started (any aircraft layer):
// the engine raises followChanged inside follow(), before the follow
// handle is known, and every layer's listener must see the new owner.
let followStarting = null;
// ---------------------------------------------------------------------------
// The renderer
// ---------------------------------------------------------------------------
@@ -849,7 +859,7 @@ export function createAircraftNavaraRenderer({
};
// --- follow ---------------------------------------------------------------
const ownFollows = new WeakMap(); // follow handle → tracked handle
const ownFollows = FOLLOWED_TRACKED; // follow handle → tracked handle
// The follow carries the tracked readout's card as plain data (the
// handle's annotation fields, read when the card paints).
const followOf = (handle) => {
@@ -864,17 +874,15 @@ export function createAircraftNavaraRenderer({
label: card,
});
};
// The tracked handle whose follow is being started: the engine raises
// followChanged inside follow(), before the handle is known here.
let starting = null;
const follow = {
start(handle) {
starting = handle;
const outer = followStarting;
followStarting = handle;
let followHandle;
try {
followHandle = followOf(handle);
} finally {
starting = null;
followStarting = outer;
}
handle.gevFollowHandle = followHandle;
ownFollows.set(followHandle, handle);
@@ -892,7 +900,7 @@ export function createAircraftNavaraRenderer({
Boolean(handle?.gevFollowHandle) &&
engine.camera.following() === handle.gevFollowHandle,
current() {
if (starting) return starting;
if (followStarting) return followStarting;
const handle = engine.camera.following();
return handle ? (ownFollows.get(handle) ?? handle) : undefined;
},