Aircraft drawn as far behind real time as their feed is late, along one curve their trail follows

Civil and military aircraft were drawn a fixed 30 s (15 s) behind real time
while anonymous feed reports arrive about 90 s old every 30 s, so every
contact dead reckoned about a minute past its newest report and snapped
when the next one landed (several km on a turn), and the tracked trail,
recorded from those drawn positions and patched as reports arrived, kinked.

- The display delay (data/displayDelay.js) is the 90th percentile of the
  newest 256 report lags plus 5 s, between the layer's floor (30 s, 15 s)
  and five minutes, slewed at most 0.2 s/s up and 0.05 s/s down. Icons,
  the renderer's live motion clock, labels, HUD, detection, the tracked
  camera and the trail read the one delay; following the world clock
  draws with none and deliveries leave it alone.
- Between two reports an aircraft flies a biarc (data/fixCurve.js) that
  passes through both and leaves each along its track, sent as contract
  arc segments; the trail is the reports joined along the same curve, so
  the icon sits on it. Nothing drawn between reports is kept.
- A report a coasting contact missed is eased onto from where it would
  have been that frame (at least 3 s, at most 30% over its speed, within
  20 s); over 5 km it jumps. Past its newest report a contact coasts
  straight on: a turn rate averaged over earlier reports outlived the turn.
- Forward synthetic fixes no longer block real reports older than them,
  and a history keeps 24 fixes.
- A feed simulation (testSupport/aircraftFeedSim.mjs) checks both layers
  against a 90 s late feed, a fallback switch, repeated reports, outages
  and the world clock.
This commit is contained in:
Sameh Khamis committed 2026-11-14 00:31:29 -08:00
1 parent c57eb74506
commit 5f98f8bdf3
40 files changed
+2606 -1238

No files matched your search

+33
View File
@@ -220,6 +220,39 @@ export function trailHeadStart(start, anchor, center, radiusM, result) {
return result;
}
/**
* The live head line from the last trail report through `points` (on the
* way to the aircraft) to `head`, as drawn: points inside the model's
* envelope are left out, and the link into the model slides as
* `trailHeadStart` decides (nothing on a contact that has not moved).
* @param {{x:number,y:number,z:number}} start The last body report.
* @param {Array<{x:number,y:number,z:number}>} points Between it and the head.
* @param {{x:number,y:number,z:number}} head The aircraft's trail anchor.
* @param {{x:number,y:number,z:number}|null} center Model origin, or null.
* @param {number|null} radiusM Rendered bounding radius.
* @param {{x:number,y:number,z:number}} result Scratch for the slid start.
* @returns {Array<{x:number,y:number,z:number}>} Empty when nothing is drawn.
*/
export function trailHeadLine(start, points, head, center, radiusM, result) {
const outside = (p) =>
!center ||
!(radiusM > 0) ||
Math.hypot(p.x - center.x, p.y - center.y, p.z - center.z) >= radiusM;
const line = [start];
for (const p of points) if (outside(p)) line.push(p);
// On a contact that has not moved the last link runs from inside the model
// out to its own anchor — a line through the fuselage. The END never gives,
// so a moving trail still terminates on the tail; the START is what
// slides, from nothing on a parked contact out to the whole link once it
// has cleared its own envelope.
const from = trailHeadStart(line.pop(), head, center, radiusM, result);
if (!from)
return line.length ? [...line, { x: head.x, y: head.y, z: head.z }] : [];
line.push(from === result ? { x: from.x, y: from.y, z: from.z } : from);
line.push({ x: head.x, y: head.y, z: head.z });
return line;
}
/**
* Transform a model-local visual centre into world coordinates without
* allocating. `modelMatrix` continues to own the model origin (including