mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +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
@@ -621,3 +621,31 @@ export function synthesizeForwardKinematicsFix(newest, next = {}) {
|
||||
track: Number.isFinite(next.track) ? next.track : previousTrack,
|
||||
};
|
||||
}
|
||||
|
||||
/** @constant {number} The shortest ease (ms) from where a contact was drawn onto where a new report puts it. */
|
||||
export const RECOVER_MIN_MS = 3_000;
|
||||
/** @constant {number} An ease never moves a contact faster than its speed by more than this share... */
|
||||
export const RECOVER_MAX_EXTRA_SPEED = 0.3;
|
||||
/** @constant {number} ...unless that would take longer than this (ms). */
|
||||
export const RECOVER_MAX_MS = 20_000;
|
||||
/** @constant {number} Farther than this (m) from where a new report puts it, a contact jumps there. */
|
||||
export const RECOVER_SNAP_M = 5_000;
|
||||
/** @constant {number} Closer than this (m), it is simply drawn there. */
|
||||
export const RECOVER_MIN_M = 5;
|
||||
|
||||
/**
|
||||
* How long (ms) a contact drawn `errorM` off where a new report puts it eases
|
||||
* onto that place: at least RECOVER_MIN_MS, and long enough that the ease
|
||||
* adds at most RECOVER_MAX_EXTRA_SPEED of its speed, so it never looks like
|
||||
* a jump, up to RECOVER_MAX_MS.
|
||||
* @param {number} errorM
|
||||
* @param {number} speedMps
|
||||
* @returns {number}
|
||||
*/
|
||||
export function recoveryMs(errorM, speedMps) {
|
||||
const extraMps = RECOVER_MAX_EXTRA_SPEED * Math.max(speedMps || 0, 10);
|
||||
return Math.min(
|
||||
RECOVER_MAX_MS,
|
||||
Math.max(RECOVER_MIN_MS, (errorM / extraMps) * 1000),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user