mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-24 04:02:19 +00:00
ISS live telemetry, STATION and LIVE sections, Tiangong model, drawn through the renderer's draw port
Builds on the ISS 3D model (PR #1690) and brings it onto main's renderer seam: the station models are items of a `models` draw set, posed by heading, pitch and roll from the station's flight axes (`headingPitchRollOfAxes`), with the camera, canvas and clicks read from the renderer's ports; no satellites file reaches Cesium. The joint drivers write column-major matrices into node poses the model part keeps, for a renderer that can pose nodes; until the draw contract has that member the models draw rigid. - ISS joints take their angles from NASA's ISSLive telemetry, relayed by the server behind ISS_TELEMETRY_ENABLED. - STATION and LIVE sections of Context replace the floating command panel and player; both collapse like the Radio section. - Cockpit rides the ISS from mounts on its model; the LIVE page in the Cockpit briefing. - Tiangong as a second station model, with computed joints. - Installations: a label-box click selects the site.
This commit is contained in:
1 parent
fd3ca679ec
commit
9cc077964f
103 files changed
+12033
-1775
No files matched your search
@@ -55,6 +55,13 @@ const RING_BEHIND_ALPHA = 0.35;
|
||||
/** An RGBA colour with another alpha. */
|
||||
const withAlpha = (color, alpha) => [color[0], color[1], color[2], alpha];
|
||||
|
||||
/** Whether two display ranges are the same: both none, or the same bounds. */
|
||||
const sameRange = (a, b) =>
|
||||
a && b ? a[0] === b[0] && a[1] === b[1] : !a && !b;
|
||||
|
||||
/** A display range as the item's own copy, or undefined for none. */
|
||||
const rangeOf = (range) => (range ? [range[0], range[1]] : undefined);
|
||||
|
||||
/** Layer instances so far: set ids unique to each. */
|
||||
let instances = 0;
|
||||
|
||||
@@ -259,6 +266,46 @@ export function createRendering({
|
||||
if (trackedDot.drawn) sets?.tracked.upsert([trackedDot.item]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Draw one satellite's dot only at eye distances in `range` (`[near, far)`,
|
||||
* metres), or at every distance for null, apart from whether it is shown:
|
||||
* a station's model stands in for its dot, and for the dots of the objects
|
||||
* docked to it, within the model's range (stationModel.js). A dot added
|
||||
* again (a catalog rebuild) arrives with no range.
|
||||
* @param {number} noradId
|
||||
* @param {readonly [number, number]|null} range
|
||||
* @returns {boolean} Whether the satellite has a dot.
|
||||
*/
|
||||
function _setPointDisplayRange(noradId, range) {
|
||||
const point = layerState._points.get(noradId);
|
||||
if (!point) return false;
|
||||
if (sameRange(point.displayRange, range)) return true;
|
||||
point.displayRange = rangeOf(range);
|
||||
_markDirty(noradId);
|
||||
return true;
|
||||
}
|
||||
|
||||
/** The eye distances a dot is drawn at, or null for every distance. */
|
||||
function _pointDisplayRange(noradId) {
|
||||
return layerState._points.get(noradId)?.displayRange ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* The tracked satellite's dot likewise; a dot drawn is redrawn at once. A
|
||||
* new tracked dot (tracking another satellite) arrives with no range.
|
||||
* @param {readonly [number, number]|null} range
|
||||
*/
|
||||
function _setTrackedDotDisplayRange(range) {
|
||||
if (!trackedDot || sameRange(trackedDot.item.displayRange, range)) return;
|
||||
trackedDot.item.displayRange = rangeOf(range);
|
||||
if (trackedDot.drawn) sets?.tracked.upsert([trackedDot.item]);
|
||||
}
|
||||
|
||||
/** The eye distances the tracked dot is drawn at, or null for every distance. */
|
||||
function _trackedDotDisplayRange() {
|
||||
return trackedDot?.item.displayRange ?? null;
|
||||
}
|
||||
|
||||
/** Remove every orbit ring. */
|
||||
function _clearOrbitPaths() {
|
||||
const ids = [...layerState._orbitPaths.values()].map(
|
||||
@@ -665,10 +712,10 @@ export function createRendering({
|
||||
function _tickAfterFrame() {
|
||||
const now = focusNowMs(Date.now());
|
||||
|
||||
// The ISS as a 3D model up close. First, before the tracked sample below
|
||||
// is refreshed: the follow camera and the tracked dot were placed this
|
||||
// frame from the sample still cached, and the model must sit on it too.
|
||||
parts.issModel?._updateIssModel();
|
||||
// The stations as 3D models up close. First, before the tracked sample
|
||||
// below is refreshed: the follow camera and the tracked dot were placed
|
||||
// this frame from the sample still cached, and a model must sit on it too.
|
||||
for (const model of parts.stationModels ?? []) model._updateStationModel();
|
||||
|
||||
const interval = layerState._trackedNorad ? 200 : POSITION_UPDATE_MS;
|
||||
// Space Missions keeps this layer enabled for TLE lookup while deliberately
|
||||
@@ -705,8 +752,7 @@ export function createRendering({
|
||||
parts.cockpit?._syncCockpitSubjectVisuals();
|
||||
|
||||
// NASA's live video beside the card while the ISS is selected.
|
||||
parts.issLive?._syncIssLive();
|
||||
parts.issCommand?._syncIssCommand();
|
||||
parts.stationPanel?._syncStationPanel();
|
||||
|
||||
_updatePointFocus(now);
|
||||
|
||||
@@ -869,6 +915,10 @@ export function createRendering({
|
||||
_setPointStyle,
|
||||
_pointShown,
|
||||
_setTrackedDotShown,
|
||||
_setPointDisplayRange,
|
||||
_pointDisplayRange,
|
||||
_setTrackedDotDisplayRange,
|
||||
_trackedDotDisplayRange,
|
||||
_clearOrbitPaths,
|
||||
_addPoint,
|
||||
_movePoint,
|
||||
|
||||
Reference in new issue
Block a user