astraeus 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (104) hide show
  1. package/CHANGELOG.md +33 -0
  2. package/README.md +65 -11
  3. package/data/ephemerides/planets/planets.json +1 -1
  4. package/package.json +1 -1
  5. package/src/api/AstraeusScene.d.ts +9 -1
  6. package/src/api/AstraeusScene.js +26 -4
  7. package/src/api/AstraeusScene.node.js +26 -4
  8. package/src/api/data.js +11 -1
  9. package/src/api/errors.d.ts +1 -1
  10. package/src/api/index.d.ts +2 -1
  11. package/src/api/mount.d.ts +16 -0
  12. package/src/api/mount.js +13 -1
  13. package/src/api/mount.node.js +13 -1
  14. package/src/api/pathProvenance.d.ts +10 -0
  15. package/src/api/pathProvenance.js +34 -0
  16. package/src/api/scene.d.ts +7 -1
  17. package/src/api/scene.js +122 -26
  18. package/src/api/story.d.ts +45 -1
  19. package/src/api/story.js +73 -2
  20. package/src/api/sunOrbit.d.ts +3 -3
  21. package/src/api/sunOrbit.js +92 -24
  22. package/src/api/viewerLink.d.ts +40 -0
  23. package/src/api/viewerLink.js +86 -0
  24. package/src/app/App.d.ts +4 -1
  25. package/src/app/App.js +42 -6
  26. package/src/app/App.node.js +42 -6
  27. package/src/app/AstraeusScene.d.ts +7 -0
  28. package/src/app/AstraeusScene.js +3 -1
  29. package/src/app/BodySetView.js +3 -2
  30. package/src/app/KeplerPoints.d.ts +1 -1
  31. package/src/app/KeplerPoints.js +3 -2
  32. package/src/app/LayeredRender.js +1 -0
  33. package/src/app/OrbitSetView.js +5 -0
  34. package/src/app/PointsView.js +3 -2
  35. package/src/app/SceneLabels.d.ts +8 -0
  36. package/src/app/SceneLabels.js +15 -1
  37. package/src/app/SkyView.js +2 -0
  38. package/src/app/TrackedBodyView.js +3 -2
  39. package/src/app/bodyDraw.js +3 -2
  40. package/src/app/dotMaterial.d.ts +11 -0
  41. package/src/app/dotMaterial.js +38 -0
  42. package/src/app/experienceDefinition.d.ts +12 -0
  43. package/src/app/mission.d.ts +1 -1
  44. package/src/app/mission.js +1 -1
  45. package/src/app/openClock.d.ts +1 -1
  46. package/src/app/openClock.js +3 -0
  47. package/src/app/sceneContentsHooks.js +2 -1
  48. package/src/app/sceneFrame.d.ts +2 -2
  49. package/src/app/sceneFrame.js +6 -1
  50. package/src/app/sceneFraming.d.ts +1 -1
  51. package/src/app/sceneFraming.js +9 -3
  52. package/src/app/viewerPort.d.ts +33 -0
  53. package/src/app/viewerPort.js +1 -0
  54. package/src/assets/bodies/jupiter.js +2 -0
  55. package/src/assets/bodies/outerPlanetCatalogues.d.ts +1 -5
  56. package/src/assets/bodies/outerPlanetCatalogues.js +2 -6
  57. package/src/assets/bodies/outerPlanetRings.d.ts +5 -0
  58. package/src/assets/bodies/outerPlanetRings.js +6 -0
  59. package/src/assets/bodies/planetSystemMaps.js +6 -3
  60. package/src/assets/compositions.js +2 -1
  61. package/src/assets/visual.d.ts +1 -1
  62. package/src/core/bodies/io.js +2 -1
  63. package/src/core/bodies/jupiterMoons.d.ts +1 -1
  64. package/src/core/bodies/jupiterMoons.js +7 -6
  65. package/src/core/bodies/moon.d.ts +2 -0
  66. package/src/core/bodies/moon.js +4 -0
  67. package/src/core/bodies/moonSystem.d.ts +17 -1
  68. package/src/core/bodies/moonSystem.js +59 -7
  69. package/src/core/bodies/outerPlanetData.d.ts +0 -3
  70. package/src/core/bodies/outerPlanetData.js +1 -7
  71. package/src/core/bodies/outerPlanetRingData.d.ts +3 -0
  72. package/src/core/bodies/outerPlanetRingData.js +10 -0
  73. package/src/core/bodies/outerPlanets.js +1 -1
  74. package/src/core/bodies/planetMoons.js +12 -11
  75. package/src/core/body.d.ts +4 -0
  76. package/src/core/chebyshevEphemeris.d.ts +7 -1
  77. package/src/core/chebyshevEphemeris.js +24 -7
  78. package/src/core/clock.d.ts +8 -0
  79. package/src/core/clock.js +14 -0
  80. package/src/core/events.d.ts +2 -0
  81. package/src/core/pacing.d.ts +24 -0
  82. package/src/core/pacing.js +35 -0
  83. package/src/core/planetModels.d.ts +4 -1
  84. package/src/core/planetModels.js +6 -1
  85. package/src/core/planetSeries.d.ts +3 -0
  86. package/src/core/planetSeries.js +8 -1
  87. package/src/core/satelliteMeanElements.d.ts +2 -8
  88. package/src/core/satelliteMeanElements.js +2 -15
  89. package/src/core/siderealPeriod.d.ts +27 -0
  90. package/src/core/siderealPeriod.js +18 -0
  91. package/src/core/timeWindow.d.ts +2 -0
  92. package/src/core/timeWindow.js +4 -3
  93. package/src/shell/AstraeusShell.d.ts +6 -2
  94. package/src/shell/AstraeusShell.js +9 -5
  95. package/src/shell/AstraeusShell.node.js +9 -5
  96. package/src/shell/TimelineBar.d.ts +4 -2
  97. package/src/shell/TimelineBar.js +15 -6
  98. package/src/shell/TimelineBar.node.js +15 -6
  99. package/src/shell/experience.d.ts +3 -1
  100. package/src/shell/infoModel.js +5 -4
  101. package/src/shell/timelineModel.d.ts +2 -3
  102. package/src/shell/timelineModel.js +3 -11
  103. package/src/synthetic/syntheticJourneyScene.d.ts +9 -0
  104. package/src/synthetic/syntheticJourneyScene.js +76 -0
@@ -28,6 +28,8 @@ const JUMP_SHARE = 0.25;
28
28
  /** Least re-sampling step and jump (simulation ms), for a path with no history loaded. */
29
29
  const MIN_STEP_MS = 60_000;
30
30
  const VERTEX = /* glsl */ `
31
+ #include <common>
32
+ #include <logdepthbuf_pars_vertex>
31
33
  attribute float aFamily;
32
34
  attribute float aSize;
33
35
  attribute float aFade;
@@ -44,10 +46,13 @@ void main() {
44
46
  float zoom = clamp((distanceRatio - 1.0) / (uFar - 1.0), 0.0, 1.0);
45
47
  vColor = vec4(uColors[family], aFade * min(1.0, (uBase + zoom * uBoost) * uGains[family]));
46
48
  gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
49
+ #include <logdepthbuf_vertex>
47
50
  }`;
48
51
  const FRAGMENT = /* glsl */ `
52
+ #include <logdepthbuf_pars_fragment>
49
53
  varying vec4 vColor;
50
54
  void main() {
55
+ #include <logdepthbuf_fragment>
51
56
  gl_FragColor = vColor;
52
57
  #include <colorspace_fragment>
53
58
  }`;
@@ -1,4 +1,5 @@
1
- import { BufferAttribute, BufferGeometry, Group, Points, PointsMaterial, Vector3 } from "three";
1
+ import { BufferAttribute, BufferGeometry, Group, Points, Vector3 } from "three";
2
+ import { dotMaterial } from "./dotMaterial.js";
2
3
  import { fillKeplerRangeKm } from "../core/keplerElements.js";
3
4
  import { KeplerPoints } from "./KeplerPoints.js";
4
5
  import { eqjToRenderVector } from "./renderCoordinates.js";
@@ -102,7 +103,7 @@ export class PointsView {
102
103
  this.#to = new BufferAttribute(new Float32Array(3 * count), 3);
103
104
  geometry.setAttribute("position", this.#from);
104
105
  geometry.setAttribute("positionTo", this.#to);
105
- this.#material = new PointsMaterial({
106
+ this.#material = dotMaterial({
106
107
  color: layer.color,
107
108
  size: layer.pointSizePx ?? DEFAULT_POINT_SIZE_PX,
108
109
  sizeAttenuation: false,
@@ -10,6 +10,14 @@ interface Rect {
10
10
  }
11
11
  /** Added to the selected object's label priority; larger than any labelPriority, so it is never the label hidden by an overlap. */
12
12
  export declare const SELECTED_PRIORITY = 1000;
13
+ /** Screen gap (px) a label keeps from a higher-priority label it is not hiding behind. */
14
+ export declare const LABEL_PADDING_PX = 6;
15
+ /**
16
+ * Hysteresis (I-121): a label the last layout hid by overlap needs this much more clearance (px, on top of LABEL_PADDING_PX) before it shows again,
17
+ * while a label already shown keeps its place at the plain padding. So a pair crossing at fast playback swaps winner once per crossing, not every frame.
18
+ * One rule for every label; the selected label is placed first and never loses a collision (I-108).
19
+ */
20
+ export declare const LABEL_REAPPEAR_MARGIN_PX = 14;
13
21
  /** App adapter that places configured labels; the label presentation itself stays generic. */
14
22
  export declare class SceneLabelLayer {
15
23
  #private;
@@ -3,12 +3,22 @@ import { createLabelElement } from "../shell/Label.js";
3
3
  import { projectToScreen } from "./AnchorLabels.js";
4
4
  /** Added to the selected object's label priority; larger than any labelPriority, so it is never the label hidden by an overlap. */
5
5
  export const SELECTED_PRIORITY = 1_000;
6
+ /** Screen gap (px) a label keeps from a higher-priority label it is not hiding behind. */
7
+ export const LABEL_PADDING_PX = 6;
8
+ /**
9
+ * Hysteresis (I-121): a label the last layout hid by overlap needs this much more clearance (px, on top of LABEL_PADDING_PX) before it shows again,
10
+ * while a label already shown keeps its place at the plain padding. So a pair crossing at fast playback swaps winner once per crossing, not every frame.
11
+ * One rule for every label; the selected label is placed first and never loses a collision (I-108).
12
+ */
13
+ export const LABEL_REAPPEAR_MARGIN_PX = 14;
6
14
  /** App adapter that places configured labels; the label presentation itself stays generic. */
7
15
  export class SceneLabelLayer {
8
16
  #root = document.createElement("div");
9
17
  #entries;
10
18
  #local = new Vector3();
11
19
  #shown = new Map();
20
+ /** Per object id, whether the latest layout showed it; absent when it was not a candidate (unplaced, out of reach or switched off). */
21
+ #lastShown = new Map();
12
22
  constructor(host, objects) {
13
23
  this.#root.className = "scene-labels";
14
24
  this.#entries = objects.map((object) => {
@@ -32,6 +42,8 @@ export class SceneLabelLayer {
32
42
  update(positionFor, camera, widthPx, heightPx, origin, selectedObjectId, hiddenIds) {
33
43
  camera.updateMatrixWorld(true);
34
44
  this.#shown.clear();
45
+ const previous = new Map(this.#lastShown);
46
+ this.#lastShown.clear();
35
47
  const candidates = this.#entries.flatMap((entry) => {
36
48
  if (hiddenIds?.has(entry.object.id) === true) {
37
49
  entry.element.hidden = true;
@@ -57,15 +69,17 @@ export class SceneLabelLayer {
57
69
  for (const candidate of candidates) {
58
70
  candidate.element.hidden = false;
59
71
  let placed = null;
72
+ const padding = LABEL_PADDING_PX + (previous.get(candidate.object.id) === false ? LABEL_REAPPEAR_MARGIN_PX : 0);
60
73
  for (const [dx, dy] of [[8, 0], [-8, 0], [0, -20]]) {
61
74
  candidate.element.style.transform = `translate(${candidate.screen.x + dx}px, ${candidate.screen.y + dy}px) translate(${dx < 0 ? "-100%" : "0"}, -50%)`;
62
75
  const bounds = candidate.element.getBoundingClientRect();
63
76
  const rect = { left: bounds.left, top: bounds.top, right: bounds.right, bottom: bounds.bottom };
64
- if (occupied.every((other) => !overlapsWithPadding(rect, other, 6))) {
77
+ if (occupied.every((other) => !overlapsWithPadding(rect, other, padding))) {
65
78
  placed = rect;
66
79
  break;
67
80
  }
68
81
  }
82
+ this.#lastShown.set(candidate.object.id, placed !== null);
69
83
  if (placed === null) {
70
84
  candidate.element.hidden = true;
71
85
  }
@@ -14,6 +14,8 @@ const PICTURE_GAIN = 1;
14
14
  const PICTURE_DIM = 0.04;
15
15
  /** A fixed render-frame direction used to read the sky back: where it lands on screen depends only on the camera orientation. */
16
16
  const PROBE_DIRECTION = new Vector3(0.62, 0.35, -0.7).normalize();
17
+ // The sky shaders carry no log-depth chunks on purpose: both materials are drawn with depthTest and depthWrite off, so they never read or write depth
18
+ // (their clip position is only used to place the sky on screen, which the logarithmic depth buffer leaves unchanged).
17
19
  const PICTURE_VERTEX = `
18
20
  varying vec2 vUv;
19
21
  void main() {
@@ -1,4 +1,5 @@
1
- import { BufferAttribute, BufferGeometry, DataTexture, Group, Line, LineBasicMaterial, Mesh, MeshBasicMaterial, Points, PointsMaterial, RGBAFormat, SphereGeometry, Vector3, } from "three";
1
+ import { BufferAttribute, BufferGeometry, DataTexture, Group, Line, LineBasicMaterial, Mesh, MeshBasicMaterial, Points, RGBAFormat, SphereGeometry, Vector3, } from "three";
2
+ import { dotMaterial } from "./dotMaterial.js";
2
3
  import { anchorLabelsOf, markerRadiusUnits, sampleTrackedPositions, stateClampedToBounds, stateIfInBounds, travelledCount } from "./mission.js";
3
4
  import { mapPathKm, relativeTrailKm, shiftedBy } from "./pathRules.js";
4
5
  import { eqjToRenderVector } from "./renderCoordinates.js";
@@ -83,7 +84,7 @@ export class TrackedBodyView {
83
84
  this.#marker.layers.set(TRACK_LAYER);
84
85
  const anchorGeometry = new BufferGeometry();
85
86
  anchorGeometry.setAttribute("position", new BufferAttribute(new Float32Array(this.#anchorKm.length), 3));
86
- this.#anchors = new Points(anchorGeometry, new PointsMaterial({
87
+ this.#anchors = new Points(anchorGeometry, dotMaterial({
87
88
  color: "#f0e6da",
88
89
  map: anchorSpriteTexture(),
89
90
  size: 9,
@@ -1,4 +1,5 @@
1
- import { AdditiveBlending, BufferAttribute, BufferGeometry, CanvasTexture, Group, Points, PointsMaterial, Sprite, SpriteMaterial } from "three";
1
+ import { AdditiveBlending, BufferAttribute, BufferGeometry, CanvasTexture, Group, Points, Sprite, SpriteMaterial } from "three";
2
+ import { dotMaterial } from "./dotMaterial.js";
2
3
  import { textureUrlFor } from "../assets/licence.js";
3
4
  /**
4
5
  * A body with both an equatorial and a polar radius is a spheroid whose two radii are mapped independently, so
@@ -49,7 +50,7 @@ export function createMarker(asset, layer, override, fallbackPx) {
49
50
  const position = new BufferAttribute(new Float32Array(3), 3);
50
51
  const geometry = new BufferGeometry();
51
52
  geometry.setAttribute("position", position);
52
- const points = new Points(geometry, new PointsMaterial({ color, size: sizePx, sizeAttenuation: false, depthTest: false }));
53
+ const points = new Points(geometry, dotMaterial({ color, size: sizePx, sizeAttenuation: false, depthTest: false }));
53
54
  points.frustumCulled = false;
54
55
  points.layers.set(layer);
55
56
  const group = new Group();
@@ -0,0 +1,11 @@
1
+ import { PointsMaterial, type PointsMaterialParameters } from "three";
2
+ /** Frees the shared dot picture (an unmounted scene's renderer must not stay reachable through it); the next dot makes a new one. */
3
+ export declare function releaseDotTexture(): void;
4
+ /**
5
+ * The one way the engine makes a far-away dot (body marker, group dot, anchor): a round `PointsMaterial`.
6
+ * A map plus `alphaTest` rather than a fragment discard, because the group materials already patch the
7
+ * vertex shader through `onBeforeCompile` and the stock fragment chunks handle the map, opacity and
8
+ * vertex colours unchanged; the cutoff keeps the edge crisp at 2-4 px. Callers pass the same size and
9
+ * colour as before; only the shape differs. A caller's own `map` (the anchor ring) replaces the disc.
10
+ */
11
+ export declare function dotMaterial(parameters: PointsMaterialParameters): PointsMaterial;
@@ -0,0 +1,38 @@
1
+ import { DataTexture, PointsMaterial, RGBAFormat } from "three";
2
+ const DOT_TEXTURE_PX = 32;
3
+ let dotTexture = null;
4
+ /**
5
+ * A white disc with a one-pixel soft edge, built from pixels (no DOM needed). An untextured WebGL point
6
+ * is a square; sampled through `gl_PointCoord` this makes it a circle.
7
+ */
8
+ function roundDotTexture() {
9
+ if (dotTexture !== null)
10
+ return dotTexture;
11
+ const size = DOT_TEXTURE_PX;
12
+ const pixels = new Uint8Array(size * size * 4);
13
+ for (let y = 0; y < size; y += 1) {
14
+ for (let x = 0; x < size; x += 1) {
15
+ const r = Math.hypot(x + 0.5 - size / 2, y + 0.5 - size / 2);
16
+ const alpha = Math.min(1, Math.max(0, size / 2 - r));
17
+ pixels.set([255, 255, 255, Math.round(alpha * 255)], (y * size + x) * 4);
18
+ }
19
+ }
20
+ dotTexture = new DataTexture(pixels, size, size, RGBAFormat);
21
+ dotTexture.needsUpdate = true;
22
+ return dotTexture;
23
+ }
24
+ /** Frees the shared dot picture (an unmounted scene's renderer must not stay reachable through it); the next dot makes a new one. */
25
+ export function releaseDotTexture() {
26
+ dotTexture?.dispose();
27
+ dotTexture = null;
28
+ }
29
+ /**
30
+ * The one way the engine makes a far-away dot (body marker, group dot, anchor): a round `PointsMaterial`.
31
+ * A map plus `alphaTest` rather than a fragment discard, because the group materials already patch the
32
+ * vertex shader through `onBeforeCompile` and the stock fragment chunks handle the map, opacity and
33
+ * vertex colours unchanged; the cutoff keeps the edge crisp at 2-4 px. Callers pass the same size and
34
+ * colour as before; only the shape differs. A caller's own `map` (the anchor ring) replaces the disc.
35
+ */
36
+ export function dotMaterial(parameters) {
37
+ return new PointsMaterial({ map: roundDotTexture(), alphaTest: 0.4, ...parameters });
38
+ }
@@ -1,5 +1,6 @@
1
1
  import type { ReactNode } from "react";
2
2
  import type { SimulationClock } from "../core/clock.js";
3
+ import type { Pacing } from "../core/pacing.js";
3
4
  import type { StateResolver } from "../core/stateResolver.js";
4
5
  import type { PointGroup } from "../core/pointGroup.js";
5
6
  import type { TimeBounds, Trajectory } from "../core/trajectory.js";
@@ -137,6 +138,15 @@ export interface CameraReach {
137
138
  readonly fitOrbit?: {
138
139
  readonly farthestKm: () => number;
139
140
  };
141
+ /**
142
+ * The distance, in km, that the default zoom-out must cover for what no body's orbit speaks for (a path reaching past the planets, I-114): twice the path's farthest distance from the scene centre. When neither `maxFocusDistance` nor `fitOrbit` is declared the viewer
143
+ * widens the default zoom-out and the far plane so this distance fits the canvas whole; it never narrows the default (`minFocusDistance` below is the result, set live).
144
+ */
145
+ readonly cover?: {
146
+ readonly farthestKm: () => number;
147
+ };
148
+ /** Set live from `cover` (never declared): the zoom-out the default must at least reach, in scaled units. */
149
+ readonly minFocusDistance?: number;
140
150
  }
141
151
  /** The scene's far plane when an experience declares none. */
142
152
  export declare const DEFAULT_CAMERA_FAR = 5000;
@@ -153,6 +163,8 @@ export interface ExperienceDefinition {
153
163
  readonly rate: number; /** False leaves the clock paused at `startUtcMs` when the scene opens (default true: it plays). */
154
164
  readonly playing?: boolean;
155
165
  };
166
+ /** Playback that slows for encounters and speeds up for cruise (see `pacedRate`). Absent: the clock runs at the rate it opens with or the visitor picks. */
167
+ readonly pacing?: Pacing;
156
168
  /** Layers the scene mounts, e.g. the tracked-body list. */
157
169
  readonly sceneLayers: readonly SceneLayerId[];
158
170
  /** The catalogued bodies the scene draws, one view each. Absent: none, as in the bodiless fixture. */
@@ -65,7 +65,7 @@ export declare const MARKER_MIN_RADIUS_UNITS = 0.0001;
65
65
  export declare function markerRadiusUnits(cameraDistanceUnits: number): number;
66
66
  export declare function jumpToEvent(clock: SimulationClock, events: readonly TimelineEvent[], id: string): number;
67
67
  export type { PlaybackSpeed as Speed } from "../shell/timelineModel.js";
68
- export { formatRate, mergeSpeeds } from "../shell/timelineModel.js";
68
+ export { formatRate, speedsOf } from "../shell/timelineModel.js";
69
69
  export interface TrackedReadout {
70
70
  readonly id: string;
71
71
  readonly label: string;
@@ -58,7 +58,7 @@ export function jumpToEvent(clock, events, id) {
58
58
  clock.seek(event.timeUtcMs);
59
59
  return event.timeUtcMs;
60
60
  }
61
- export { formatRate, mergeSpeeds } from "../shell/timelineModel.js";
61
+ export { formatRate, speedsOf } from "../shell/timelineModel.js";
62
62
  /** Current-position rows for the bodies whose trajectories cover `timeUtcMs`; the rest are omitted. */
63
63
  export function trackedReadouts(bodies, timeUtcMs) {
64
64
  const rows = [];
@@ -4,4 +4,4 @@ import type { ExperienceDefinition } from "./experienceDefinition.js";
4
4
  * The clock a mounted experience opens with: at its start moment and rate (or at the moment a copied link carried), playing unless the definition says
5
5
  * `clock.playing: false`, which leaves it frozen there.
6
6
  */
7
- export declare function openClock(definition: Pick<ExperienceDefinition, "clock">, linkedTimeUtcMs?: number): SimulationClock;
7
+ export declare function openClock(definition: Pick<ExperienceDefinition, "clock" | "pacing">, linkedTimeUtcMs?: number): SimulationClock;
@@ -1,4 +1,5 @@
1
1
  import { SimulationClock } from "../core/clock.js";
2
+ import { pacedRate } from "../core/pacing.js";
2
3
  /**
3
4
  * The clock a mounted experience opens with: at its start moment and rate (or at the moment a copied link carried), playing unless the definition says
4
5
  * `clock.playing: false`, which leaves it frozen there.
@@ -8,6 +9,8 @@ export function openClock(definition, linkedTimeUtcMs) {
8
9
  clock.setRate(definition.clock.rate);
9
10
  if (linkedTimeUtcMs !== undefined)
10
11
  clock.seek(linkedTimeUtcMs);
12
+ if (definition.pacing !== undefined)
13
+ clock.setRate(pacedRate(definition.pacing, clock.now()));
11
14
  if (definition.clock.playing !== false)
12
15
  clock.play();
13
16
  return clock;
@@ -15,6 +15,7 @@ import { readoutPairOf } from "./sceneLayout.js";
15
15
  import { SceneLabelLayer } from "./SceneLabels.js";
16
16
  import { attachScenePointer } from "./scenePointer.js";
17
17
  import { StoryMarkerLayer } from "./StoryMarkers.js";
18
+ import { releaseDotTexture } from "./dotMaterial.js";
18
19
  import { releaseAnchorSprite } from "./TrackedBodyView.js";
19
20
  /** The catalogued body a focus or label id names: the Sun's shell item stands for the Sun body. */
20
21
  export function bodyIdOf(runtime, catalogue, id) {
@@ -99,7 +100,7 @@ export function useSceneFrame(rootRef, inputs) {
99
100
  * the pictures are disposed, which every renderer that drew them hears and forgets.
100
101
  */
101
102
  export function useReleaseSharedTextures() {
102
- useEffect(() => () => { releaseGlowTexture(); releaseAnchorSprite(); }, []);
103
+ useEffect(() => () => { releaseGlowTexture(); releaseAnchorSprite(); releaseDotTexture(); }, []);
103
104
  }
104
105
  /**
105
106
  * Wakes the draw rule for changes the scene cannot see in its own numbers: every load that starts, progresses, ends or fails (textures, the sky
@@ -128,8 +128,8 @@ export interface CameraStep {
128
128
  export declare function viewUpOf(ctx: Pick<FrameContext, "runtime" | "controls">): RenderVector;
129
129
  /** A frame is drawn only once every body's group and orientation node is mounted. */
130
130
  export declare function bodiesMounted(runtime: SceneRuntime, refs: BodyRefs): boolean;
131
- /** Stage 0: the time of this frame; looping playback wraps inside its window first. */
132
- export declare function frameTime(runtime: SceneRuntime, controls: Pick<SceneControls, "loop">): number;
131
+ /** Stage 0: the time of this frame; looping playback wraps inside its window first, and other playback stops on the window's edge (a scene with a timeline bar). */
132
+ export declare function frameTime(runtime: SceneRuntime, controls: Pick<SceneControls, "loop" | "paceAuto">): number;
133
133
  /** Stage 1: brings every view to the time of the frame. Returns the live body-set look. */
134
134
  export declare function syncViews(ctx: FrameContext, t: number): BodySetLook;
135
135
  /** Stage 2: places the composition about the scene centre and keeps the camera's framing when the scale policy changed. */
@@ -1,6 +1,7 @@
1
1
  import { bootShowing, hideBootLoader } from "../shell/bootLoader.js";
2
2
  import { drawnRadii } from "./bodyDraw.js";
3
3
  import { DEFAULT_BODY_SET_LOOK, familyColorOf } from "./bodySet.js";
4
+ import { applyPacing } from "../core/pacing.js";
4
5
  import { poseCamera, resolveCamera } from "./CameraController.js";
5
6
  import { DEFAULT_CAMERA_FAR } from "./experienceDefinition.js";
6
7
  import { DEFAULT_FEATURE_MIN_BODY_PX } from "./FeatureMarkers.js";
@@ -33,10 +34,14 @@ export function viewUpOf(ctx) {
33
34
  export function bodiesMounted(runtime, refs) {
34
35
  return runtime.bodies.every((id) => refs.groups.has(id) && refs.orients.has(id));
35
36
  }
36
- /** Stage 0: the time of this frame; looping playback wraps inside its window first. */
37
+ /** Stage 0: the time of this frame; looping playback wraps inside its window first, and other playback stops on the window's edge (a scene with a timeline bar). */
37
38
  export function frameTime(runtime, controls) {
38
39
  if (controls.loop === true && runtime.loopWindow !== undefined)
39
40
  runtime.clock.wrapWithin(runtime.loopWindow);
41
+ else if (runtime.stopAtWindow === true && runtime.loopWindow !== undefined)
42
+ runtime.clock.stopWithin(runtime.loopWindow);
43
+ if (controls.paceAuto === true && runtime.pacing !== undefined)
44
+ applyPacing(runtime.clock, runtime.pacing);
40
45
  return runtime.clock.now();
41
46
  }
42
47
  /** Stage 1: brings every view to the time of the frame. Returns the live body-set look. */
@@ -1,7 +1,7 @@
1
1
  import { type BodyCatalogue } from "../assets/catalogue.js";
2
2
  import type { BodyId } from "../core/body.js";
3
3
  import type { ScalePolicy } from "../core/scalePolicy.js";
4
- import type { CameraReach } from "./experienceDefinition.js";
4
+ import { type CameraReach } from "./experienceDefinition.js";
5
5
  /** A tracked body is a point: the camera may come very close and is framed in Earth radii. */
6
6
  export declare const TRACKED_MIN_DISTANCE = 0.002;
7
7
  export declare const TRACKED_DEFAULT_DISTANCE = 0.3;
@@ -1,5 +1,6 @@
1
1
  // Scene framing: default distances and fit rules for tracked bodies, groups and bare scenes.
2
2
  import { catalogue } from "../assets/catalogue.js";
3
+ import { DEFAULT_CAMERA_FAR } from "./experienceDefinition.js";
3
4
  /** A tracked body is a point: the camera may come very close and is framed in Earth radii. */
4
5
  export const TRACKED_MIN_DISTANCE = 0.002;
5
6
  export const TRACKED_DEFAULT_DISTANCE = 0.3;
@@ -52,14 +53,19 @@ export function fitReach(farthestUnits, aspect, fovDeg = CAMERA_FOV_DEG) {
52
53
  }
53
54
  /** The declared reach as the viewer applies it now: a fitting reach becomes a farthest zoom-out and far plane for the canvas shape `aspect` (width over height); any other is returned as is. */
54
55
  export function liveReach(declared, policy, aspect) {
55
- if (declared.fitOrbit === undefined)
56
- return declared;
56
+ if (declared.fitOrbit === undefined) {
57
+ if (declared.cover === undefined || declared.maxFocusDistance !== undefined)
58
+ return declared;
59
+ // I-114: a path past the planets widens the default zoom-out and far plane so it fits whole; the default is never narrowed.
60
+ const minFocusDistance = fitReach(scaleLength(policy, declared.cover.farthestKm()), aspect > 0 ? aspect : 1);
61
+ return { ...declared, minFocusDistance, far: Math.max(declared.far ?? DEFAULT_CAMERA_FAR, minFocusDistance * FAR_PER_REACH) };
62
+ }
57
63
  const maxFocusDistance = fitReach(scaleLength(policy, declared.fitOrbit.farthestKm()), aspect > 0 ? aspect : 1);
58
64
  return { maxFocusDistance, far: maxFocusDistance * FAR_PER_REACH };
59
65
  }
60
66
  /** Zoom limits per focus kind; a declared reach replaces only the farthest distance. */
61
67
  export function focusLimits(focus, frame, policy, declared) {
62
- const max = declared.maxFocusDistance ?? Math.max(30, frame.span * 3.5);
68
+ const max = declared.maxFocusDistance ?? Math.max(30, frame.span * 3.5, declared.minFocusDistance ?? 0);
63
69
  const member = frame.memberRadius?.(focus) ?? null;
64
70
  if (member !== null)
65
71
  return { min: Math.max(MEMBER_MIN_DISTANCE, member * BODY_MIN_FACTOR), max };
@@ -0,0 +1,33 @@
1
+ import type { TimeBounds } from "../core/trajectory.js";
2
+ /** The one clock's reading as a host sees it. */
3
+ export interface ViewerState {
4
+ readonly timeUtcMs: number;
5
+ /** Simulated seconds per real second. */
6
+ readonly rate: number;
7
+ readonly playing: boolean;
8
+ /** Only in a scene with pacing: true while pacing sets the rate, false once a visitor or the host has picked a speed. */
9
+ readonly auto?: boolean;
10
+ }
11
+ /** Who moved the clock: the clock running (`playback`), a person at the controls (`visitor`) or the host page (`host`). */
12
+ export type ViewerChangeCause = "playback" | "visitor" | "host";
13
+ /** What a mounted viewer lets the host do to its one clock. Seeking and rate changes go through the viewer's own handlers, so there is no second clock. */
14
+ export interface ViewerControl {
15
+ readonly window: TimeBounds;
16
+ /** The speeds the timeline offers. */
17
+ readonly rates: readonly number[];
18
+ read(): ViewerState;
19
+ seek(timeUtcMs: number): void;
20
+ /** True: the scene has pacing, so `"auto"` is a valid choice. */
21
+ readonly paced: boolean;
22
+ /** A number is a chosen speed; `"auto"` gives the rate back to the scene's pacing. */
23
+ setRate(rate: number | "auto"): void;
24
+ }
25
+ /** The viewer's side of the host link; the public API supplies the implementation (`ViewerLink`). */
26
+ export interface ViewerPort {
27
+ /** The viewer hands over its clock controls when it opens. */
28
+ attach(control: ViewerControl): void;
29
+ /** The viewer is going away: the controls are no longer valid. */
30
+ detach(): void;
31
+ /** The viewer reports the clock's current reading; the link tells the host only when it differs from the last one. */
32
+ publish(state: ViewerState, cause: ViewerChangeCause): void;
33
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { JUPITER } from "../../core/bodies/jupiter.js";
2
+ import { JUPITER_RINGS } from "./jupiterRings.js";
2
3
  const jupiterTextureUrl = new URL("../textures/jupiter-2k.jpg", import.meta.url).href;
3
4
  /** Donor material (src/entities/jupiter.ts); the fallback colour under and without the texture. */
4
5
  export const JUPITER_MATERIAL = Object.freeze({ color: "#d4a97a", roughness: 0.85, metalness: 0 });
@@ -28,6 +29,7 @@ export const JUPITER_VISUAL = Object.freeze({
28
29
  texture: JUPITER_TEXTURE,
29
30
  material: JUPITER_MATERIAL,
30
31
  textureYawRad: 0,
32
+ rings: JUPITER_RINGS,
31
33
  light: Object.freeze({ ambient: 0.08, directional: 1.4 }),
32
34
  });
33
35
  export const JUPITER_ENTRY = Object.freeze({ body: JUPITER.id, visual: JUPITER_VISUAL });
@@ -1,11 +1,7 @@
1
1
  import { type MoonCatalogue } from "../moonCatalogue.js";
2
- import { type RingSystem } from "../rings.js";
3
2
  /** The moon lists by family of Saturn (292), Uranus (28), Neptune (16) and Pluto (5): data/moons/<planet>.json (T-115). Core data: an experience chooses which to show. */
4
3
  export declare const SATURN_MOON_CATALOGUE: MoonCatalogue;
5
4
  export declare const URANUS_MOON_CATALOGUE: MoonCatalogue;
6
5
  export declare const NEPTUNE_MOON_CATALOGUE: MoonCatalogue;
7
6
  export declare const PLUTO_MOON_CATALOGUE: MoonCatalogue;
8
- /** Ring bands from the NASA NSSDC ring fact sheets with the donor's looks (data/rings/<planet>.json, T-118). Pluto has none. */
9
- export declare const SATURN_RINGS: RingSystem;
10
- export declare const URANUS_RINGS: RingSystem;
11
- export declare const NEPTUNE_RINGS: RingSystem;
7
+ export { NEPTUNE_RINGS, SATURN_RINGS, URANUS_RINGS } from "./outerPlanetRings.js";
@@ -1,12 +1,8 @@
1
- import { NEPTUNE_MOON_CATALOGUE_FILE, NEPTUNE_RING_FILE, PLUTO_MOON_CATALOGUE_FILE, SATURN_MOON_CATALOGUE_FILE, SATURN_RING_FILE, URANUS_MOON_CATALOGUE_FILE, URANUS_RING_FILE } from "../../core/bodies/outerPlanetData.js";
1
+ import { NEPTUNE_MOON_CATALOGUE_FILE, PLUTO_MOON_CATALOGUE_FILE, SATURN_MOON_CATALOGUE_FILE, URANUS_MOON_CATALOGUE_FILE } from "../../core/bodies/outerPlanetData.js";
2
2
  import { parseMoonCatalogue } from "../moonCatalogue.js";
3
- import { parseRingSystem } from "../rings.js";
4
3
  /** The moon lists by family of Saturn (292), Uranus (28), Neptune (16) and Pluto (5): data/moons/<planet>.json (T-115). Core data: an experience chooses which to show. */
5
4
  export const SATURN_MOON_CATALOGUE = parseMoonCatalogue(SATURN_MOON_CATALOGUE_FILE);
6
5
  export const URANUS_MOON_CATALOGUE = parseMoonCatalogue(URANUS_MOON_CATALOGUE_FILE);
7
6
  export const NEPTUNE_MOON_CATALOGUE = parseMoonCatalogue(NEPTUNE_MOON_CATALOGUE_FILE);
8
7
  export const PLUTO_MOON_CATALOGUE = parseMoonCatalogue(PLUTO_MOON_CATALOGUE_FILE);
9
- /** Ring bands from the NASA NSSDC ring fact sheets with the donor's looks (data/rings/<planet>.json, T-118). Pluto has none. */
10
- export const SATURN_RINGS = parseRingSystem(SATURN_RING_FILE);
11
- export const URANUS_RINGS = parseRingSystem(URANUS_RING_FILE);
12
- export const NEPTUNE_RINGS = parseRingSystem(NEPTUNE_RING_FILE);
8
+ export { NEPTUNE_RINGS, SATURN_RINGS, URANUS_RINGS } from "./outerPlanetRings.js";
@@ -0,0 +1,5 @@
1
+ import { type RingSystem } from "../rings.js";
2
+ /** Ring bands from the NASA NSSDC ring fact sheets with the donor's looks (data/rings/<planet>.json, T-118). Pluto has none. Core data: the planet's catalogue visual carries them. */
3
+ export declare const SATURN_RINGS: RingSystem;
4
+ export declare const URANUS_RINGS: RingSystem;
5
+ export declare const NEPTUNE_RINGS: RingSystem;
@@ -0,0 +1,6 @@
1
+ import { NEPTUNE_RING_FILE, SATURN_RING_FILE, URANUS_RING_FILE } from "../../core/bodies/outerPlanetRingData.js";
2
+ import { parseRingSystem } from "../rings.js";
3
+ /** Ring bands from the NASA NSSDC ring fact sheets with the donor's looks (data/rings/<planet>.json, T-118). Pluto has none. Core data: the planet's catalogue visual carries them. */
4
+ export const SATURN_RINGS = parseRingSystem(SATURN_RING_FILE);
5
+ export const URANUS_RINGS = parseRingSystem(URANUS_RING_FILE);
6
+ export const NEPTUNE_RINGS = parseRingSystem(NEPTUNE_RING_FILE);
@@ -4,6 +4,7 @@ import { withPicture } from "../pictures.js";
4
4
  const neptuneUrl = new URL("../textures/neptune-2k.jpg", import.meta.url).href;
5
5
  const saturnUrl = new URL("../textures/saturn-2k.jpg", import.meta.url).href;
6
6
  const uranusUrl = new URL("../textures/uranus-2k.jpg", import.meta.url).href;
7
+ import { NEPTUNE_RINGS, SATURN_RINGS, URANUS_RINGS } from "./outerPlanetRings.js";
7
8
  /**
8
9
  * Saturn, Uranus, Neptune and Pluto, nine moons with maps, and Phobos and Deimos without (O-033 T-116). The maps are copied from Planetary Explorer
9
10
  * (the owner's own project, donor commit 84f8d3e), byte for byte where shippable (SHA-256 equal to `data/bodies/<body>/map.json`); Dione, Triton and
@@ -30,12 +31,14 @@ const sphere = (url, widthPx, heightPx, licence, color, roughness, textureYawRad
30
31
  light: LIGHT,
31
32
  });
32
33
  /** A sphere whose picture (and its licence) ships in astraeus-data and is registered by name; without it the sphere is a flat colour. */
34
+ /** A planet drawn with its rings: the ring bands (and their recorded sources) belong to the planet's one catalogue definition. */
35
+ const ringed = (visual, rings) => Object.freeze({ ...visual, rings });
33
36
  const pictured = (picture, color, roughness, textureYawRad = 0) => withPicture(picture, { kind: "sphere", material: Object.freeze({ color, roughness, metalness: 0 }), textureYawRad, light: LIGHT });
34
37
  /** Phobos and Deimos: grey spheres at their mean radius, with no map (the donor draws them as dots; no map of either is shipped). */
35
38
  const greyBall = (color) => Object.freeze({ kind: "sphere", material: Object.freeze({ color, roughness: 0.97, metalness: 0 }), light: LIGHT });
36
- export const SATURN_VISUAL = sphere(saturnUrl, 2048, 1024, solarSystemScope("Saturn", "Solar System Scope Saturn texture (donor saturn-2k.jpg, derived locally from its saturn-4k.jpg, which is the 4096x2048 file the Solar System Scope download endpoint gave; donor README: License CC BY 4.0 per the Solar System Scope textures page)"), "#d8c090", 0.85);
37
- export const URANUS_VISUAL = sphere(uranusUrl, 2048, 1024, solarSystemScope("Uranus", "Solar System Scope 2k_uranus.jpg (byte-identical to the donor's uranus-2k.jpg; no donor README entry, source recorded by Astraeus in tools/import/planetary-explorer-map-sources.json)"), "#9fd5df", 0.85);
38
- export const NEPTUNE_VISUAL = sphere(neptuneUrl, 2048, 1024, solarSystemScope("Neptune", "Solar System Scope 2k_neptune.jpg (byte-identical to the donor's neptune-2k.jpg; no donor README entry, source recorded by Astraeus in tools/import/planetary-explorer-map-sources.json)"), "#4a6fd0", 0.85);
39
+ export const SATURN_VISUAL = ringed(sphere(saturnUrl, 2048, 1024, solarSystemScope("Saturn", "Solar System Scope Saturn texture (donor saturn-2k.jpg, derived locally from its saturn-4k.jpg, which is the 4096x2048 file the Solar System Scope download endpoint gave; donor README: License CC BY 4.0 per the Solar System Scope textures page)"), "#d8c090", 0.85), SATURN_RINGS);
40
+ export const URANUS_VISUAL = ringed(sphere(uranusUrl, 2048, 1024, solarSystemScope("Uranus", "Solar System Scope 2k_uranus.jpg (byte-identical to the donor's uranus-2k.jpg; no donor README entry, source recorded by Astraeus in tools/import/planetary-explorer-map-sources.json)"), "#9fd5df", 0.85), URANUS_RINGS);
41
+ export const NEPTUNE_VISUAL = ringed(sphere(neptuneUrl, 2048, 1024, solarSystemScope("Neptune", "Solar System Scope 2k_neptune.jpg (byte-identical to the donor's neptune-2k.jpg; no donor README entry, source recorded by Astraeus in tools/import/planetary-explorer-map-sources.json)"), "#4a6fd0", 0.85), NEPTUNE_RINGS);
39
42
  export const PLUTO_VISUAL = pictured("pluto", "#c4a58a", 0.95, Math.PI);
40
43
  export const MIMAS_VISUAL = pictured("mimas", "#a8a8a8", 0.95);
41
44
  export const ENCELADUS_VISUAL = pictured("enceladus", "#e8eef0", 0.9);
@@ -1,8 +1,9 @@
1
1
  import { IO_PERIOD_DAYS } from "../core/bodies/io.js";
2
+ import { MOON_SIDEREAL_PERIOD_DAYS } from "../core/bodies/moon.js";
2
3
  import { catalogue } from "./catalogue.js";
3
4
  import { resolveOrbitLook } from "./orbitLook.js";
4
5
  /** One sidereal month, the span the Moon's orbit path covers. */
5
- export const SIDEREAL_MONTH_MS = 27.321661 * 86_400_000;
6
+ export const SIDEREAL_MONTH_MS = MOON_SIDEREAL_PERIOD_DAYS * 86_400_000;
6
7
  export class CompositionError extends RangeError {
7
8
  constructor(message) {
8
9
  super(message);
@@ -46,7 +46,7 @@ export interface BodyVisual {
46
46
  readonly marker?: {
47
47
  readonly sizePx: number;
48
48
  };
49
- /** Flat ring bands in the body's equator plane, at their real radii; an experience opts in through its visual overrides. */
49
+ /** Flat ring bands in the body's equator plane, at their real radii; a ringed planet carries them in its catalogue visual, so every scene that adds it draws them (an override may still replace them). */
50
50
  readonly rings?: RingSystem;
51
51
  /** This body's own lights in its render pass. */
52
52
  readonly light?: {
@@ -103,6 +103,7 @@ export const IO = Object.freeze({
103
103
  radiusKm: 1821.49,
104
104
  gmKm3S2: 5959.9155,
105
105
  parentId: "jupiter",
106
+ orbitPeriodDays: IO_PERIOD_DAYS,
106
107
  orientation: "tidal-lock",
107
108
  accuracy: Object.freeze({
108
109
  dimensions: createProvenance({
@@ -111,7 +112,7 @@ export const IO = Object.freeze({
111
112
  accuracy: "Mean radius 1821.49 km and GM 5959.9155 km^3/s^2 as printed in the Horizons header; Io is drawn as a sphere.",
112
113
  notes: "Gravitational parameter in km^3/s^2.",
113
114
  }),
114
- position: fittedMoonPosition("Io", 0.0994),
115
+ position: fittedMoonPosition("Io", 0.1924, JUPITER_MOON_FIT_SPAN),
115
116
  validUtc: JUPITER_MOON_FIT_SPAN,
116
117
  orientationLimitations: Object.freeze([IO_TIDAL_LOCK_LIMITATION]),
117
118
  }),
@@ -20,7 +20,7 @@ export declare const loadJupiterMoons: (load: MoonSystemLoad) => Promise<import(
20
20
  export declare const osculatingPeriodMs: (ephemeris: import("../chebyshevEphemeris.js").ChebyshevEphemeris, body: BodyId, timeUtcMs: number) => number;
21
21
  export declare const FITTED_MOON_TIDAL_LOCK: string;
22
22
  /** What every mapped Jupiter moon's record says about its position, with its own worst figure from T-096. */
23
- export declare const fittedMoonPosition: (label: string, worstM: number) => ReturnType<typeof import("../provenance.js").createProvenance>;
23
+ export declare const fittedMoonPosition: (label: string, worstM: number, span?: TimeBounds) => ReturnType<typeof import("../provenance.js").createProvenance>;
24
24
  /** The Galilean moons turn synchronously: their prime meridians are the IAU records saved with their orbits (`data/orbits/`), the one source. */
25
25
  export declare const IO_ROTATION: import("../iauRotation.js").IauRotationElements;
26
26
  export declare const EUROPA: import("../body.js").CelestialBodyDefinition;
@@ -1,12 +1,13 @@
1
1
  import { iauElementsFromRecord } from "../iauRotation.js";
2
+ import { recordPeriodDays } from "../siderealPeriod.js";
2
3
  import { JUPITER } from "./jupiter.js";
3
- import { chunksNeeded, createMoonSystem, MOON_FIT_SPAN, moonFitSource } from "./moonSystem.js";
4
+ import { chunksNeeded, createMoonSystem, HISTORICAL_MOON_FIT_SPAN, moonFitSource } from "./moonSystem.js";
4
5
  import callistoOrbit from "../../../data/orbits/callisto.json" with { type: "json" };
5
6
  import europaOrbit from "../../../data/orbits/europa.json" with { type: "json" };
6
7
  import ganymedeOrbit from "../../../data/orbits/ganymede.json" with { type: "json" };
7
8
  import ioOrbit from "../../../data/orbits/io.json" with { type: "json" };
8
9
  /** The span the committed fits cover (T-096: 2010-01-01 to 2030-01-01 TDB, chunked per calendar year). */
9
- export const JUPITER_MOON_FIT_SPAN = MOON_FIT_SPAN;
10
+ export const JUPITER_MOON_FIT_SPAN = HISTORICAL_MOON_FIT_SPAN;
10
11
  export const JUPITER_MOON_FIT_SOURCE = moonFitSource("Jupiter");
11
12
  export const JUPITER_MOON_SYSTEM = createMoonSystem({
12
13
  centre: "jupiter",
@@ -27,10 +28,10 @@ export const FITTED_MOON_TIDAL_LOCK = JUPITER_MOON_SYSTEM.tidalLockNote;
27
28
  export const fittedMoonPosition = JUPITER_MOON_SYSTEM.position;
28
29
  /** The Galilean moons turn synchronously: their prime meridians are the IAU records saved with their orbits (`data/orbits/`), the one source. */
29
30
  export const IO_ROTATION = iauElementsFromRecord(ioOrbit.rotation);
30
- const jupiterMoon = (id, label, radiusKm, gmKm3S2, worstM, header) => JUPITER_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header });
31
- export const EUROPA = jupiterMoon("europa", "Europa", 1560.8, 3202.7121, 0.0755, "Mean radius (km) = 1560.8 +- 0.3, GM (km^3/s^2) = 3202.7121 +- 0.0054");
32
- export const GANYMEDE = jupiterMoon("ganymede", "Ganymede", 2631.2, 9887.8328, 0.0662, "Mean radius (km) = 2631.2 +- 1.7, GM (km^3/s^2) = 9887.8328 +- 0.0074");
33
- export const CALLISTO = jupiterMoon("callisto", "Callisto", 2410.3, 7179.2834, 0.0521, "Mean radius (km) = 2410.3 +- 1.5, GM (km^3/s^2) = 7179.2834 +- 0.0097");
31
+ const jupiterMoon = (id, label, radiusKm, gmKm3S2, worstM, header, orbit) => JUPITER_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header, orbitPeriodDays: recordPeriodDays(orbit), span: HISTORICAL_MOON_FIT_SPAN });
32
+ export const EUROPA = jupiterMoon("europa", "Europa", 1560.8, 3202.7121, 0.163, "Mean radius (km) = 1560.8 +- 0.3, GM (km^3/s^2) = 3202.7121 +- 0.0054", europaOrbit);
33
+ export const GANYMEDE = jupiterMoon("ganymede", "Ganymede", 2631.2, 9887.8328, 0.1206, "Mean radius (km) = 2631.2 +- 1.7, GM (km^3/s^2) = 9887.8328 +- 0.0074", ganymedeOrbit);
34
+ export const CALLISTO = jupiterMoon("callisto", "Callisto", 2410.3, 7179.2834, 0.0947, "Mean radius (km) = 2410.3 +- 1.5, GM (km^3/s^2) = 7179.2834 +- 0.0097", callistoOrbit);
34
35
  /** Io's binding is in `io.ts` with its definition; the three below are the same pattern. */
35
36
  export const IO_FITTED_BINDING = JUPITER_MOON_SYSTEM.binding("io", IO_ROTATION);
36
37
  export const MAPPED_MOON_BINDINGS = Object.freeze([
@@ -8,4 +8,6 @@ export declare const MOON_IAU_REPORT = "Archinal et al., Report of the IAU Worki
8
8
  */
9
9
  export declare const MOON_ROTATION: IauRotationElements;
10
10
  export declare const MOON_EPHEMERIS: EphemerisRecord;
11
+ /** One sidereal month, days: the Moon's period about Earth. */
12
+ export declare const MOON_SIDEREAL_PERIOD_DAYS = 27.321661;
11
13
  export declare const MOON: CelestialBodyDefinition;
@@ -36,6 +36,8 @@ export const MOON_EPHEMERIS = {
36
36
  "No velocity is modelled for the Moon, so it has no speed readout.",
37
37
  ],
38
38
  };
39
+ /** One sidereal month, days: the Moon's period about Earth. */
40
+ export const MOON_SIDEREAL_PERIOD_DAYS = 27.321661;
39
41
  export const MOON = Object.freeze({
40
42
  id: "moon",
41
43
  label: "Moon",
@@ -43,6 +45,8 @@ export const MOON = Object.freeze({
43
45
  radiusKm: 1737.4,
44
46
  gmKm3S2: 4902.800066,
45
47
  parentId: "earth",
48
+ orbitPeriodDays: MOON_SIDEREAL_PERIOD_DAYS,
49
+ orbitLineFades: true,
46
50
  orientation: "iau-rotation",
47
51
  accuracy: Object.freeze({
48
52
  dimensions: createProvenance({