Draw civil flights from an icon set moved on the GPU

Every flight is now a row in the layer's icon set. Its motion segment
follows the same regime `_deadReckon` picks (interpolate between fixes,
warm up backward from the oldest, coast forward from the newest), and
one shared `_motionRegime` makes that choice for both. The shader moves
every untracked contact between polls, so the 12 Hz fleet tick no
longer touches each billboard. It now only re-plans expired rows,
floors grounded contacts, advances focus while needed, and runs the 3D
model regime.

Grounded contacts the floor lifts are pinned to a hold at the floored
position. Their nose glides on the GPU. Contacts within 50 km re-floor
every tick, and farther ones take turns about once a second. Low
contacts are judged for the horizon at no lower than 12 m above the
ellipsoid, as before. Below hover speed a contact's nose holds. A row
whose fleet model is drawn keeps its focus updated, because the model
reads it. Untracking re-plans and re-floors the icon from the tracked
course.

On the same views with about 6,700 OpenSky flights, frame gaps at p95
drop from 28-40 ms to 17 ms, and the fleet tick from 16-37 ms to about
2 ms at most.
This commit is contained in:
Sameh Khamis committed 2026-11-03 19:40:39 -08:00
1 parent 37dd4058c1
commit fa3a3a3bca
33 files changed
+1598 -986

No files matched your search

+10 -4
View File
@@ -10,7 +10,10 @@
import test from 'node:test';
import assert from 'node:assert/strict';
import * as Cesium from 'cesium';
import flightsLayer, { _setTrackedFlightRefreshStateForTest } from './flights.js';
import flightsLayer, {
_iconForTest,
_setTrackedFlightRefreshStateForTest,
} from './flights.js';
import militaryFlightsLayer, { _setTrackedMilitaryRefreshStateForTest } from './militaryFlights.js';
const ICAO = 'abc123';
@@ -39,6 +42,8 @@ const LAYERS = [
name: 'commercial',
layer: flightsLayer,
visualCenterM: Cesium.Cartesian3.ZERO,
// Where the icon is drawn: the seeded position as the GPU encodes it.
spritePosition: () => _iconForTest(ICAO).position,
seed({ billboardShow, models = [] }) {
_setTrackedFlightRefreshStateForTest({
icao24: ICAO,
@@ -61,6 +66,7 @@ const LAYERS = [
name: 'military',
layer: militaryFlightsLayer,
visualCenterM: Cesium.Cartesian3.ZERO,
spritePosition: () => contactBillboard(true).position,
seed({ billboardShow, models = [] }) {
_setTrackedMilitaryRefreshStateForTest({
icao24: ICAO,
@@ -149,8 +155,8 @@ for (const fixture of LAYERS) {
const spritePosition = detectionPosition(fixture.layer);
assert.ok(spritePosition, 'the 2D sprite publishes a detection candidate');
assert.ok(
Cesium.Cartesian3.equalsEpsilon(spritePosition, contactBillboard(true).position, 0, 1e-6),
'the 2D bracket stays welded to the billboard position',
Cesium.Cartesian3.equalsEpsilon(spritePosition, fixture.spritePosition(), 0, 1e-6),
'the 2D bracket stays welded to the drawn sprite position',
);
const modelMatrix = Cesium.Matrix4.fromRotationTranslation(MODEL_ROTATION, MODEL_POSITION);
@@ -195,7 +201,7 @@ for (const fixture of LAYERS) {
const loadingPosition = detectionPosition(fixture.layer);
assert.ok(loadingPosition, 'the billboard remains detectable while its model loads');
assert.ok(
Cesium.Cartesian3.equalsEpsilon(loadingPosition, contactBillboard(true).position, 0, 1e-6),
Cesium.Cartesian3.equalsEpsilon(loadingPosition, fixture.spritePosition(), 0, 1e-6),
'a shown-but-unready zero-scale model cannot steal the detection anchor',
);
});