mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
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:
1 parent
c57eb74506
commit
5f98f8bdf3
40 files changed
+2606
-1238
No files matched your search
@@ -110,7 +110,7 @@ export const TRACKED_BILLBOARD_SCALE_BY_DISTANCE = Object.freeze({
|
||||
// ---------------------------------------------------------------------------
|
||||
// Track-history trail state (PRD WS-F F1/F4): a fading polyline behind the
|
||||
// tracked aircraft. The accumulation array is intentionally SEPARATE from
|
||||
// _positionHistory (capped at POSITION_HISTORY_LIMIT=5 for dead reckoning)
|
||||
// _positionHistory (capped at POSITION_HISTORY_LIMIT for drawing)
|
||||
// so the visible trail can grow to TRAIL_MAX_POINTS fixes.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
@@ -123,26 +123,36 @@ export const TRAIL_COLOR = '#00d4ff';
|
||||
export const TRAIL_MAX_POINTS = 2000;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Render-behind smoothing (PRD WS-C C2 — approved product decision):
|
||||
// the fleet renders at now - RENDER_DELAY_SEC so positions interpolate
|
||||
// BETWEEN two known fixes instead of extrapolating ahead and snapping back
|
||||
// when the next poll lands. All consumers (labels, HUD, detection,
|
||||
// frame_overhead) share this delayed clock; removing the delay reintroduces
|
||||
// the back/forward oscillation and is a regression.
|
||||
// Render-behind smoothing (PRD WS-C C2 — approved product decision): the fleet
|
||||
// renders at now − the display delay so positions run BETWEEN two known
|
||||
// fixes instead of extrapolating ahead and snapping back when the next poll
|
||||
// lands. The delay follows how late the feed really is (data/displayDelay.js:
|
||||
// the 90th percentile of how long the display waits for each next report,
|
||||
// plus 5 s, changed slowly), never under RENDER_DELAY_SEC. All consumers
|
||||
// (labels, HUD, detection, frame_overhead, the tracked camera, trails and the
|
||||
// renderer's motion clock) share this one delayed clock; removing the delay
|
||||
// reintroduces the back/forward oscillation and is a regression.
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/** @constant {number} Display latency in seconds (= one poll interval). */
|
||||
/** @constant {number} The shortest display delay in seconds (one poll interval). */
|
||||
|
||||
export const RENDER_DELAY_SEC = 30;
|
||||
|
||||
/** @constant {number} How often the feed is polled (ms). */
|
||||
|
||||
export const POLL_INTERVAL_MS = 30_000;
|
||||
|
||||
/** Whether the layer shows the world clock's time instead of the live feed:
|
||||
* its source declares a timeline and the clock is away from live. */
|
||||
export const followsClock = (state) => state.timeline?.active() === true;
|
||||
|
||||
/** How far behind the time contacts are drawn: RENDER_DELAY_SEC live, none
|
||||
* following the clock, whose snapshots are loaded ahead of the time. */
|
||||
/** How far behind the time contacts are drawn (ms): the feed's display
|
||||
* delay live, none following the clock, whose snapshots are loaded ahead
|
||||
* of the time. */
|
||||
export const displayDelayMs = (state) =>
|
||||
followsClock(state) ? 0 : RENDER_DELAY_SEC * 1000;
|
||||
followsClock(state)
|
||||
? 0
|
||||
: (state._displayDelay?.currentMs ?? RENDER_DELAY_SEC * 1000);
|
||||
|
||||
/** @constant {number} Polls an aircraft may miss before removal (transient OpenSky dropouts). */
|
||||
|
||||
|
||||
Reference in new issue
Block a user