mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-21 02:32:18 +00:00
Review fixes: station panel and model housekeeping, label-box click, telemetry null stamp
- Installations: the label-box click fallback reaches the controls' methods (it read an undefined member and never ran). - Station model: the docked-companion scan runs once a second again; the hand-over pass runs once, when the model starts drawing. - Station panel: an unchanged view is not republished every frame; one render pump across slider drags, stopped on destroy; destroying the panel hands the joints back to Automatic, and the joint drivers' reset forgets manual choices and the telemetry lock. - Telemetry relay: a null TimeStamp is no time, not the first second of the year. - Drop issCommandShouldShow and issCommandNoteText, which nothing called.
This commit is contained in:
1 parent
ae9cfa4ffb
commit
aeaa192b5f
8 files changed
+63
-77
No files matched your search
@@ -244,6 +244,8 @@ export function createStationModel(
|
||||
const dockedByOrbit = new Set();
|
||||
/** @type {Set<number>} Docked objects whose dots the model stands in for. */
|
||||
const handedCompanions = new Set();
|
||||
/** Whether the model draws and the docked dots are left to it. */
|
||||
let handingOver = false;
|
||||
let lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
/** Whether the station's orbit ring is hidden for the close-up. */
|
||||
let orbitHidden = false;
|
||||
@@ -605,14 +607,16 @@ export function createStationModel(
|
||||
function _updateStationModel() {
|
||||
visualValid = false;
|
||||
// The docked set first: whether the model may show (the Cockpit riding
|
||||
// the station) is read from it, so it is kept current before that.
|
||||
if (item) _scanCompanions(Date.now(), false);
|
||||
// the station) is read from it, so it is kept current before that. Once
|
||||
// a second; the dots are handed over or given back with the scan.
|
||||
if (item) _scanCompanions(Date.now(), handingOver);
|
||||
const show = _shouldShow();
|
||||
if (!show) {
|
||||
_hide();
|
||||
// The dots draw at every distance while the model may not.
|
||||
_releaseDots();
|
||||
if (handedCompanions.size) _releaseCompanions();
|
||||
handingOver = false;
|
||||
_syncOrbitCloseUp(false);
|
||||
return;
|
||||
}
|
||||
@@ -635,9 +639,13 @@ export function createStationModel(
|
||||
_load(dotPosition);
|
||||
return;
|
||||
}
|
||||
// The docked dots are the model's within its range.
|
||||
lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
_scanCompanions(Date.now(), true);
|
||||
// The docked dots are the model's within its range: handed over at
|
||||
// once when the model starts drawing, then with each scan.
|
||||
if (!handingOver) {
|
||||
handingOver = true;
|
||||
lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
_scanCompanions(Date.now(), true);
|
||||
}
|
||||
_handOverDots();
|
||||
_syncOrbitCloseUp(cameraDistance < spec.orbitHideM);
|
||||
// Out of range the model would not draw anyway: skip the SGP4 sample.
|
||||
@@ -709,6 +717,7 @@ export function createStationModel(
|
||||
telemetry?.destroy();
|
||||
_releaseDots();
|
||||
_releaseCompanions();
|
||||
handingOver = false;
|
||||
dockedByOrbit.clear();
|
||||
lastCompanionScanMs = Number.NEGATIVE_INFINITY;
|
||||
_syncOrbitCloseUp(false);
|
||||
|
||||
Reference in new issue
Block a user