mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-14 23:32:20 +00:00
refactor(layers): W1 timestamps without JulianDate
Flights and military keep their fix history in plain milliseconds (timeMs, whole ms as the Date the JulianDate came from held) and read "now" from the app clock: the render-delay time, bracketing, extrapolation, the warm-up check and the trail seed are number arithmetic (motion.js, tracking.js, snapshotRenderer.js), as is the turn rate and the forward synthetic fix in data/motionModel.js, which no longer imports Cesium. The JulianDate scratch fields in state.js and the unused JulianDate.now() in queries.js go. Launches (mission frame, panel, selection), the tracked satellite's SGP4 epoch and the celestial ring's sun and moon read the app clock; where a Cesium property still takes a JulianDate it is built from the app clock's now (as JulianDate.now did from Date.now). Wall-clock throttles and feed receipt stamps stay on Date.now; property reads at viewer.clock.currentTime (render, frozen at boot) move with the render code in the *a tasks. Tests that built JulianDate history fixtures now build ms ones with the same instants (motionModel.test, flights.test, militaryFlights.test); new tests show the military delayed position and the tracked satellite follow the app clock (both fail on the previous code).
This commit is contained in:
1 parent
f1a2df5cfe
commit
c33ee31efc
21 files changed
+155
-130
No files matched your search
@@ -1,4 +1,5 @@
|
||||
import * as Cesium from 'cesium';
|
||||
import { appClock } from '../../time/clock.js';
|
||||
import {
|
||||
TRAJECTORY_STAGE_COLORS,
|
||||
REPLAY_ORBIT_DURATION_SEC,
|
||||
@@ -32,7 +33,11 @@ export function createRendering({
|
||||
return;
|
||||
}
|
||||
parts.panel.updateMissionTelemetry();
|
||||
const time = Cesium.JulianDate.now(layerState._declutterTime);
|
||||
// The app clock's now, as the JulianDate Cesium's entity properties take.
|
||||
const time = Cesium.JulianDate.fromDate(
|
||||
new Date(appClock.now()),
|
||||
layerState._declutterTime,
|
||||
);
|
||||
layerState._declutterOccluder.cameraPosition =
|
||||
layerState._viewer.scene.camera.positionWC;
|
||||
parts.overlays.updateReplayVehicleOverlay(layerState._declutterOccluder);
|
||||
|
||||
Reference in new issue
Block a user