mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
refactor(satellites): Cesium rendering behind a renderer interface
Move native points, synchronous orbit primitives, tracked entities, follow and picking into the Cesium renderer. Use appClock for satellite physical epochs and isolate the unchanged CelestialRing ephemeris. Synthetic core/dense and ISS/MEO/GEO snapshots match the baseline exactly; all gates pass. The pointer-ownership source assertion follows scene.pick into render/cesium.js; registry and import-boundary assertions now reflect the migrated satellite layer.
This commit is contained in:
1 parent
83fbe6949f
commit
000ef99464
27 files changed
+459
-196
No files matched your search
@@ -0,0 +1,34 @@
|
||||
// Exact legacy planetary model and bare-viewer fallback for CelestialRing.
|
||||
import * as Cesium from 'cesium';
|
||||
export function createCelestialEphemeris() {
|
||||
const sunInertial = new Cesium.Cartesian3();
|
||||
const moonInertial = new Cesium.Cartesian3();
|
||||
const fixedMatrix = new Cesium.Matrix3();
|
||||
return (epochMs, sunFixed, moonFixed) => {
|
||||
const time = Cesium.JulianDate.fromDate(new Date(epochMs));
|
||||
Cesium.Simon1994PlanetaryPositions.computeSunPositionInEarthInertialFrame(
|
||||
time,
|
||||
sunInertial,
|
||||
);
|
||||
Cesium.Simon1994PlanetaryPositions.computeMoonPositionInEarthInertialFrame(
|
||||
time,
|
||||
moonInertial,
|
||||
);
|
||||
const matrix =
|
||||
Cesium.Transforms.computeIcrfToFixedMatrix(time, fixedMatrix) ||
|
||||
Cesium.Transforms.computeTemeToPseudoFixedMatrix(time, fixedMatrix);
|
||||
if (!matrix) return false;
|
||||
Cesium.Matrix3.multiplyByVector(matrix, sunInertial, sunFixed);
|
||||
Cesium.Matrix3.multiplyByVector(matrix, moonInertial, moonFixed);
|
||||
Cesium.Cartesian3.normalize(sunFixed, sunFixed);
|
||||
Cesium.Cartesian3.normalize(moonFixed, moonFixed);
|
||||
return true;
|
||||
};
|
||||
}
|
||||
export const projectCelestialPoint = (scene, position, result) =>
|
||||
Cesium.SceneTransforms.worldToWindowCoordinates(scene, position, result);
|
||||
export const flyCelestialViewer = (viewer, options) =>
|
||||
viewer.camera.flyTo({
|
||||
...options,
|
||||
easingFunction: Cesium.EasingFunction.CUBIC_IN_OUT,
|
||||
});
|
||||
Reference in new issue
Block a user