mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 08:12:24 +00:00
src/sky/starrySky.js and src/app/viewer.js are Cesium through and through, so they move into the adapter as src/render/cesium/starrySky.js and applicationViewer.js; the ./application/viewer export points there. The celestial ring's precise ICRF rotation reaches the shell through a Cesium-free registry (src/sky/icrf.js) that the sky provides as it loads; the application's renderer loads it, and so does ./render/cesium/unbound. Both files leave the Cesium allow-list.
29 lines
912 B
JavaScript
29 lines
912 B
JavaScript
/**
|
|
* @module sky/icrf
|
|
* @description The precise ICRF-to-fixed rotation, from the renderer that
|
|
* has the tables for it (the Cesium adapter's starry sky provides it as it
|
|
* loads, `src/render/cesium/starrySky.js`). Cesium-free: with none
|
|
* provided, or before its tables load, it answers null and callers fall
|
|
* back to `temeToPseudoFixed` (`src/geo/frames.js`).
|
|
*/
|
|
|
|
let provided = null;
|
|
|
|
/**
|
|
* Provide the precise rotation; a later call replaces it.
|
|
* @param {(ms: number) => ({x: object, y: object, z: object} | null)} axesAt
|
|
*/
|
|
export function provideIcrfToFixed(axesAt) {
|
|
provided = axesAt;
|
|
}
|
|
|
|
/**
|
|
* The precise ICRF-to-fixed rotation at `ms` (epoch milliseconds) as its
|
|
* axes (the matrix's columns), or null while it is unknown.
|
|
* @param {number} ms
|
|
* @returns {{x: object, y: object, z: object} | null}
|
|
*/
|
|
export function icrfToFixedAxes(ms) {
|
|
return provided ? provided(ms) : null;
|
|
}
|