Move satellites per-frame positions in place and tighten the guard

Add fromDegreesInto to geo/ellipsoid: the same steps as fromDegrees in
the same order, so the same bits, written into a given object. The dense
catalog sweep and the tracked-frame sample use it instead of allocating
a fresh point for every move.

The off-Cesium guard now also catches member reads on the dot, ring and
tracked-entity handles through optional chaining or brackets, handles
taken into local names, destructured or spread, and checks its own
patterns against examples of what they must and must not catch.
This commit is contained in:
Sameh Khamis committed 2026-11-07 04:05:39 -08:00
1 parent 4fd1a850f1
commit 3abb05ec4b
5 files changed
+133 -11

No files matched your search

+4 -2
View File
@@ -1,5 +1,5 @@
import { twoline2satrec } from 'satellite.js';
import { fromDegrees } from '../../geo/ellipsoid.js';
import { fromDegrees, fromDegreesInto } from '../../geo/ellipsoid.js';
import { noradIdFromSatnum, tleLineLaunchYear } from '../../sources/tle.js';
import {
DENSE_REFRESH_FRAMES,
@@ -9,6 +9,8 @@ import {
} from './policy.js';
export function createCatalog({ state: layerState, services, parts, source }) {
// _movePoint copies the position, so one scratch point serves every move.
const scratch = { x: 0, y: 0, z: 0 };
function _abortActiveUpdates() {
for (const controller of layerState._activeUpdateControllers)
controller.abort();
@@ -44,7 +46,7 @@ export function createCatalog({ state: layerState, services, parts, source }) {
if (pos) {
parts.rendering._movePoint(
noradId,
fromDegrees(pos.longitude, pos.latitude, pos.altitude),
fromDegreesInto(pos.longitude, pos.latitude, pos.altitude, scratch),
);
}
}