The sky background is exported: the star catalogue, the Milky Way's faces and the star vertex builder from gods-eye-view/sky

This commit is contained in:
Sameh Khamis committed 2026-11-10 23:29:40 -08:00
1 parent cd44d5c4d8
commit fa2e8e8551
6 files changed
+90 -34

No files matched your search

+48
View File
@@ -0,0 +1,48 @@
/**
* @module sky/assets
* @description The sky background's bundled data, Cesium-free: the
* bright-star catalogue (`buildStarVertices` in `./stars.js` decodes it) and
* the Milky Way glow's six cube faces, both in ICRF/J2000. See
* `src/data/local_data/sky/README.md` for their sources and licences.
*/
/** The bright-star catalogue pack (`{ stars: [raDeg, decDeg, vmag, bv, …] }`). */
export const STAR_CATALOGUE_URL = new URL(
'../data/local_data/sky/bright_stars.json',
import.meta.url,
);
/**
* The Milky Way's cube faces in the WebGL face order and layout: +X toward
* the March equinox, +Z toward the north celestial pole, uploaded without
* flipping.
*/
export const MILKY_WAY_FACE_URLS = Object.freeze({
positiveX: new URL(
'../data/local_data/sky/milkyway_px.webp',
import.meta.url,
),
negativeX: new URL(
'../data/local_data/sky/milkyway_nx.webp',
import.meta.url,
),
positiveY: new URL(
'../data/local_data/sky/milkyway_py.webp',
import.meta.url,
),
negativeY: new URL(
'../data/local_data/sky/milkyway_ny.webp',
import.meta.url,
),
positiveZ: new URL(
'../data/local_data/sky/milkyway_pz.webp',
import.meta.url,
),
negativeZ: new URL(
'../data/local_data/sky/milkyway_nz.webp',
import.meta.url,
),
});
/** The Milky Way glow's brightness at `SkySettings.milkyWay` 1: the stars carry the sky. */
export const MILKY_WAY_INTENSITY = 0.4;
+19
View File
@@ -0,0 +1,19 @@
/**
* @module sky
* @description The sky background, Cesium-free: catalogue stars over a
* soft Milky Way, both in ICRF/J2000, and the precise ICRF-to-fixed rotation
* a renderer may provide for the rest of the application.
*/
export {
STAR_CATALOGUE_URL,
MILKY_WAY_FACE_URLS,
MILKY_WAY_INTENSITY,
} from './assets.js';
export {
STAR_VERTEX_FLOATS,
STAR_LIMIT_MAGNITUDE,
buildStarVertices,
raDecToUnitVector,
} from './stars.js';
export { provideIcrfToFixed, icrfToFixedAxes } from './icrf.js';