Draw military flights from the shared GPU icon set

The flights icon planning and presentation move into
`createAircraftIcons` (src/data/aircraftIconLayer.js), and the motion
regime both layers dead-reckon from into src/data/aircraftMotionRegime.js.
Flights keeps only its grounded-floor pass on top.

Military now draws every contact as a row of that icon set, like
flights: the billboards, the cull positions and the rotation-pass
signature go. Tracking hides the row and untracking re-plans it from
the tracked course. Queries read the drawn row position and judge the
horizon as the shader does. Snapshots that arrive before init or after
destroy are ignored, and per-contact lookups find no contact then
instead of throwing.

With about 120 live military contacts, preRender p95 drops from
0.7-0.8 ms to 0.2 ms on the same views. Render time and frame gaps are
unchanged or slightly lower.
This commit is contained in:
Sameh Khamis committed 2026-11-03 20:30:43 -08:00
1 parent fa3a3a3bca
commit b027bde6ad
33 files changed
+1256 -1376

No files matched your search

+10 -8
View File
@@ -44,6 +44,8 @@ import militaryFlightsLayer, {
_trackedBillboardColorForTest as militaryTrackedBillboardColor,
_driveFleetModelHandoffForTest as militaryDriveFleetModel,
_ensureFleetModelForTest as militaryEnsureFleetModel,
_iconForTest as militaryIcon,
_setIconForTest as militarySetIcon,
} from './militaryFlights.js';
import { clearTr3bRegistry, setTr3b } from './tr3bRegistry.js';
import { reportMeshFloorCell, _clearMeshFloorCellsForTest } from './groundFloor.js';
@@ -188,21 +190,21 @@ function contactBillboard() {
};
}
/** A flights contact's icon row, read and written the way these tests read a
/** A contact's icon row, read and written the way these tests read a
* billboard: where it is drawn and whether the layer shows it. */
function flightIconView(icao24) {
function iconView(icao24, readIcon, setIcon) {
return {
get position() {
return flightsIcon(icao24)?.position;
return readIcon(icao24)?.position;
},
set position(position) {
flightsSetIcon(icao24, { position });
setIcon(icao24, { position });
},
get show() {
return flightsIcon(icao24)?.shown === true;
return readIcon(icao24)?.shown === true;
},
set show(shown) {
flightsSetIcon(icao24, { shown });
setIcon(icao24, { shown });
},
};
}
@@ -237,7 +239,7 @@ const LAYERS = [
modelCollection,
meta: { callsign: 'TEST123 ', altitude: 10_668, klass: 'airliner', onGround },
});
return flightIconView(icao24);
return iconView(icao24, flightsIcon, flightsSetIcon);
},
},
{
@@ -262,7 +264,7 @@ const LAYERS = [
modelCollection,
meta: { callsign: 'TEST123 ', altitudeFt: 35_000, klass: 'fastjet', onGround },
});
return billboard;
return iconView(icao24, militaryIcon, militarySetIcon);
},
},
];