mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Merge origin/main: shipwrecks, news, transit fronts, signal-lost trails and uncredited photos on the renderer's ports
Upstream's layers and changes are carried onto the ports, with no Cesium outside src/render and no reach into the viewer: - Shipwrecks draw as one icon set, clicked through the input dispatcher. - News draws through draw sets, the camera port and the input dispatcher; its beacons pulse each frame through the frame port. - The scene occlusion probe moves into src/render/cesium and reaches detection through a new application hook, createOcclusionProbe; its private Cesium reads go through internals.js. - Flight and military trails, the stale and SIGNAL LOST cue, coasting and following the world clock run on the draw and frame ports. GPU icons follow the scene clock while the world clock is followed, and fade when stale. A report that holds is not planned again every tick. - Vessels are keyed by their record id. The stub boot now enables military, shipwrecks and news as well.
This commit is contained in:
commit
a755f63638
331 files changed
+40654
-1666
No files matched your search
@@ -27,6 +27,8 @@ import {
|
||||
import {
|
||||
COURSE_HOLD_SPEED_MPS,
|
||||
lerpAngleDeg,
|
||||
floorCoastedPosition,
|
||||
staleHoldsForFix,
|
||||
arcOffsetEnu,
|
||||
courseSlewCapDps,
|
||||
limitCourseStep,
|
||||
@@ -39,7 +41,6 @@ import {
|
||||
} from '../../data/modelVisualAnchor.js';
|
||||
import {
|
||||
FOCUS_EVIDENCE_DEV,
|
||||
RENDER_DELAY_SEC,
|
||||
TRACKED_MODEL_MAX_PX,
|
||||
TRACKED_MODEL_MIN_PX,
|
||||
TRACKED_BILLBOARD_SCALE_BY_DISTANCE,
|
||||
@@ -56,6 +57,8 @@ import {
|
||||
DISPLAY_CORRIDOR_LOOKAHEAD_SEC,
|
||||
DISPLAY_CORRIDOR_CELL_BUDGET,
|
||||
DISPLAY_CORRIDOR_FAIR_SHARE,
|
||||
displayDelayMs,
|
||||
followsClock,
|
||||
} from './policy.js';
|
||||
import { readEntityRecord } from '../../data/entityRecords.js';
|
||||
import {
|
||||
@@ -68,6 +71,7 @@ import {
|
||||
julianAt,
|
||||
fixSpeedMps,
|
||||
fixTrackDeg,
|
||||
staleCoastSeconds,
|
||||
} from '../../data/aircraftMotionRegime.js';
|
||||
|
||||
/** Whether two ECEF points are the same point, component for component. */
|
||||
@@ -226,7 +230,7 @@ export function createMotion({
|
||||
sampledRenderTime ??
|
||||
addSeconds(
|
||||
julianFromEpochMs(flightState.now(), flightState._scratchRenderTime),
|
||||
-RENDER_DELAY_SEC,
|
||||
-displayDelayMs(flightState) / 1000,
|
||||
flightState._scratchRenderTime,
|
||||
);
|
||||
|
||||
@@ -249,7 +253,9 @@ export function createMotion({
|
||||
regime.minDt,
|
||||
regime.maxDt,
|
||||
);
|
||||
return _extrapolateFix(regime.fix, info, dt, out, regime.turnRateDps);
|
||||
_extrapolateFix(regime.fix, info, dt, out, regime.turnRateDps);
|
||||
// A coast never goes below the ground.
|
||||
return dt > 0 ? floorCoastedPosition(out, cachedGroundFloor) : out;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -265,9 +271,38 @@ export function createMotion({
|
||||
renderTime,
|
||||
RECORD_FIELDS,
|
||||
regime,
|
||||
{ cachedGroundFloor },
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether a contact has stopped where its coast ended (or held at its last
|
||||
* report) with no newer report, and since when it has had none.
|
||||
* @param {string} icao24
|
||||
* @returns {{reportEpochMs: number, holds: boolean}|null} Null while a
|
||||
* report is ahead of the display time or the contact is still coasting.
|
||||
*/
|
||||
function _signalLost(icao24) {
|
||||
const newest = flightState._positionHistory.get(icao24)?.at(-1);
|
||||
if (!newest) return null;
|
||||
const newestMs = fixEpochMs(newest);
|
||||
const elapsedSec =
|
||||
(flightState.now() - displayDelayMs(flightState) - newestMs) / 1000;
|
||||
if (!(elapsedSec > 0)) return null;
|
||||
const info = flightState.records.data.get(icao24);
|
||||
const coastSec = staleCoastSeconds(newest, info, cachedGroundFloor);
|
||||
if (!(elapsedSec > coastSec)) return null;
|
||||
return {
|
||||
reportEpochMs: Number.isFinite(newest.reportEpochMs)
|
||||
? newest.reportEpochMs
|
||||
: newestMs,
|
||||
holds: staleHoldsForFix(newest, {
|
||||
onGround: info?.onGround,
|
||||
cachedGroundFloor,
|
||||
}),
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Dead-reckon a fix along its own velocity/track by `dt` seconds, integrating a
|
||||
* constant-rate-turn arc when `turnRateDps` is significant (straight line
|
||||
@@ -323,7 +358,7 @@ export function createMotion({
|
||||
if (!history || history.length === 0) return true;
|
||||
const renderTime = addSeconds(
|
||||
julianFromEpochMs(flightState.now()),
|
||||
-RENDER_DELAY_SEC,
|
||||
-displayDelayMs(flightState) / 1000,
|
||||
flightState._scratchWarmupTime,
|
||||
);
|
||||
return julianLessThan(renderTime, history[0].time);
|
||||
@@ -404,9 +439,15 @@ export function createMotion({
|
||||
}
|
||||
|
||||
const nowMs = Date.now();
|
||||
// How far the contact may move between frames goes by the world's time,
|
||||
// which plays faster than the wall clock when following it at a rate.
|
||||
const worldMs = followsClock(flightState) ? flightState.now() : nowMs;
|
||||
const info = flightState.records.data.get(icao24);
|
||||
if (sameTrack) {
|
||||
const dtSec = Math.max(0.001, (nowMs - flightState._drPrevMs) / 1000);
|
||||
const dtSec = Math.max(
|
||||
0.001,
|
||||
(worldMs - flightState._drPrevWorldMs) / 1000,
|
||||
);
|
||||
const speed = (info && info.velocity) || 0;
|
||||
// Plausible single-frame motion (m): real velocity × frame Δt, ×4 slack + 25 m base.
|
||||
const plausible = speed * dtSec * 4 + 25;
|
||||
@@ -451,6 +492,7 @@ export function createMotion({
|
||||
copyInto(raw, flightState._drPrevRaw);
|
||||
copyInto(display, flightState._drPrevDisplay);
|
||||
flightState._drPrevMs = nowMs;
|
||||
flightState._drPrevWorldMs = worldMs;
|
||||
flightState._drReconcileValid = true;
|
||||
flightState._cachedDRPosition = display;
|
||||
const focusSizePx = _trackedFocusSizePx(
|
||||
@@ -1093,6 +1135,7 @@ export function createMotion({
|
||||
_copyPosition: copyPosition,
|
||||
_historyFix: historyFix,
|
||||
_motionRegime,
|
||||
_signalLost,
|
||||
_extrapolateFix,
|
||||
_isTrackWarmingUp,
|
||||
_trackedFocusSizePx,
|
||||
|
||||
Reference in new issue
Block a user