mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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:
1 parent
3a0a3b0551
commit
9dc446bd24
13 files changed
+423
-56
No files matched your search
+61
-1
@@ -1,5 +1,5 @@
|
||||
// Seeded synthetic feed answers: the global /api/flights snapshot (OpenSky
|
||||
// states), 12 000 AIS vessels on /api/vessels (with and without an area) and
|
||||
// states), the /api/military snapshot (readsb rows), 12 000 AIS vessels on /api/vessels (with and without an area) and
|
||||
// the local receivers' 1090 MHz and 978 MHz UAT aircraft near JFK, timed
|
||||
// relative to one instant, so every run sees the same objects at the same
|
||||
// places. Pure: Node and browser, no I/O. Used by the W1 baseline recordings
|
||||
@@ -123,6 +123,66 @@ export function syntheticVessels({
|
||||
return { rows, newestPositionAt: nowMs };
|
||||
}
|
||||
|
||||
// Military types across the weight classes (data/aircraftClass): heavies,
|
||||
// fast jets, helicopters, tankers, patrol.
|
||||
const MILITARY_TYPES = [
|
||||
['C17', 'RCH'],
|
||||
['F16', 'VIPER'],
|
||||
['KC135', 'PACK'],
|
||||
['H60', 'DUSTY'],
|
||||
['C130', 'HERKY'],
|
||||
['P8', 'PELCN'],
|
||||
['E3TF', 'SENTRY'],
|
||||
['MQ9', 'REAPER'],
|
||||
];
|
||||
|
||||
/**
|
||||
* The /api/military answer (readsb rows): `count` aircraft, 150 of them near
|
||||
* JFK (12 on the ground there), the rest worldwide. The first `overlap`
|
||||
* hexes are also civil synthetic flights (a00000…), which the flights layer
|
||||
* leaves to this layer while it is on (duplicate suppression).
|
||||
*/
|
||||
export function syntheticMilitary({
|
||||
nowMs = W1_FROZEN_MS,
|
||||
count = 1_000,
|
||||
seed = 41,
|
||||
overlap = 25,
|
||||
} = {}) {
|
||||
const random = mulberry32(seed);
|
||||
const near = Math.min(150, count);
|
||||
const ac = [];
|
||||
for (let index = 0; index < count; index++) {
|
||||
const [type, call] = MILITARY_TYPES[index % MILITARY_TYPES.length];
|
||||
const nearJfk = index < near;
|
||||
const grounded = nearJfk && index % 12 === 5;
|
||||
const lat = nearJfk
|
||||
? JFK.lat + (random() - 0.5) * (grounded ? 0.01 : 1.0)
|
||||
: random() * 140 - 70;
|
||||
const lon = nearJfk
|
||||
? JFK.lng + (random() - 0.5) * (grounded ? 0.01 : 1.3)
|
||||
: random() * 360 - 180;
|
||||
ac.push({
|
||||
hex:
|
||||
index < overlap ? hex(0xa00000 + index, 6) : hex(0xae1000 + index, 6),
|
||||
type: 'adsb_icao',
|
||||
flight: `${call}${String(index % 100).padStart(2, '0')}`.padEnd(8),
|
||||
r: `${10_000 + index}`,
|
||||
t: type,
|
||||
alt_baro: grounded ? 'ground' : Math.round(2_000 + random() * 33_000),
|
||||
gs: grounded
|
||||
? Math.round(random() * 12)
|
||||
: Math.round(160 + random() * 330),
|
||||
track: Math.round(random() * 3600) / 10,
|
||||
baro_rate: 0,
|
||||
lat: Number(lat.toFixed(5)),
|
||||
lon: Number(lon.toFixed(5)),
|
||||
seen_pos: Number((random() * 2).toFixed(1)),
|
||||
seen: 0,
|
||||
});
|
||||
}
|
||||
return { ac, now: nowMs / 1000, total: ac.length, msg: 'No error' };
|
||||
}
|
||||
|
||||
/** The /api/local-receivers/aircraft answer: 1090 MHz and 978 MHz UAT aircraft. */
|
||||
export function syntheticLocalReceivers({
|
||||
nowMs = W1_FROZEN_MS,
|
||||
|
||||
Reference in new issue
Block a user