astraeus 0.2.0 → 0.4.0

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 (75) hide show
  1. package/CHANGELOG.md +44 -0
  2. package/README.md +72 -9
  3. package/package.json +2 -1
  4. package/src/api/AstraeusScene.js +1 -1
  5. package/src/api/AstraeusScene.node.js +37 -0
  6. package/src/api/activity.d.ts +1 -1
  7. package/src/api/activity.js +1 -1
  8. package/src/api/bodies.d.ts +2 -0
  9. package/src/api/bodies.js +2 -0
  10. package/src/api/group.d.ts +7 -1
  11. package/src/api/index.d.ts +2 -1
  12. package/src/api/index.js +2 -1
  13. package/src/api/index.node.js +8 -0
  14. package/src/api/mount.js +3 -1
  15. package/src/api/mount.node.js +36 -0
  16. package/src/api/scene.d.ts +51 -10
  17. package/src/api/scene.js +216 -55
  18. package/src/api/story.d.ts +8 -2
  19. package/src/api/story.js +11 -0
  20. package/src/api/sunOrbit.d.ts +6 -0
  21. package/src/api/sunOrbit.js +24 -0
  22. package/src/app/App.d.ts +6 -2
  23. package/src/app/App.js +8 -4
  24. package/src/app/App.node.js +401 -0
  25. package/src/app/PanelLoadBoundary.d.ts +2 -1
  26. package/src/app/PanelLoadBoundary.js +2 -2
  27. package/src/app/SceneLabels.d.ts +2 -0
  28. package/src/app/SceneLabels.js +5 -1
  29. package/src/app/SkyView.d.ts +3 -3
  30. package/src/app/SkyView.js +19 -10
  31. package/src/app/TrackedBodyView.d.ts +9 -3
  32. package/src/app/TrackedBodyView.js +52 -13
  33. package/src/app/experienceDefinition.d.ts +8 -0
  34. package/src/app/mission.d.ts +2 -0
  35. package/src/app/pathRules.d.ts +7 -3
  36. package/src/app/pathRules.js +9 -5
  37. package/src/app/sceneContentsHooks.js +2 -2
  38. package/src/app/sceneDebug.d.ts +4 -2
  39. package/src/app/sceneFrame.js +5 -4
  40. package/src/app/sceneFraming.d.ts +13 -0
  41. package/src/app/sceneFraming.js +22 -0
  42. package/src/app/skyModel.js +1 -1
  43. package/src/assets/pictures.d.ts +1 -1
  44. package/src/assets/sky.d.ts +4 -4
  45. package/src/assets/sky.js +12 -13
  46. package/src/core/bodies/io.js +1 -1
  47. package/src/core/bodies/jupiterData.js +2 -2
  48. package/src/core/bodies/jupiterMoons.js +8 -12
  49. package/src/core/bodies/moon.d.ts +8 -0
  50. package/src/core/bodies/moon.js +28 -5
  51. package/src/core/bodies/outerPlanetData.js +7 -7
  52. package/src/core/bodies/planetMoons.js +18 -27
  53. package/src/core/bodies/swiftTuttle.js +2 -0
  54. package/src/core/elementsBody.d.ts +2 -0
  55. package/src/core/elementsBody.js +3 -0
  56. package/src/core/moonTrajectory.js +3 -5
  57. package/src/core/planetModels.js +1 -1
  58. package/src/core/provenance.d.ts +6 -2
  59. package/src/core/provenance.js +3 -1
  60. package/src/core/scalePolicy.d.ts +2 -0
  61. package/src/core/scalePolicy.js +2 -0
  62. package/src/shell/AstraeusShell.js +5 -3
  63. package/src/shell/AstraeusShell.node.js +225 -0
  64. package/src/shell/DisplaySwitches.js +1 -1
  65. package/src/shell/StoryPanelView.js +3 -1
  66. package/src/shell/TimelineBar.node.js +75 -0
  67. package/src/shell/TopBar.node.js +14 -0
  68. package/src/shell/experience.d.ts +2 -0
  69. package/src/shell/infoModel.js +3 -1
  70. package/src/shell/phone.css +1 -1
  71. package/src/shell/useDrawers.js +1 -1
  72. package/src/shell/useZoomThrough.d.ts +7 -0
  73. package/src/shell/useZoomThrough.js +51 -0
  74. package/src/synthetic/syntheticProbeDefinition.d.ts +5 -0
  75. package/src/synthetic/syntheticProbeDefinition.js +38 -0
@@ -1,10 +1,17 @@
1
1
  import { AdditiveBlending, BufferAttribute, BufferGeometry, DoubleSide, LinearFilter, LinearMipmapLinearFilter, Group, Mesh, Points, ShaderMaterial, NoColorSpace, TextureLoader, Vector3 } from "three";
2
- import { ESO_PICTURE } from "../assets/sky.js";
2
+ import { MILKY_WAY_PICTURE } from "../assets/sky.js";
3
3
  import { buildPictureMesh, buildStarBuffers } from "./skyModel.js";
4
4
  // Both draws sit before everything else in the first pass (the layer-0 pass), ignore depth, and write none.
5
5
  const SKY_ORDER = -1000;
6
- /** Strength of the picture at brightness 1: the Milky Way is a backdrop, not the subject. */
7
- const PICTURE_GAIN = 0.5;
6
+ /** Strength of the picture at brightness 1, applied after the dimming below (1: the slider scales what the dimming leaves). */
7
+ const PICTURE_GAIN = 1;
8
+ /**
9
+ * The picture is a bright render, so it is dimmed the way Star Explorer dims its sky texture (an sRGB texture times a dark grey, drawn
10
+ * additively): decode to linear light, multiply, encode again. 0.04 gives a mean grey of about 2.2%, the level of the owner's
11
+ * 2026-10-27 trial (linear x 0.04, which at the old gain of 0.5 was written x 2). With a pure 2.2 power the decode and encode cancel,
12
+ * so this is a flat scale of the stored (sRGB) value by 0.04^(1/2.2), about 0.2315, the same for faint and bright values. Look-tuning is the Milky Way brightness setting, which scales the result.
13
+ */
14
+ const PICTURE_DIM = 0.04;
8
15
  /** A fixed render-frame direction used to read the sky back: where it lands on screen depends only on the camera orientation. */
9
16
  const PROBE_DIRECTION = new Vector3(0.62, 0.35, -0.7).normalize();
10
17
  const PICTURE_VERTEX = `
@@ -16,9 +23,11 @@ void main() {
16
23
  const PICTURE_FRAGMENT = `
17
24
  uniform sampler2D uMap;
18
25
  uniform float uGain;
26
+ uniform float uDim;
19
27
  varying vec2 vUv;
20
28
  void main() {
21
- gl_FragColor = vec4(texture2D(uMap, vUv).rgb * uGain, 1.0);
29
+ vec3 linear = pow(texture2D(uMap, vUv).rgb, vec3(2.2)) * uDim;
30
+ gl_FragColor = vec4(pow(linear, vec3(1.0 / 2.2)) * uGain, 1.0);
22
31
  }`;
23
32
  // A star is a small Gaussian core: `aSize` is its width at half maximum in CSS pixels, the sprite is wide enough to hold three
24
33
  // sigma either side, and the fragment measures the distance from the star's centre in device pixels, so it is sharp at any pixel ratio.
@@ -71,9 +80,9 @@ export class SkyView {
71
80
  this.#brightness = milkyWayBrightness;
72
81
  this.#maxAnisotropy = maxAnisotropy;
73
82
  if (options.pictures !== undefined)
74
- this.#build(ESO_PICTURE, options.pictures);
83
+ this.#build(MILKY_WAY_PICTURE, options.pictures);
75
84
  else if (options.picture !== null)
76
- this.#build(options.picture ?? ESO_PICTURE);
85
+ this.#build(options.picture ?? MILKY_WAY_PICTURE);
77
86
  this.#starMaterial = new ShaderMaterial({
78
87
  vertexShader: STAR_VERTEX,
79
88
  fragmentShader: STAR_FRAGMENT,
@@ -93,7 +102,7 @@ export class SkyView {
93
102
  set.tiles.forEach((tile, index) => {
94
103
  const texture = textures?.[index] ?? new TextureLoader().load(tile.url);
95
104
  this.#textures.push(texture);
96
- // Raw sRGB goes to the framebuffer as it is (no decode and re-encode per pixel); mipmaps and anisotropic filtering keep the
105
+ // The texture is read as raw sRGB values and the shader does the dimming (PICTURE_DIM); mipmaps and anisotropic filtering keep the
97
106
  // picture from sparkling when it is drawn smaller than the file, and the magnified case is plain bilinear.
98
107
  texture.colorSpace = NoColorSpace;
99
108
  texture.generateMipmaps = true;
@@ -104,7 +113,7 @@ export class SkyView {
104
113
  const material = new ShaderMaterial({
105
114
  vertexShader: PICTURE_VERTEX,
106
115
  fragmentShader: PICTURE_FRAGMENT,
107
- uniforms: { uMap: { value: texture }, uGain: { value: PICTURE_GAIN * this.#brightness } },
116
+ uniforms: { uMap: { value: texture }, uDim: { value: PICTURE_DIM }, uGain: { value: PICTURE_GAIN * this.#brightness } },
108
117
  side: DoubleSide,
109
118
  depthTest: false,
110
119
  depthWrite: false,
@@ -137,10 +146,10 @@ export class SkyView {
137
146
  this.#textures = [];
138
147
  this.#held = false;
139
148
  }
140
- /** Builds the ESO panorama the first time it is wanted (nothing is decoded while the picture stays off); a no-op once a picture is held. */
149
+ /** Builds the Milky Way picture the first time it is wanted (nothing is decoded while the picture stays off); a no-op once a picture is held. */
141
150
  requestPicture() {
142
151
  if (!this.#held)
143
- this.#build(ESO_PICTURE);
152
+ this.#build(MILKY_WAY_PICTURE);
144
153
  }
145
154
  /** Sets the star strength in place (0 to 2); no rebuild. */
146
155
  setStarBrightness(value) {
@@ -1,9 +1,10 @@
1
- import { DataTexture, Group, type Camera, type Vector3 } from "three";
1
+ import { DataTexture, Group, Vector3, type Camera } from "three";
2
2
  import type { ScalePolicy } from "../core/scalePolicy.js";
3
3
  import type { FloatingOrigin } from "./floatingOrigin.js";
4
+ import type { PathScreenReadout } from "./PathView.js";
4
5
  import { type TrackedBody } from "./mission.js";
5
- import type { PathRule } from "./experienceDefinition.js";
6
6
  import { type RenderVector } from "./renderCoordinates.js";
7
+ import type { PathRule } from "./experienceDefinition.js";
7
8
  import { type ScenePlacement } from "./sceneLayout.js";
8
9
  /** Drawn after Earth and Moon so overlays are never swallowed by a body in a compressed scale. */
9
10
  export declare const TRACK_LAYER = 3;
@@ -22,7 +23,7 @@ export declare function releaseAnchorSprite(): void;
22
23
  export declare class TrackedBodyView {
23
24
  #private;
24
25
  readonly body: TrackedBody;
25
- /** A tracked body's path is a relative trail, drawn by the same rule as every path (`pathRules.ts`). */
26
+ /** Every tracked body's path is one rule, a relative trail (`pathRules.ts`); the body it is drawn against is the path's own `lineFixedTo`, default the scene centre. */
26
27
  static readonly pathRule: PathRule;
27
28
  readonly group: Group<import("three").Object3DEventMap>;
28
29
  /** Anchor labels in anchor order, or null when the body has none. */
@@ -31,6 +32,11 @@ export declare class TrackedBodyView {
31
32
  /** Scaled absolute target for the camera; holds the nearest bound outside the trajectory. */
32
33
  absolute(timeUtcMs: number, policy: ScalePolicy, placement: ScenePlacement): RenderVector;
33
34
  update(timeUtcMs: number, policy: ScalePolicy, origin: FloatingOrigin, camera: Camera, placement: ScenePlacement): void;
35
+ /**
36
+ * Diagnostic for the browser checks (`data-paths`, O-046 T-193): whether the path is drawn, the vertices of its two lines (travelled and future) in front of the camera and inside the view, and the box they cover
37
+ * as shares of the view. Both lines together are the whole path, so a line fixed to the Sun reads the same at any time. The line box repeats the vertex box.
38
+ */
39
+ screenReadout(camera: Camera): PathScreenReadout;
34
40
  /** Local (floating-origin) render position of anchor `index` as last drawn. */
35
41
  anchorLocalPosition(index: number, out: Vector3): Vector3;
36
42
  }
@@ -1,8 +1,8 @@
1
- import { BufferAttribute, BufferGeometry, DataTexture, Group, Line, LineBasicMaterial, Mesh, MeshBasicMaterial, Points, PointsMaterial, RGBAFormat, SphereGeometry, } from "three";
1
+ import { BufferAttribute, BufferGeometry, DataTexture, Group, Line, LineBasicMaterial, Mesh, MeshBasicMaterial, Points, PointsMaterial, RGBAFormat, SphereGeometry, Vector3, } from "three";
2
2
  import { anchorLabelsOf, markerRadiusUnits, sampleTrackedPositions, stateClampedToBounds, stateIfInBounds, travelledCount } from "./mission.js";
3
- import { mapPathKm, relativeTrailKm } from "./pathRules.js";
3
+ import { mapPathKm, relativeTrailKm, shiftedBy } from "./pathRules.js";
4
4
  import { eqjToRenderVector } from "./renderCoordinates.js";
5
- import { trackedAbsolute } from "./sceneLayout.js";
5
+ import { sceneOffsetKm, trackedAbsolute } from "./sceneLayout.js";
6
6
  /** Drawn after Earth and Moon so overlays are never swallowed by a body in a compressed scale. */
7
7
  export const TRACK_LAYER = 3;
8
8
  function lineWithCapacity(count, color, opacity) {
@@ -54,7 +54,7 @@ export function releaseAnchorSprite() {
54
54
  */
55
55
  export class TrackedBodyView {
56
56
  body;
57
- /** A tracked body's path is a relative trail, drawn by the same rule as every path (`pathRules.ts`). */
57
+ /** Every tracked body's path is one rule, a relative trail (`pathRules.ts`); the body it is drawn against is the path's own `lineFixedTo`, default the scene centre. */
58
58
  static pathRule = Object.freeze({ kind: "trail", frame: "relative" });
59
59
  group = new Group();
60
60
  #marker;
@@ -64,6 +64,7 @@ export class TrackedBodyView {
64
64
  #samples;
65
65
  #anchorKm;
66
66
  #mappedFor = "";
67
+ #mappedAt = 0;
67
68
  #placedFor = null;
68
69
  #mappedPath = new Float64Array(0);
69
70
  #mappedAnchors = new Float64Array(0);
@@ -103,7 +104,7 @@ export class TrackedBodyView {
103
104
  return trackedAbsolute(stateClampedToBounds(this.body, timeUtcMs), policy, placement);
104
105
  }
105
106
  update(timeUtcMs, policy, origin, camera, placement) {
106
- this.#remap(policy, placement);
107
+ this.#remap(policy, placement, timeUtcMs);
107
108
  // Mapped positions are not consistent with body radii in ReadableScale, so only TrueScale occludes.
108
109
  const occlude = policy.id === "true-scale";
109
110
  for (const material of this.#materials)
@@ -123,22 +124,31 @@ export class TrackedBodyView {
123
124
  }
124
125
  }
125
126
  /**
126
- * A relative trail: each sample is the body's position from the scene centre at that sample's own time, so a
127
- * scene centred where the trajectory is measured draws the samples as they are.
127
+ * A relative trail (`pathRules.ts`): each sample is the body's position from `lineFixedTo` (default the scene centre) at that sample's own time.
128
+ * A line fixed to a body other than the scene centre is carried to where that body is from the centre at the display time, so it
129
+ * is remapped as the clock moves; a line against the scene centre depends on the centre and scale alone.
128
130
  */
129
- #remap(policy, placement) {
131
+ #remap(policy, placement, timeUtcMs) {
130
132
  const placed = placement.center;
131
- if (this.#mappedFor === policy.id && this.#placedFor === placed)
133
+ const moves = this.#against(placement) !== placed;
134
+ if (this.#mappedFor === policy.id && this.#placedFor === placed && (!moves || this.#mappedAt === timeUtcMs))
132
135
  return;
133
- this.#mappedPath = mapPathKm(this.#relative(this.#samples, placement), policy);
134
- this.#mappedAnchors = mapPathKm(this.#relative({ timesUtcMs: this.body.anchorTimesUtcMs, positionsKm: this.#anchorKm }, placement), policy);
136
+ this.#mappedPath = mapPathKm(this.#relative(this.#samples, placement, timeUtcMs), policy);
137
+ this.#mappedAnchors = mapPathKm(this.#relative({ timesUtcMs: this.body.anchorTimesUtcMs, positionsKm: this.#anchorKm }, placement, timeUtcMs), policy);
135
138
  this.#mappedFor = policy.id;
136
139
  this.#placedFor = placed;
140
+ this.#mappedAt = timeUtcMs;
137
141
  }
138
- #relative(samples, placement) {
142
+ #against(placement) {
143
+ return this.body.lineFixedTo ?? placement.center;
144
+ }
145
+ #relative(samples, placement, timeUtcMs) {
139
146
  if (samples.timesUtcMs.length === 0)
140
147
  return samples.positionsKm;
141
- return relativeTrailKm(samples, this.body.trajectory.stateAt(samples.timesUtcMs[0]).center, placement);
148
+ const against = this.#against(placement);
149
+ const drawn = relativeTrailKm(samples, this.body.trajectory.stateAt(samples.timesUtcMs[0]).center, placement, against);
150
+ const carry = sceneOffsetKm(placement, against, timeUtcMs);
151
+ return carry === null ? drawn : shiftedBy(drawn, carry);
142
152
  }
143
153
  /** Writes [leading?] samples [from, to) [trailing?] into the line and sets how much of it is drawn. */
144
154
  #fillPath(line, from, to, leading, trailing, origin) {
@@ -159,6 +169,35 @@ export class TrackedBodyView {
159
169
  positions.needsUpdate = true;
160
170
  line.geometry.setDrawRange(0, written >= 2 ? written : 0);
161
171
  }
172
+ /**
173
+ * Diagnostic for the browser checks (`data-paths`, O-046 T-193): whether the path is drawn, the vertices of its two lines (travelled and future) in front of the camera and inside the view, and the box they cover
174
+ * as shares of the view. Both lines together are the whole path, so a line fixed to the Sun reads the same at any time. The line box repeats the vertex box.
175
+ */
176
+ screenReadout(camera) {
177
+ camera.updateMatrixWorld();
178
+ const point = new Vector3();
179
+ let [vertices, inView, minX, maxX, minY, maxY] = [0, 0, 1, 0, 1, 0];
180
+ for (const line of [this.#travelled, this.#future]) {
181
+ const positions = line.geometry.getAttribute("position");
182
+ const drawn = line.geometry.drawRange.count;
183
+ vertices += drawn;
184
+ for (let i = 0; i < drawn; i += 1) {
185
+ point.fromBufferAttribute(positions, i).applyMatrix4(camera.matrixWorldInverse);
186
+ if (point.z >= 0)
187
+ continue;
188
+ point.applyMatrix4(camera.projectionMatrix);
189
+ if (Math.abs(point.x) > 1 || Math.abs(point.y) > 1)
190
+ continue;
191
+ const [x, y] = [(point.x + 1) / 2, (1 - point.y) / 2];
192
+ inView += 1;
193
+ minX = Math.min(minX, x);
194
+ maxX = Math.max(maxX, x);
195
+ minY = Math.min(minY, y);
196
+ maxY = Math.max(maxY, y);
197
+ }
198
+ }
199
+ return { id: this.body.id, visible: this.group.visible && vertices > 0, vertices, inView, minX, maxX, minY, maxY, lineMinX: minX, lineMaxX: maxX, lineMinY: minY, lineMaxY: maxY, axisDeg: 0, aspect: camera.aspect ?? 1, look: null };
200
+ }
162
201
  /** Local (floating-origin) render position of anchor `index` as last drawn. */
163
202
  anchorLocalPosition(index, out) {
164
203
  return out.fromBufferAttribute(this.#anchors.geometry.getAttribute("position"), index);
@@ -129,6 +129,14 @@ export interface CameraReach {
129
129
  readonly maxFocusDistance?: number;
130
130
  /** Far clipping plane; must exceed `maxFocusDistance` when both are given. */
131
131
  readonly far?: number;
132
+ /**
133
+ * Fit the farthest zoom-out to one orbit about the Sun instead of a fixed `maxFocusDistance`: `farthestKm` is the orbit's farthest Sun distance
134
+ * (read once the viewer needs it, after the planet series load). The viewer turns it into a distance for the live canvas shape (`fitReach`) and
135
+ * re-fits when the canvas changes shape. Takes the place of `maxFocusDistance` and `far`, which a fitting reach does not carry.
136
+ */
137
+ readonly fitOrbit?: {
138
+ readonly farthestKm: () => number;
139
+ };
132
140
  }
133
141
  /** The scene's far plane when an experience declares none. */
134
142
  export declare const DEFAULT_CAMERA_FAR = 5000;
@@ -20,6 +20,8 @@ export interface TrackedBody {
20
20
  readonly anchorLabels?: readonly string[];
21
21
  /** Published position discrepancy per reconstruction segment, in time order. */
22
22
  readonly positionDiscrepancies?: readonly PositionDiscrepancy[];
23
+ /** The body the line is drawn against, at each sample's own time; absent: the scene centre. */
24
+ readonly lineFixedTo?: string;
23
25
  /** The trajectory's own Provenance, passed through unchanged. */
24
26
  readonly provenance?: Provenance;
25
27
  }
@@ -13,13 +13,17 @@ export declare function mapPathKm(positionsKm: Float64Array, policy: ScalePolicy
13
13
  * offsets, so a source need not be catalogued: it only has to say which catalogued body it is measured from.
14
14
  *
15
15
  * - orbit: every sample about its centre, the whole line carried to the centre's place from the scene centre at the clock time.
16
- * - relative trail: each sample from the scene centre at that sample's own time (what an observer riding the centre saw).
16
+ * - relative trail: each sample from `against` (default the scene centre) at that sample's own time; against another body it is then carried to the scene centre at the display time.
17
17
  * - inertial trail: each sample in the common root frame at its own time, then from the scene centre at the display time.
18
18
  */
19
19
  /** Orbit: the samples (about `center`) plus the one vector from the scene centre to `center` at the clock time. Returns the input when that vector is zero. */
20
20
  export declare function orbitKm(samplesKm: Float64Array, center: CenterId, placement: ScenePlacement, clockUtcMs: number): Float64Array;
21
- /** Relative trail: sample i plus the scene centre's offset to `native` at time i. Returns the input when `native` is the scene centre. */
22
- export declare function relativeTrailKm(samples: PathSamples, native: CenterId, placement: ScenePlacement): Float64Array;
21
+ /**
22
+ * Relative trail: sample i plus the offset from `native` to `against` at time i, so the line is drawn against `against` (default the scene
23
+ * centre: what an observer riding the centre saw). Returns the input when `native` is `against`. Fixing the line to another body leaves it
24
+ * about that body; `sceneOffsetKm(placement, against, displayUtcMs)` then carries it to the scene centre at the display time.
25
+ */
26
+ export declare function relativeTrailKm(samples: PathSamples, native: CenterId, placement: ScenePlacement, against?: CenterId): Float64Array;
23
27
  /** Inertial trail, first half: each sample in the root frame at its own time. Does not depend on the scene centre or the clock, so it is computed once. */
24
28
  export declare function rootFrameKm(samples: PathSamples, native: CenterId, placement: ScenePlacement): Float64Array;
25
29
  /** Inertial trail, second half: root-frame samples as seen from the scene centre at the display time. */
@@ -12,7 +12,7 @@ export function mapPathKm(positionsKm, policy) {
12
12
  * offsets, so a source need not be catalogued: it only has to say which catalogued body it is measured from.
13
13
  *
14
14
  * - orbit: every sample about its centre, the whole line carried to the centre's place from the scene centre at the clock time.
15
- * - relative trail: each sample from the scene centre at that sample's own time (what an observer riding the centre saw).
15
+ * - relative trail: each sample from `against` (default the scene centre) at that sample's own time; against another body it is then carried to the scene centre at the display time.
16
16
  * - inertial trail: each sample in the common root frame at its own time, then from the scene centre at the display time.
17
17
  */
18
18
  /** Orbit: the samples (about `center`) plus the one vector from the scene centre to `center` at the clock time. Returns the input when that vector is zero. */
@@ -20,13 +20,17 @@ export function orbitKm(samplesKm, center, placement, clockUtcMs) {
20
20
  const offset = sceneOffsetKm(placement, center, clockUtcMs);
21
21
  return offset === null ? samplesKm : shiftedBy(samplesKm, offset);
22
22
  }
23
- /** Relative trail: sample i plus the scene centre's offset to `native` at time i. Returns the input when `native` is the scene centre. */
24
- export function relativeTrailKm(samples, native, placement) {
25
- if (samples.timesUtcMs.length === 0 || native === placement.center)
23
+ /**
24
+ * Relative trail: sample i plus the offset from `native` to `against` at time i, so the line is drawn against `against` (default the scene
25
+ * centre: what an observer riding the centre saw). Returns the input when `native` is `against`. Fixing the line to another body leaves it
26
+ * about that body; `sceneOffsetKm(placement, against, displayUtcMs)` then carries it to the scene centre at the display time.
27
+ */
28
+ export function relativeTrailKm(samples, native, placement, against = placement.center) {
29
+ if (samples.timesUtcMs.length === 0 || native === against)
26
30
  return samples.positionsKm;
27
31
  const out = Float64Array.from(samples.positionsKm);
28
32
  samples.timesUtcMs.forEach((time, index) => {
29
- const offset = placement.resolver.offsetKm(native, placement.center, time);
33
+ const offset = placement.resolver.offsetKm(native, against, time);
30
34
  for (let k = 0; k < 3; k += 1)
31
35
  out[index * 3 + k] += offset[k];
32
36
  });
@@ -9,7 +9,7 @@ import { releaseGlowTexture } from "./bodyDraw.js";
9
9
  import { assetWithOverride } from "./experienceDefinition.js";
10
10
  import { FeatureMarkerLayer } from "./FeatureMarkers.js";
11
11
  import { bodiesMounted, runFrame } from "./sceneFrame.js";
12
- import { focusLimits } from "./sceneFraming.js";
12
+ import { focusLimits, liveReach } from "./sceneFraming.js";
13
13
  import { useHostLayer } from "./sceneHooks.js";
14
14
  import { readoutPairOf } from "./sceneLayout.js";
15
15
  import { SceneLabelLayer } from "./SceneLabels.js";
@@ -76,7 +76,7 @@ export function useOverlayLayers(canvas, controls, trackedViews, bodySetViews) {
76
76
  /** Wires the canvas's orbit gestures, hover and tap picking to the camera and frame state. */
77
77
  export function useScenePointer(canvas, runtime, controls, catalogue, orbit, state) {
78
78
  useEffect(() => {
79
- const limits = () => focusLimits(bodyIdOf(runtime, catalogue, orbit.current.focus) ?? orbit.current.focus, { centre: runtime.sceneCenter, span: state.current.spanScaled, bodies: catalogue }, controls.policy, runtime.cameraReach);
79
+ const limits = () => focusLimits(bodyIdOf(runtime, catalogue, orbit.current.focus) ?? orbit.current.focus, { centre: runtime.sceneCenter, span: state.current.spanScaled, bodies: catalogue }, controls.policy, liveReach(runtime.cameraReach, controls.policy, canvas.clientHeight > 0 ? canvas.clientWidth / canvas.clientHeight : 1));
80
80
  return attachScenePointer(canvas, orbit.current, state.current, limits, (id) => controls.onPickObject?.(id));
81
81
  // eslint-disable-next-line react-hooks/exhaustive-deps
82
82
  }, [canvas, controls]);
@@ -3,7 +3,7 @@ import type { SimulationClock } from "../core/clock.js";
3
3
  import type { ScalePolicy } from "../core/scalePolicy.js";
4
4
  import type { StateResolver } from "../core/stateResolver.js";
5
5
  import type { Camera } from "three";
6
- import type { PathView } from "./PathView.js";
6
+ import type { PathScreenReadout } from "./PathView.js";
7
7
  import type { BodyScreenReadout } from "./sceneBodies.js";
8
8
  import { type DebugReadout } from "./debugReadout.js";
9
9
  import type { FloatingOrigin } from "./floatingOrigin.js";
@@ -23,7 +23,9 @@ export declare function publishSceneData(canvas: HTMLElement, state: {
23
23
  * What the browser scripts read back about every drawn path line (`data-paths`, JSON): per path its id, whether it is drawn, its vertex count, how many
24
24
  * vertices are in view and the share of the view they span (with the box's edges, the major axis angle on screen and the view's aspect), and for an orbit its look in force. This is the line itself, so a check that a path is drawn never depends on its label.
25
25
  */
26
- export declare function publishPathData(canvas: HTMLElement, views: readonly PathView[], camera: Camera): void;
26
+ export declare function publishPathData(canvas: HTMLElement, views: readonly {
27
+ screenReadout(camera: Camera): PathScreenReadout;
28
+ }[], camera: Camera): void;
27
29
  /**
28
30
  * What the browser scripts read back about every point group (`data-points`, JSON): per group its id, whether it is drawn, its member count, how many members
29
31
  * are in view (an even sample scaled up) and the share of the view they span. This is the dots themselves, so a check that a stream is drawn never depends on pixels.
@@ -6,7 +6,7 @@ import { DEFAULT_CAMERA_FAR } from "./experienceDefinition.js";
6
6
  import { DEFAULT_FEATURE_MIN_BODY_PX } from "./FeatureMarkers.js";
7
7
  import { rescaleCameraForPolicy, stepCameraTarget } from "./sceneCamera.js";
8
8
  import { buildFrameReadout, publishBodyData, publishPathData, publishPointsData, publishSceneData, recordFrameStats } from "./sceneDebug.js";
9
- import { focusRadius } from "./sceneFraming.js";
9
+ import { focusRadius, liveReach } from "./sceneFraming.js";
10
10
  import { bodyScreenReadouts, placeBodies, swapSmallBodiesToMarkers } from "./sceneBodies.js";
11
11
  import { publishBodySets } from "./sceneBodySets.js";
12
12
  import { bodyAbsolute, placeComposition } from "./sceneLayout.js";
@@ -95,11 +95,12 @@ export function stepAndPoseCamera(ctx, t, placed) {
95
95
  const targets = { bodyIdFor: ctx.bodyIdFor, placed: placed.composed.absolutes, absoluteOf: placed.absoluteOf, groupViews: views.groupViews, sunCentredViews: views.sunCentredViews, trackedViews: views.trackedViews, bodySetViews: views.bodySetViews, timeUtcMs: t, policy, placement: ctx.placement };
96
96
  const firstFrame = !state.started;
97
97
  state.started = true;
98
- const focusBody = stepCameraTarget({ camState: orbit, controls, targets, frame, catalogue, reach: runtime.cameraReach, fovDeg: camera.fov, viewUp, firstFrame, previousUp: state.lastUp });
98
+ const reach = liveReach(runtime.cameraReach, policy, camera.aspect);
99
+ const focusBody = stepCameraTarget({ camState: orbit, controls, targets, frame, catalogue, reach, fovDeg: camera.fov, viewUp, firstFrame, previousUp: state.lastUp });
99
100
  state.lastUp = viewUp;
100
101
  resolveCamera(orbit, focusAbsoluteOf(targets, orbit.focus), ctx.origin, ctx.delta, REBASE_THRESHOLD, viewUp);
101
102
  placeBodies(ctx.assets, placed.composed.states, ctx.bodyRefs, policy, ctx.origin);
102
- poseCamera(camera, orbit, focusRadius(focusBody, policy, catalogue), ctx.origin, runtime.cameraReach.far ?? DEFAULT_CAMERA_FAR, viewUp);
103
+ poseCamera(camera, orbit, focusRadius(focusBody, policy, catalogue), ctx.origin, reach.far ?? DEFAULT_CAMERA_FAR, viewUp);
103
104
  if (firstFrame)
104
105
  requestAnimationFrame(() => hideBootLoader(state.coverShowing));
105
106
  controls.viewReadout = viewFromAngles(orbit.focus, orbit.azimuth, orbit.elevation, orbit.distance);
@@ -146,7 +147,7 @@ export function placeViews(ctx, t, placed, setLook) {
146
147
  for (const layer of ctx.layers.bodySetLabels.current)
147
148
  layer.update(setLook, hoverGain);
148
149
  publishBodySets(canvas, views.bodySetViews, views.orbitSetViews, setLook, camera, size.width, size.height);
149
- publishPathData(canvas, [...views.sunCentredViews, ...views.compositionPaths], camera);
150
+ publishPathData(canvas, [...views.sunCentredViews, ...views.compositionPaths, ...views.trackedViews], camera);
150
151
  publishPointsData(canvas, views.groupViews, camera, views.bodySetViews);
151
152
  return hoverGain;
152
153
  }
@@ -32,6 +32,19 @@ export interface SceneFrame {
32
32
  * `poseCamera`), so even a 1 km moon's ball is drawn rather than cut away.
33
33
  */
34
34
  export declare const MEMBER_MIN_DISTANCE = 0.0015;
35
+ /** The camera's vertical field of view in degrees (the Canvas's `fov`). */
36
+ export declare const CAMERA_FOV_DEG = 45;
37
+ /** Room left round a fitted orbit, as a multiple. */
38
+ export declare const ORBIT_FIT_MARGIN = 1.1;
39
+ /** The far plane of a fitted reach, as a multiple of the reach (what `camera.setReach` uses too). */
40
+ export declare const FAR_PER_REACH = 2.5;
41
+ /**
42
+ * The camera-to-focus distance at which a sphere of radius `farthestUnits` about the focus fits the canvas from any view direction:
43
+ * the farthest distance divided by the sine of the narrower half field of view (vertical, or horizontal from the aspect ratio), times the margin.
44
+ */
45
+ export declare function fitReach(farthestUnits: number, aspect: number, fovDeg?: number): number;
46
+ /** 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. */
47
+ export declare function liveReach(declared: CameraReach, policy: ScalePolicy, aspect: number): CameraReach;
35
48
  /** Zoom limits per focus kind; a declared reach replaces only the farthest distance. */
36
49
  export declare function focusLimits(focus: BodyId, frame: SceneFrame, policy: ScalePolicy, declared: CameraReach): {
37
50
  min: number;
@@ -35,6 +35,28 @@ function sphereRadius(focus, policy, source) {
35
35
  // A marker-kind body that also draws a self-bright sphere (emissive) has that radius too: the camera must stay outside it.
36
36
  return asset.visual.kind === "sphere" || asset.visual.emissive === true ? policy.mapRadius(asset.definition.radiusKm, asset.definition.id) : null;
37
37
  }
38
+ /** The camera's vertical field of view in degrees (the Canvas's `fov`). */
39
+ export const CAMERA_FOV_DEG = 45;
40
+ /** Room left round a fitted orbit, as a multiple. */
41
+ export const ORBIT_FIT_MARGIN = 1.1;
42
+ /** The far plane of a fitted reach, as a multiple of the reach (what `camera.setReach` uses too). */
43
+ export const FAR_PER_REACH = 2.5;
44
+ /**
45
+ * The camera-to-focus distance at which a sphere of radius `farthestUnits` about the focus fits the canvas from any view direction:
46
+ * the farthest distance divided by the sine of the narrower half field of view (vertical, or horizontal from the aspect ratio), times the margin.
47
+ */
48
+ export function fitReach(farthestUnits, aspect, fovDeg = CAMERA_FOV_DEG) {
49
+ const halfVertical = (fovDeg * Math.PI) / 360;
50
+ const halfHorizontal = Math.atan(Math.tan(halfVertical) * aspect);
51
+ return (ORBIT_FIT_MARGIN * farthestUnits) / Math.sin(Math.min(halfVertical, halfHorizontal));
52
+ }
53
+ /** 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
+ export function liveReach(declared, policy, aspect) {
55
+ if (declared.fitOrbit === undefined)
56
+ return declared;
57
+ const maxFocusDistance = fitReach(scaleLength(policy, declared.fitOrbit.farthestKm()), aspect > 0 ? aspect : 1);
58
+ return { maxFocusDistance, far: maxFocusDistance * FAR_PER_REACH };
59
+ }
38
60
  /** Zoom limits per focus kind; a declared reach replaces only the farthest distance. */
39
61
  export function focusLimits(focus, frame, policy, declared) {
40
62
  const max = declared.maxFocusDistance ?? Math.max(30, frame.span * 3.5);
@@ -32,7 +32,7 @@ export function skyObject(status) {
32
32
  const provenance = createProvenance({
33
33
  sourceType: "observed",
34
34
  sources: SKY_SOURCES,
35
- accuracy: "Star directions are the catalogue's J2000 positions to about an arcsecond. The Milky Way picture is the ESO photographic panorama, placed by its galactic coordinates (agrees with the stars only to a few degrees).",
35
+ accuracy: "Star directions are the catalogue's J2000 positions to about an arcsecond. The Milky Way picture is a Gaia EDR3 render with the foreground stars removed, placed by its galactic coordinates (the Magellanic Clouds land within half a degree).",
36
36
  notes: starLine,
37
37
  });
38
38
  return {
@@ -1,7 +1,7 @@
1
1
  import type { TextureRef } from "./licence.js";
2
2
  import type { BodyVisual } from "./visual.js";
3
3
  /**
4
- * Pictures that ship in a data package (`astraeus-data`) rather than in the engine, by name: a body id (`titan`), `venus-8k`, `milky-way-left`.
4
+ * Pictures that ship in a data package (`astraeus-data`) rather than in the engine, by name: a body id (`titan`), `venus-8k`, `milky-way`.
5
5
  * Each carries its own licence record, so the credit travels with the file (PROV-02). A picture that was never registered is simply absent:
6
6
  * the body is drawn as a flat colour, the sky without its Milky Way (DATA-01: nothing is invented to fill the gap).
7
7
  */
@@ -71,12 +71,12 @@ export declare function starAppearance(vMag: number): {
71
71
  readonly brightness: number;
72
72
  };
73
73
  /**
74
- * The picture in two square halves, left (longitude 180 to 0, running to the centre) then right; each is under every GPU's texture limit.
75
- * The files ship in astraeus-data (names "milky-way-left", "milky-way-right"); without that package the list is empty and no picture is drawn.
74
+ * The picture, one 3840x1920 image (under every GPU's texture limit). The file ships in astraeus-data (name "milky-way");
75
+ * without that package the list is empty and no picture is drawn.
76
76
  */
77
77
  export declare const milkyWayTiles: () => readonly TextureRef[];
78
- /** The ESO panorama as a two-tile galactic picture: the one Milky Way picture. */
79
- export declare const ESO_PICTURE: PictureSet;
78
+ /** The Gaia EDR3 render (stars removed) as a one-tile galactic picture: the one Milky Way picture. */
79
+ export declare const MILKY_WAY_PICTURE: PictureSet;
80
80
  export declare const SKY_SOURCES: readonly string[];
81
81
  /** What an experience may say about the sky: all fields optional, default on at full brightness, with the Milky Way picture off. */
82
82
  export interface SkySettings {
package/src/assets/sky.js CHANGED
@@ -116,24 +116,23 @@ export function starAppearance(vMag) {
116
116
  }
117
117
  // ---------------------------------------------------------------- sources and the shell item
118
118
  /**
119
- * The picture in two square halves, left (longitude 180 to 0, running to the centre) then right; each is under every GPU's texture limit.
120
- * The files ship in astraeus-data (names "milky-way-left", "milky-way-right"); without that package the list is empty and no picture is drawn.
119
+ * The picture, one 3840x1920 image (under every GPU's texture limit). The file ships in astraeus-data (name "milky-way");
120
+ * without that package the list is empty and no picture is drawn.
121
121
  */
122
- export const milkyWayTiles = () => ["milky-way-left", "milky-way-right"].flatMap((name) => pictureOf(name) ?? []);
123
- /** The ESO panorama as a two-tile galactic picture: the one Milky Way picture. */
124
- export const ESO_PICTURE = Object.freeze({
125
- name: "ESO Milky Way panorama (eso0932a)",
126
- columns: 2,
122
+ export const milkyWayTiles = () => ["milky-way"].flatMap((name) => pictureOf(name) ?? []);
123
+ /** The Gaia EDR3 render (stars removed) as a one-tile galactic picture: the one Milky Way picture. */
124
+ export const MILKY_WAY_PICTURE = Object.freeze({
125
+ name: "Milky Way, Gaia EDR3 render without foreground stars (Kevinmloch)",
126
+ columns: 1,
127
127
  rows: 1,
128
128
  get tiles() {
129
- const halves = milkyWayTiles();
130
- return halves.length < 2 ? [] : halves.map((tile, column) => Object.freeze({ column, row: 0, url: tile.url, widthPx: tile.widthPx, heightPx: tile.heightPx }));
129
+ return milkyWayTiles().map((tile) => Object.freeze({ column: 0, row: 0, url: tile.url, widthPx: tile.widthPx, heightPx: tile.heightPx }));
131
130
  },
132
- credit: "ESO/S. Brunier",
133
- licence: "CC BY 4.0",
134
- source: "https://www.eso.org/public/images/eso0932a/",
131
+ credit: "Kevinmloch (bsrender), Gaia EDR3, ESA/Gaia/DPAC",
132
+ licence: "CC BY-SA 4.0",
133
+ source: "https://commons.wikimedia.org/wiki/File:Milky_Way_360_equirectangular_rendering_with_foreground_stars_removed.png",
135
134
  });
136
135
  export const SKY_SOURCES = Object.freeze([
137
136
  "HYG star database v4.2 (Hipparcos, Yale Bright Star, Gliese catalogues), astronexus (https://www.astronexus.com/projects/hyg), CC BY-SA 4.0. The star file only; the code is MIT.",
138
- "The Milky Way panorama, ESO/S. Brunier (https://www.eso.org/public/images/eso0932a/), CC BY 4.0.",
137
+ "The Milky Way picture: Milky Way render by Kevinmloch (bsrender) from Gaia EDR3, ESA/Gaia/DPAC (https://commons.wikimedia.org/wiki/File:Milky_Way_360_equirectangular_rendering_with_foreground_stars_removed.png), CC BY-SA 4.0. Resized.",
139
138
  ]);
@@ -6,7 +6,7 @@ import { createOrbTwoBodyAdapter } from "../twoBodyAdapter.js";
6
6
  import { JUPITER } from "./jupiter.js";
7
7
  import { trueAnomalyFromMean } from "../keplerAnomaly.js";
8
8
  import { fittedMoonPosition, IO_FITTED_BINDING, JUPITER_MOON_FIT_SPAN } from "./jupiterMoons.js";
9
- import ioRecord from "../../../data/orbits/io.json";
9
+ import ioRecord from "../../../data/orbits/io.json" with { type: "json" };
10
10
  export { trueAnomalyFromMean };
11
11
  const DEGREES = Math.PI / 180;
12
12
  const ORIENTATION_SAMPLE_SECONDS = 1800;
@@ -3,7 +3,7 @@
3
3
  * T-097) and the ring bands (data/rings/jupiter.json). Raw JSON: src/assets parses and checks them (layer rule: assets reach data
4
4
  * through core).
5
5
  */
6
- import moonCatalogueFile from "../../../data/moons/jupiter.json";
7
- import ringFile from "../../../data/rings/jupiter.json";
6
+ import moonCatalogueFile from "../../../data/moons/jupiter.json" with { type: "json" };
7
+ import ringFile from "../../../data/rings/jupiter.json" with { type: "json" };
8
8
  export const JUPITER_MOON_CATALOGUE_FILE = moonCatalogueFile;
9
9
  export const JUPITER_RING_FILE = ringFile;
@@ -1,14 +1,10 @@
1
1
  import { iauElementsFromRecord } from "../iauRotation.js";
2
2
  import { JUPITER } from "./jupiter.js";
3
3
  import { chunksNeeded, createMoonSystem, MOON_FIT_SPAN, moonFitSource } from "./moonSystem.js";
4
- import json1 from "../../../data/orbits/callisto.json";
5
- const { rotation: callistoRotation } = json1;
6
- import json2 from "../../../data/orbits/europa.json";
7
- const { rotation: europaRotation } = json2;
8
- import json3 from "../../../data/orbits/ganymede.json";
9
- const { rotation: ganymedeRotation } = json3;
10
- import json4 from "../../../data/orbits/io.json";
11
- const { rotation: ioRotation } = json4;
4
+ import callistoOrbit from "../../../data/orbits/callisto.json" with { type: "json" };
5
+ import europaOrbit from "../../../data/orbits/europa.json" with { type: "json" };
6
+ import ganymedeOrbit from "../../../data/orbits/ganymede.json" with { type: "json" };
7
+ import ioOrbit from "../../../data/orbits/io.json" with { type: "json" };
12
8
  /** The span the committed fits cover (T-096: 2010-01-01 to 2030-01-01 TDB, chunked per calendar year). */
13
9
  export const JUPITER_MOON_FIT_SPAN = MOON_FIT_SPAN;
14
10
  export const JUPITER_MOON_FIT_SOURCE = moonFitSource("Jupiter");
@@ -30,7 +26,7 @@ export const FITTED_MOON_TIDAL_LOCK = JUPITER_MOON_SYSTEM.tidalLockNote;
30
26
  /** What every mapped Jupiter moon's record says about its position, with its own worst figure from T-096. */
31
27
  export const fittedMoonPosition = JUPITER_MOON_SYSTEM.position;
32
28
  /** The Galilean moons turn synchronously: their prime meridians are the IAU records saved with their orbits (`data/orbits/`), the one source. */
33
- export const IO_ROTATION = iauElementsFromRecord(ioRotation);
29
+ export const IO_ROTATION = iauElementsFromRecord(ioOrbit.rotation);
34
30
  const jupiterMoon = (id, label, radiusKm, gmKm3S2, worstM, header) => JUPITER_MOON_SYSTEM.mappedMoon({ id, label, radiusKm, gmKm3S2, worstM, header });
35
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");
36
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");
@@ -38,7 +34,7 @@ export const CALLISTO = jupiterMoon("callisto", "Callisto", 2410.3, 7179.2834, 0
38
34
  /** Io's binding is in `io.ts` with its definition; the three below are the same pattern. */
39
35
  export const IO_FITTED_BINDING = JUPITER_MOON_SYSTEM.binding("io", IO_ROTATION);
40
36
  export const MAPPED_MOON_BINDINGS = Object.freeze([
41
- JUPITER_MOON_SYSTEM.binding(EUROPA.id, iauElementsFromRecord(europaRotation)),
42
- JUPITER_MOON_SYSTEM.binding(GANYMEDE.id, iauElementsFromRecord(ganymedeRotation)),
43
- JUPITER_MOON_SYSTEM.binding(CALLISTO.id, iauElementsFromRecord(callistoRotation)),
37
+ JUPITER_MOON_SYSTEM.binding(EUROPA.id, iauElementsFromRecord(europaOrbit.rotation)),
38
+ JUPITER_MOON_SYSTEM.binding(GANYMEDE.id, iauElementsFromRecord(ganymedeOrbit.rotation)),
39
+ JUPITER_MOON_SYSTEM.binding(CALLISTO.id, iauElementsFromRecord(callistoOrbit.rotation)),
44
40
  ]);
@@ -1,3 +1,11 @@
1
1
  import type { CelestialBodyDefinition, EphemerisRecord } from "../body.js";
2
+ import type { IauRotationElements } from "../iauRotation.js";
3
+ /** Source of the Moon's rotation constants (PROV-01). The 2015 report gives none for the Moon, so these are the 2009 report's, as NAIF saved them. */
4
+ export declare const MOON_IAU_REPORT = "Archinal et al., Report of the IAU Working Group on Cartographic Coordinates and Rotational Elements: 2009, Celestial Mechanics and Dynamical Astronomy 109, 101 (2011), as transcribed in NAIF pck00011.tpc (2022-12-27), BODY301 and BODY3_NUT_PREC_ANGLES";
5
+ /**
6
+ * The Moon's pole and prime meridian, including the report's libration terms E1 to E13 (the pole and W terms the report lists): degrees, pole per Julian
7
+ * century, W per day, from J2000 TDB. The report's -1.4e-12 d^2 term in W is left out (0.0005 degrees at 50 years from J2000). Body +X is longitude 0, +Z the pole.
8
+ */
9
+ export declare const MOON_ROTATION: IauRotationElements;
2
10
  export declare const MOON_EPHEMERIS: EphemerisRecord;
3
11
  export declare const MOON: CelestialBodyDefinition;