Open the map out to the whole Milky Way

The map stopped at the catalogued 50 pc around the Sun — 0.33% of the
Galaxy's width — and looked like a point cloud with a search box.

Adds the galactic scale above it and the heads-up display the reference
map is built from.

The Galaxy is not a third coordinate space. It is the same parsec space
four orders of magnitude further out, so the model and the star field
crossfade against camera distance instead of switching, and the Sun stays
where it really is: 8.18 kpc out, on the Orion Spur, between the
Sagittarius and Perseus arms. The depth range scales with that distance —
one fixed near/far pair cannot both fly into a star and hold the Galaxy.

The structure in shared/astro/galaxy.ts is measured: the directions of the
centre and the north galactic pole, which fix the disc's 63 degree tilt
against the celestial equator; the Sun's galactocentric distance; and a
radius, azimuth and pitch angle per arm. The particles scattered around it
are not, and cannot be — dust hides the disc, so no catalogue holds the
Galaxy's stars. The view says so, and the model fades out before the
camera reaches the 50 pc where the real stars are.

The rest is the look: polar grids lying in the galactic plane with drop
lines from the Sun's neighbours, a scale ladder, a readout panel, range,
reticle and frame brackets. Two things had to give way for it. The
deep-sky shell is the sky as seen from here, so it dissolves rather than
letting the camera fly through a wall of nebulae, and so does the skybox,
which is a photograph taken from inside the thing now being viewed from
outside. Labels are picked by screen separation rather than distance
alone: the Sun's fifteen nearest neighbours are all inside four parsecs
and printed as one unreadable clump.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WaySiNst4HhDXBHnMy8p5G
This commit is contained in:
Claude
2026-08-04 19:59:01 +00:00
parent 2f45fa7fef
commit 2e525fb5c3
19 changed files with 2166 additions and 46 deletions
@@ -211,7 +211,11 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => {
const component = fixture.componentInstance as unknown as { galaxyGroup: THREE.Group; systemGroup: THREE.Group };
expect(component.galaxyGroup.visible).toBe(true);
expect(component.systemGroup.visible).toBe(false);
expect(engine.getCamera().near).toBeCloseTo(0.01, 9);
// Parsec-scale rather than an exact figure: in galaxy space the depth range scales with how
// far the camera has pulled back, so what identifies it is the far plane it settles on
// (5000 pc) versus the AU-space one (20000 AU), not a fixed near plane.
expect(engine.getCamera().far).toBeCloseTo(5000, 6);
expect(engine.getCamera().near).toBeLessThan(0.1);
expect(navigationStore.viewLevel()).toBe('galaxy');
});
@@ -230,6 +234,59 @@ describe('GalaxySystemSceneComponent camera-flight transitions', () => {
expect(component.currentStarId).toBe(ALPHA_CENTAURI.id);
});
it('reports the galactic scale once the camera has pulled back far enough, and comes back', async () => {
const camera = engine.getCamera();
camera.position.set(0, 0, 30000);
await advanceFrames(engine, 0.3);
expect(navigationStore.viewLevel()).toBe('galactic');
camera.position.set(0, 15, 30);
await advanceFrames(engine, 0.3);
expect(navigationStore.viewLevel()).toBe('galaxy');
});
it('widens the depth range as the camera pulls back, instead of holding one range for both scales', async () => {
const camera = engine.getCamera();
await advanceFrames(engine, 0.3);
const localFar = camera.far;
camera.position.set(0, 0, 30000);
await advanceFrames(engine, 0.3);
expect(camera.far).toBeGreaterThan(localFar);
// A near plane a hundredth of a parsec out has no precision left to spare at this range.
expect(camera.near).toBeGreaterThan(1);
});
it('flies out to the Galaxy when the scale ladder asks for it', async () => {
const camera = engine.getCamera();
fixture.componentInstance.goToLevel('galactic');
await advanceFrames(engine, 3);
expect(camera.position.length()).toBeGreaterThan(10000);
expect(navigationStore.viewLevel()).toBe('galactic');
});
it('leaves the system first when the scale ladder is used from inside one', async () => {
navigationStore.selectStar(SUN.id);
await flushAsync();
await advanceFrames(engine, 2.5);
expect(navigationStore.viewLevel()).toBe('system');
fixture.componentInstance.goToLevel('galactic');
await flushAsync();
// Exit leg, then the return leg, then the galactic flight: the request has to wait out the
// unit-space unwind rather than firing a parsec-scale flight while the scene is in AU.
await advanceFrames(engine, 6);
const component = fixture.componentInstance as unknown as { currentStarId: number | null; systemGroup: THREE.Group };
expect(component.currentStarId).toBeNull();
expect(component.systemGroup.visible).toBe(false);
expect(navigationStore.viewLevel()).toBe('galactic');
});
it('ignores a new selection while a transition is already in flight, then resolves to the latest requested star once idle', async () => {
navigationStore.selectStar(SUN.id);
await flushAsync();