@johnmorrisdotca/wakusei-planets 0.49.0 → 0.51.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.
- package/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/element.d.ts +32 -3
- package/dist/space/element.js +80 -4
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/scene.d.ts +2 -0
- package/dist/space/scene.js +9 -2
- package/dist/space/sight.d.ts +23 -0
- package/dist/space/sight.js +20 -0
- package/dist/surface/element.d.ts +27 -0
- package/dist/surface/element.js +255 -7
- package/dist/surface/glsl.d.ts +5 -2
- package/dist/surface/glsl.js +33 -2
- package/dist/surface/index.d.ts +2 -1
- package/dist/surface/index.js +2 -1
- package/dist/surface/land.d.ts +6 -0
- package/dist/surface/land.js +8 -0
- package/dist/surface/landing.d.ts +134 -0
- package/dist/surface/landing.js +237 -0
- package/dist/surface/scene.d.ts +9 -0
- package/dist/surface/scene.js +108 -3
- package/dist/surface/shapes.d.ts +14 -0
- package/dist/surface/shapes.js +33 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/surface/element.js
CHANGED
|
@@ -4,6 +4,7 @@ import { TILES_BASE } from "../scene/textures.js";
|
|
|
4
4
|
import { madeGround, rocksAround, setKeepOut, standingPlace } from "./detail.js";
|
|
5
5
|
import { driveStep, driveView, ROVER, startDrive, toWorld } from "./drive.js";
|
|
6
6
|
import { DustField } from "./dust.js";
|
|
7
|
+
import { calloutsBy, clockText, LANDING, landingAt } from "./landing.js";
|
|
7
8
|
import { drop, groundAt } from "./height.js";
|
|
8
9
|
import { loadTerrain } from "./load.js";
|
|
9
10
|
import { createSurfaceItem } from "./scene.js";
|
|
@@ -27,10 +28,20 @@ const TEMPLATE = `<style>
|
|
|
27
28
|
.label[aria-pressed="true"] { background: rgba(255, 255, 255, 0.85); color: #10141c; }
|
|
28
29
|
#about { position: absolute; left: 8px; right: 8px; top: 8px; margin: 0; padding: 6px 10px; border-radius: 8px; background: rgba(0, 0, 0, 0.62); color: #e8ecf2; font: 400 12px/1.4 system-ui, sans-serif; pointer-events: none; max-width: 32em; }
|
|
29
30
|
#about[hidden] { display: none; }
|
|
31
|
+
#landing { position: absolute; inset: 8px; margin: 0; color: #e8ecf2; font: 400 12px/1.4 system-ui, sans-serif; text-shadow: 0 1px 2px #000; pointer-events: none; }
|
|
32
|
+
#landing[hidden] { display: none; }
|
|
33
|
+
#clock { margin: 0 0 4px; font-weight: 600; }
|
|
34
|
+
#callouts { margin: 0; padding: 0; list-style: none; }
|
|
35
|
+
#callouts li { opacity: 0.75; }
|
|
36
|
+
#callouts li:last-child { opacity: 1; font-weight: 600; }
|
|
37
|
+
#marker { position: absolute; left: 0; top: 0; width: 24px; height: 24px; margin: -12px 0 0 -12px; box-sizing: border-box; border: 1.5px solid rgba(255, 255, 255, 0.9); border-radius: 50%; box-shadow: 0 0 3px #000; pointer-events: none; will-change: transform; }
|
|
38
|
+
#markerText { position: absolute; left: 0; top: 0; margin: 0; font: 600 11px/1.2 system-ui, sans-serif; color: #fff; text-shadow: 0 0 3px #000, 0 0 3px #000; white-space: nowrap; pointer-events: none; will-change: transform; }
|
|
39
|
+
#marker[hidden], #markerText[hidden] { display: none; }
|
|
40
|
+
#curve { position: absolute; left: 0; right: 0; bottom: 50px; margin: 0; font-size: 11px; color: #c8ccd4; }
|
|
30
41
|
#stick { position: absolute; left: 18px; bottom: 44px; width: 104px; height: 104px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.4); background: rgba(255, 255, 255, 0.08); touch-action: none; }
|
|
31
42
|
#stick[hidden] { display: none; }
|
|
32
43
|
#knob { position: absolute; left: 50%; top: 50%; width: 44px; height: 44px; margin: -22px 0 0 -22px; border-radius: 50%; background: rgba(255, 255, 255, 0.55); pointer-events: none; }
|
|
33
|
-
</style><div id="stage"></div><p id="note"></p><p id="status" role="status"></p><div id="labels"></div><p id="about" role="status" hidden></p><div id="stick" part="stick" role="group" aria-label="Walk" hidden><div id="knob"></div></div>`;
|
|
44
|
+
</style><div id="stage"></div><p id="note"></p><p id="status" role="status"></p><div id="labels"></div><div id="landing" hidden><span id="marker" hidden></span><span id="markerText" hidden></span><p id="clock"></p><ul id="callouts"></ul><p id="curve"></p></div><p id="about" role="status" hidden></p><div id="stick" part="stick" role="group" aria-label="Walk" hidden><div id="knob"></div></div>`;
|
|
34
45
|
const num = (value, fallback) => {
|
|
35
46
|
const n = value === null || value.trim() === "" ? NaN : Number(value);
|
|
36
47
|
return Number.isFinite(n) ? n : fallback;
|
|
@@ -55,7 +66,7 @@ const num = (value, fallback) => {
|
|
|
55
66
|
* ```
|
|
56
67
|
*/
|
|
57
68
|
export class WakuseiSurface extends HTMLElement {
|
|
58
|
-
static observedAttributes = ["quality", "shadows", "detail", "exposure", "site", "time", "heading", "pitch", "fov", "tiles", "lang", "body", "standby", "scale", "stick", "objects", "drive", "drive-camera"];
|
|
69
|
+
static observedAttributes = ["quality", "shadows", "detail", "exposure", "site", "time", "heading", "pitch", "fov", "tiles", "lang", "body", "standby", "scale", "stick", "objects", "drive", "drive-camera", "watch", "watch-from", "watch-camera"];
|
|
59
70
|
#root;
|
|
60
71
|
#stage;
|
|
61
72
|
#noteEl;
|
|
@@ -110,6 +121,11 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
110
121
|
#dust = new DustField(900, 17);
|
|
111
122
|
#blockers = [];
|
|
112
123
|
#blockersAt;
|
|
124
|
+
/** The descent being watched (`watch="landing"`): the clock in seconds from ignition, whether it runs, how fast, which camera, where the ground camera stands, and how far the callouts have got. */
|
|
125
|
+
#landing;
|
|
126
|
+
#landingTimer;
|
|
127
|
+
#landingAt = 0;
|
|
128
|
+
#landingEyeUp = 0;
|
|
113
129
|
#stickPointer = -1;
|
|
114
130
|
#pointers = new Map();
|
|
115
131
|
#pinch = 0;
|
|
@@ -161,7 +177,7 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
161
177
|
/** Numbers for a test or a status line: the draws, the tiles, the renderer's own counts, the mesh, the quality of the last draw and the milliseconds of the last measured one. */
|
|
162
178
|
get stats() {
|
|
163
179
|
const scene = this.#view?.scene;
|
|
164
|
-
return { state: this.#state, draws: this.#draws, tiles: this.#progress, renderer: this.#renderer?.stats, mesh: scene?.mesh, quality: this.#quality(), scale: this.#drawScale, scaled: this.#scaled, vehicle: this.#vehicle === undefined ? undefined : { ...this.#vehicle, spin: [...this.#vehicle.spin] }, drawMs: scene?.drawMs ?? this.#drawMs, rocks: scene?.rocks ?? 0 };
|
|
180
|
+
return { state: this.#state, draws: this.#draws, tiles: this.#progress, renderer: this.#renderer?.stats, mesh: scene?.mesh, quality: this.#quality(), scale: this.#drawScale, scaled: this.#scaled, landing: this.landing, vehicle: this.#vehicle === undefined ? undefined : { ...this.#vehicle, spin: [...this.#vehicle.spin] }, drawMs: scene?.drawMs ?? this.#drawMs, rocks: scene?.rocks ?? 0 };
|
|
165
181
|
}
|
|
166
182
|
/** The quality of the next draw: the `quality` attribute, or in `auto` the quality of motion while the view moves and the machine's own quality of rest otherwise. */
|
|
167
183
|
#quality() {
|
|
@@ -217,6 +233,7 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
217
233
|
this.#abort?.abort();
|
|
218
234
|
clearTimeout(this.#flush);
|
|
219
235
|
this.#flush = undefined;
|
|
236
|
+
clearTimeout(this.#landingTimer);
|
|
220
237
|
this.#gate?.cancel();
|
|
221
238
|
clearTimeout(this.#walkTimer);
|
|
222
239
|
for (const [type, fn] of [["pointerdown", this.#onPointerDown], ["pointermove", this.#onPointerMove], ["pointerup", this.#onPointerUp], ["pointercancel", this.#onPointerUp], ["wheel", this.#onWheel], ["keydown", this.#onKeyDown], ["keyup", this.#onKeyUp], ["blur", this.#onBlur]])
|
|
@@ -234,6 +251,10 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
234
251
|
this.#syncDrive();
|
|
235
252
|
return;
|
|
236
253
|
}
|
|
254
|
+
if (name === "watch" || name === "watch-from" || name === "watch-camera") {
|
|
255
|
+
this.#syncLanding(name !== "watch");
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
237
258
|
if (name === "drive-camera") {
|
|
238
259
|
this.driveCamera = this.getAttribute("drive-camera") === "seat" ? "seat" : "chase";
|
|
239
260
|
return;
|
|
@@ -325,6 +346,7 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
325
346
|
this.#at = { east: stand.x, north: stand.y };
|
|
326
347
|
this.#placed = true;
|
|
327
348
|
this.#syncDrive();
|
|
349
|
+
this.#syncLanding();
|
|
328
350
|
}
|
|
329
351
|
if (this.#view === undefined) {
|
|
330
352
|
if (this.#renderer === undefined) {
|
|
@@ -414,6 +436,8 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
414
436
|
#eyeUp() {
|
|
415
437
|
if (this.#vehicle !== undefined)
|
|
416
438
|
return this.#driveEyeUp;
|
|
439
|
+
if (this.#landing !== undefined)
|
|
440
|
+
return this.#landingEyeUp;
|
|
417
441
|
return this.#groundAt(this.#at.east, this.#at.north) + EYE_HEIGHT;
|
|
418
442
|
}
|
|
419
443
|
/** Ask for a draw. A change of the view (`moving`, the default) is drawn at the quality of motion and followed, a moment after the last, by one at the quality of rest. */
|
|
@@ -468,7 +492,7 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
468
492
|
this.#measured += 1;
|
|
469
493
|
if (this.#drawScale < 1)
|
|
470
494
|
this.#scaled += 1;
|
|
471
|
-
scene.apply({ eye: { east: this.#at.east, north: this.#at.north, up: this.#eyeUp() }, look: this.#look, sky: this.#sky, shadows: this.getAttribute("shadows") !== "off", detail: this.getAttribute("detail") !== "off", exposure: num(this.getAttribute("exposure"), 1.6), quality: this.#quality(), scale: this.#drawScale, objects: this.#objects.length > 0, ...(this.#vehicle === undefined ? {} : { vehicle: this.#vehicle, trail: this.#trail, dust: this.#dust.position }), measure: measure || this.getAttribute("measure") !== null });
|
|
495
|
+
scene.apply({ eye: { east: this.#at.east, north: this.#at.north, up: this.#eyeUp() }, look: this.#look, sky: this.#sky, shadows: this.getAttribute("shadows") !== "off", detail: this.getAttribute("detail") !== "off", exposure: num(this.getAttribute("exposure"), 1.6), quality: this.#quality(), scale: this.#drawScale, objects: this.#objects.length > 0, ...(this.#vehicle === undefined ? {} : { vehicle: this.#vehicle, trail: this.#trail, dust: this.#dust.position }), ...(this.#landing === undefined ? {} : { lander: this.#landerState(), dust: this.#dust.position }), measure: measure || this.getAttribute("measure") !== null });
|
|
472
496
|
this.#view.invalidate();
|
|
473
497
|
this.#draws += 1;
|
|
474
498
|
this.#placeLabels();
|
|
@@ -609,6 +633,230 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
609
633
|
this.#changed();
|
|
610
634
|
return true;
|
|
611
635
|
}
|
|
636
|
+
// --- watching the landing (`watch="landing"`): Apollo 17's powered descent from the lunar module's window or from the ground ---------------------------------------------------------------------
|
|
637
|
+
/** The descent being watched: its clock in seconds from ignition, whether it runs, the camera and what the lunar module is doing at that moment; `undefined` when it is not watched. */
|
|
638
|
+
get landing() {
|
|
639
|
+
const l = this.#landing;
|
|
640
|
+
if (l === undefined)
|
|
641
|
+
return undefined;
|
|
642
|
+
const pose = landingAt(l.t);
|
|
643
|
+
return { t: l.t, playing: l.playing, rate: l.rate, camera: l.camera, altitude: pose.altitude, speed: pose.speed, descent: pose.descent };
|
|
644
|
+
}
|
|
645
|
+
/** The clock of the descent, in seconds from ignition (0 to 725). Setting it goes there at once, whether it runs or not. */
|
|
646
|
+
get landingTime() {
|
|
647
|
+
return this.#landing?.t ?? 0;
|
|
648
|
+
}
|
|
649
|
+
set landingTime(value) {
|
|
650
|
+
const l = this.#landing;
|
|
651
|
+
if (l === undefined)
|
|
652
|
+
return;
|
|
653
|
+
const old = l.t;
|
|
654
|
+
l.t = Math.min(LANDING.duration, Math.max(0, value));
|
|
655
|
+
// a seek forward announces the latest moment it passes (the picture lists the last three); a step of a second or less carries the dust on, a jump or a step back starts it afresh
|
|
656
|
+
const delta = l.t - old;
|
|
657
|
+
if (delta < 0 || delta > 1)
|
|
658
|
+
this.#dust = new DustField(20000, 17);
|
|
659
|
+
this.#landingAt = performance.now();
|
|
660
|
+
this.#landingFrame(delta > 0 && delta <= 1 ? delta : 0, true);
|
|
661
|
+
}
|
|
662
|
+
/** How fast the descent runs: 1 is the real time of it (12 minutes 5 seconds); 2, 4 and 8 are quicker. */
|
|
663
|
+
get landingRate() {
|
|
664
|
+
return this.#landing?.rate ?? 1;
|
|
665
|
+
}
|
|
666
|
+
set landingRate(value) {
|
|
667
|
+
if (this.#landing !== undefined)
|
|
668
|
+
this.#landing.rate = Math.min(16, Math.max(0.25, value));
|
|
669
|
+
}
|
|
670
|
+
/** Run the descent from where the clock is (from the start again if it had ended). */
|
|
671
|
+
playLanding() {
|
|
672
|
+
const l = this.#landing;
|
|
673
|
+
if (l === undefined)
|
|
674
|
+
return;
|
|
675
|
+
if (l.t >= LANDING.duration)
|
|
676
|
+
this.landingTime = l.camera === "ground" ? 540 : LANDING.viewStart;
|
|
677
|
+
l.playing = true;
|
|
678
|
+
this.#landingAt = performance.now();
|
|
679
|
+
this.#landingTick();
|
|
680
|
+
}
|
|
681
|
+
/** Hold the descent where it is. */
|
|
682
|
+
pauseLanding() {
|
|
683
|
+
if (this.#landing === undefined)
|
|
684
|
+
return;
|
|
685
|
+
this.#landing.playing = false;
|
|
686
|
+
clearTimeout(this.#landingTimer);
|
|
687
|
+
this.#landingFrame(0, true);
|
|
688
|
+
}
|
|
689
|
+
/** The touchdown point: where the lunar module stands at Apollo 17 (the published place), or the site point where it has none. */
|
|
690
|
+
#touchdown() {
|
|
691
|
+
const lm = this.#objects.find((o) => o.kind === "lander");
|
|
692
|
+
return lm === undefined ? { east: 0, north: 0 } : { east: lm.east, north: lm.north };
|
|
693
|
+
}
|
|
694
|
+
/** The lunar module as the scene draws it now: its place, its height over the ground under it, its heading and its thrust. */
|
|
695
|
+
#landerState() {
|
|
696
|
+
const l = this.#landing;
|
|
697
|
+
const pose = landingAt(l.t);
|
|
698
|
+
const td = this.#touchdown();
|
|
699
|
+
return { east: td.east + pose.east, north: td.north + pose.north, altitude: pose.altitude, heading: pose.heading, throttle: l.t >= LANDING.duration ? 0 : pose.throttle, inside: l.camera === "lander" };
|
|
700
|
+
}
|
|
701
|
+
/** Start or stop watching as the `watch` attribute says; `again` re-reads the camera and the place the ground camera stands at. */
|
|
702
|
+
#syncLanding(again = false) {
|
|
703
|
+
const on = this.getAttribute("watch") === "landing" && this.#terrain !== undefined && this.#placed;
|
|
704
|
+
if (!on) {
|
|
705
|
+
if (this.#landing === undefined)
|
|
706
|
+
return;
|
|
707
|
+
this.#landing = undefined;
|
|
708
|
+
clearTimeout(this.#landingTimer);
|
|
709
|
+
this.#root.getElementById("landing").hidden = true;
|
|
710
|
+
this.#readAttributes();
|
|
711
|
+
const td = this.#touchdown();
|
|
712
|
+
this.#at = { east: td.east, north: td.north };
|
|
713
|
+
this.#changed();
|
|
714
|
+
return;
|
|
715
|
+
}
|
|
716
|
+
const camera = this.getAttribute("watch-camera") === "ground" ? "ground" : "lander";
|
|
717
|
+
const [distance, bearing] = (this.getAttribute("watch-from") ?? "150 0").split(/[\s,]+/).map(Number);
|
|
718
|
+
const from = { distance: Number.isFinite(distance) ? distance : 150, bearing: Number.isFinite(bearing) ? bearing : 0 };
|
|
719
|
+
if (this.#landing !== undefined) {
|
|
720
|
+
if (!again)
|
|
721
|
+
return;
|
|
722
|
+
if (this.#landing.camera !== camera)
|
|
723
|
+
this.#look = clampLook({ ...this.#look, fov: camera === "ground" ? 27 : 74 });
|
|
724
|
+
this.#landing.camera = camera;
|
|
725
|
+
this.#landing.from = from;
|
|
726
|
+
this.#camOffset = { azimuth: 0, pitch: 0 };
|
|
727
|
+
this.#landingFrame(0, true);
|
|
728
|
+
return;
|
|
729
|
+
}
|
|
730
|
+
this.#landing = { t: camera === "ground" ? 540 : LANDING.viewStart, playing: true, rate: 1, camera, from, passed: 0, second: -1 };
|
|
731
|
+
this.#landing.passed = calloutsBy(this.#landing.t).length;
|
|
732
|
+
this.#dust = new DustField(20000, 17);
|
|
733
|
+
this.#camOffset = { azimuth: 0, pitch: 0 };
|
|
734
|
+
for (const el of this.#labelEls.values())
|
|
735
|
+
el.hidden = true;
|
|
736
|
+
this.choose(undefined);
|
|
737
|
+
this.#root.getElementById("landing").hidden = false;
|
|
738
|
+
this.#root.getElementById("curve").textContent = this.#lang() === "ja" ? "報告された時刻のあいだの高度と速度は、こちらで作った滑らかな曲線です。" : "Altitude and speed between the reported moments are a smooth curve of ours.";
|
|
739
|
+
if (camera === "ground")
|
|
740
|
+
this.#look = clampLook({ ...this.#look, fov: 27 });
|
|
741
|
+
this.#landingAt = performance.now();
|
|
742
|
+
this.#landingFrame(0, true);
|
|
743
|
+
this.#landingTick();
|
|
744
|
+
}
|
|
745
|
+
/** The frame of the descent at the clock: the eyes of the chosen camera, the sky of that real moment, the dust of the blast, the words on the picture and the event for a page; `seconds` is how far the clock has just moved. */
|
|
746
|
+
#landingFrame(seconds, announce) {
|
|
747
|
+
const l = this.#landing;
|
|
748
|
+
if (l === undefined)
|
|
749
|
+
return;
|
|
750
|
+
const pose = landingAt(l.t);
|
|
751
|
+
const td = this.#touchdown();
|
|
752
|
+
const ground = (e, n) => this.#groundAt(e, n);
|
|
753
|
+
const [lx, ly] = [td.east + pose.east, td.north + pose.north];
|
|
754
|
+
const lz = ground(lx, ly);
|
|
755
|
+
this.#time = LANDING.ignition + l.t * 1000;
|
|
756
|
+
// the dust of the blast: from the altitude the Commander first saw it (60 to 70 ft), outward along the ground from under the engine, faster the nearer the ground
|
|
757
|
+
if (seconds > 0 && pose.altitude < 21.3 && l.t < LANDING.duration) {
|
|
758
|
+
// the report's dust is a low sheet driven outward along the ground, thickest in the last metres: most grains leave nearly flat and fast, a few higher
|
|
759
|
+
const strength = Math.pow(1 - pose.altitude / 21.3, 0.7) * pose.throttle;
|
|
760
|
+
const grains = strength * 12000 * seconds;
|
|
761
|
+
for (let k = 0; k < grains + Math.random() * 0.999; k += 1) {
|
|
762
|
+
const a = Math.random() * Math.PI * 2;
|
|
763
|
+
const r0 = 1.5 + Math.random() * 3;
|
|
764
|
+
const v = 6 + Math.random() * 26;
|
|
765
|
+
const lift = Math.random() < 0.85 ? 0.35 + Math.random() * 0.9 : 1.2 + Math.random() * 3;
|
|
766
|
+
const [e, n] = [lx + Math.sin(a) * r0, ly + Math.cos(a) * r0];
|
|
767
|
+
this.#dust.emit([e, ground(e, n) + 0.3, n], [Math.sin(a) * v, lift, Math.cos(a) * v], 4);
|
|
768
|
+
}
|
|
769
|
+
}
|
|
770
|
+
if (seconds > 0)
|
|
771
|
+
this.#dust.step(seconds, ground);
|
|
772
|
+
if (l.camera === "lander") {
|
|
773
|
+
this.#at = { east: lx, north: ly };
|
|
774
|
+
this.#landingEyeUp = lz + pose.altitude + 4;
|
|
775
|
+
this.#look = clampLook({ azimuth: (((pose.heading + this.#camOffset.azimuth) % 360) + 360) % 360, pitch: pose.pitch + this.#camOffset.pitch, fov: this.#look.fov });
|
|
776
|
+
}
|
|
777
|
+
else {
|
|
778
|
+
const b = (l.from.bearing * Math.PI) / 180;
|
|
779
|
+
const [ox, oy] = [td.east + Math.sin(b) * l.from.distance, td.north + Math.cos(b) * l.from.distance];
|
|
780
|
+
this.#at = { east: ox, north: oy };
|
|
781
|
+
this.#landingEyeUp = ground(ox, oy) + 1.7;
|
|
782
|
+
const horizontal = Math.hypot(lx - ox, ly - oy) || 1;
|
|
783
|
+
const azimuth = ((Math.atan2(lx - ox, ly - oy) * 180) / Math.PI + 360) % 360;
|
|
784
|
+
const pitch = (Math.atan2(lz + pose.altitude + 3.4 - this.#landingEyeUp, horizontal) * 180) / Math.PI;
|
|
785
|
+
this.#look = clampLook({ azimuth: azimuth + this.#camOffset.azimuth, pitch: pitch + this.#camOffset.pitch, fov: this.#look.fov });
|
|
786
|
+
}
|
|
787
|
+
// the marker: while the stage is smaller than about 6 pixels in the ground camera a ring and its height mark where it is, fading out as it grows
|
|
788
|
+
const ring = this.#root.getElementById("marker");
|
|
789
|
+
const ringText = this.#root.getElementById("markerText");
|
|
790
|
+
let showRing = false;
|
|
791
|
+
if (l.camera === "ground") {
|
|
792
|
+
const box = this.getBoundingClientRect();
|
|
793
|
+
const [w, h] = [box.width, box.height];
|
|
794
|
+
const vp = viewProjection([this.#at.east, this.#landingEyeUp, -this.#at.north], this.#look, w / Math.max(1, h));
|
|
795
|
+
const [x, y, z] = [lx, lz + pose.altitude + 3.4, -ly];
|
|
796
|
+
const cw = vp[3] * x + vp[7] * y + vp[11] * z + vp[15];
|
|
797
|
+
const px = cw > 0 ? (7 * h) / 2 / (cw * Math.tan((this.#look.fov * Math.PI) / 360)) : 0;
|
|
798
|
+
const fade = Math.min(1, Math.max(0, (9 - px) / 5));
|
|
799
|
+
if (cw > 0 && fade > 0) {
|
|
800
|
+
const nx = (vp[0] * x + vp[4] * y + vp[8] * z + vp[12]) / cw;
|
|
801
|
+
const ny = (vp[1] * x + vp[5] * y + vp[9] * z + vp[13]) / cw;
|
|
802
|
+
if (Math.abs(nx) < 1 && Math.abs(ny) < 1) {
|
|
803
|
+
showRing = true;
|
|
804
|
+
const [sx, sy] = [((nx + 1) / 2) * w, ((1 - ny) / 2) * h];
|
|
805
|
+
ring.style.transform = `translate(${sx}px, ${sy}px)`;
|
|
806
|
+
ring.style.opacity = String(fade);
|
|
807
|
+
ringText.textContent = `${Math.round(pose.altitude).toLocaleString(this.#lang() === "ja" ? "ja-JP" : "en-US")} m`;
|
|
808
|
+
ringText.style.transform = `translate(${sx + 16}px, ${sy - 7}px)`;
|
|
809
|
+
ringText.style.opacity = String(fade);
|
|
810
|
+
}
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
ring.hidden = !showRing;
|
|
814
|
+
ringText.hidden = !showRing;
|
|
815
|
+
// the words: the clock and what the lunar module is doing, and the reported moments as they pass
|
|
816
|
+
const clock = clockText(l.t);
|
|
817
|
+
const ja = this.#lang() === "ja";
|
|
818
|
+
const metres = (v) => Math.round(v).toLocaleString(ja ? "ja-JP" : "en-US");
|
|
819
|
+
this.#root.getElementById("clock").textContent = `${clock.t} · ${clock.get} ${ja ? "ミッション経過時間" : "ground elapsed"} · ${ja ? "高度" : "altitude"} ${metres(pose.altitude)} m · ${ja ? "対地速度" : "speed"} ${metres(pose.speed)} m/s`;
|
|
820
|
+
const passed = calloutsBy(l.t);
|
|
821
|
+
const list = this.#root.getElementById("callouts");
|
|
822
|
+
if (announce || passed.length !== l.passed) {
|
|
823
|
+
const show = passed.slice(-3);
|
|
824
|
+
list.replaceChildren(...show.map((c) => {
|
|
825
|
+
const li = document.createElement("li");
|
|
826
|
+
li.textContent = `${clockText(c.t).t} ${ja ? c.ja : c.en}${c.reported ? "" : ja ? "(時刻はこちらの曲線による)" : " (the time is from our curve)"}`;
|
|
827
|
+
return li;
|
|
828
|
+
}));
|
|
829
|
+
}
|
|
830
|
+
const newest = passed.length > l.passed ? passed[passed.length - 1] : undefined;
|
|
831
|
+
l.passed = passed.length;
|
|
832
|
+
const second = Math.floor(l.t);
|
|
833
|
+
if (announce || newest !== undefined || second !== l.second) {
|
|
834
|
+
l.second = second;
|
|
835
|
+
this.dispatchEvent(new CustomEvent("wakusei-landing-clock", { detail: { t: l.t, clock, altitude: pose.altitude, speed: pose.speed, descent: pose.descent, playing: l.playing, callout: newest === undefined ? undefined : { id: newest.id, t: newest.t, en: newest.en, ja: newest.ja, reported: newest.reported } }, bubbles: true, composed: true }));
|
|
836
|
+
}
|
|
837
|
+
this.#changed(l.playing);
|
|
838
|
+
}
|
|
839
|
+
/** While the descent runs: the clock moves by the real time between frames (times the rate), at most thirty times a second; at the touchdown, or paused, nothing is drawn. */
|
|
840
|
+
#landingTick = () => {
|
|
841
|
+
clearTimeout(this.#landingTimer);
|
|
842
|
+
const l = this.#landing;
|
|
843
|
+
if (l === undefined || !l.playing)
|
|
844
|
+
return;
|
|
845
|
+
const now = performance.now();
|
|
846
|
+
const dt = Math.min(0.25, (now - this.#landingAt) / 1000);
|
|
847
|
+
this.#landingAt = now;
|
|
848
|
+
const seconds = Math.min(dt * l.rate, LANDING.duration - l.t);
|
|
849
|
+
l.t += seconds;
|
|
850
|
+
if (l.t >= LANDING.duration - 1e-6) {
|
|
851
|
+
l.t = LANDING.duration;
|
|
852
|
+
l.playing = false;
|
|
853
|
+
}
|
|
854
|
+
this.#landingFrame(seconds, false);
|
|
855
|
+
if (l.playing)
|
|
856
|
+
this.#landingTimer = setTimeout(this.#landingTick, 33);
|
|
857
|
+
else
|
|
858
|
+
this.#changed(true);
|
|
859
|
+
};
|
|
612
860
|
// --- the things at the site: a small button on each, which goes to it and says what it is ----------------------------------------------------------------------------------------------------
|
|
613
861
|
/** The things at the site, at their published places (none where the site has none or `objects="off"`). */
|
|
614
862
|
get objects() {
|
|
@@ -647,7 +895,7 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
647
895
|
}
|
|
648
896
|
/** Put each button on its thing in the picture, or hide it behind the viewer, off the picture or too far to tell. Done at each draw: nothing moves by itself. */
|
|
649
897
|
#placeLabels() {
|
|
650
|
-
if (this.#labelEls.size === 0 || this.#vehicle !== undefined)
|
|
898
|
+
if (this.#labelEls.size === 0 || this.#vehicle !== undefined || this.#landing !== undefined)
|
|
651
899
|
return;
|
|
652
900
|
const box = this.getBoundingClientRect();
|
|
653
901
|
const [w, h] = [box.width, box.height];
|
|
@@ -674,8 +922,8 @@ export class WakuseiSurface extends HTMLElement {
|
|
|
674
922
|
* @returns Whether there is such a thing here.
|
|
675
923
|
*/
|
|
676
924
|
choose(id) {
|
|
677
|
-
if (this.#vehicle !== undefined)
|
|
678
|
-
return false; // the rover is being driven: the eyes are
|
|
925
|
+
if (this.#vehicle !== undefined || this.#landing !== undefined)
|
|
926
|
+
return false; // the rover is being driven or the landing watched: the eyes are not ours to move
|
|
679
927
|
const about = this.#root.getElementById("about");
|
|
680
928
|
const o = id === undefined ? undefined : this.#objects.find((x) => x.id === id);
|
|
681
929
|
if (id !== undefined && o === undefined)
|
package/dist/surface/glsl.d.ts
CHANGED
|
@@ -25,5 +25,8 @@ export declare const TRACK_FRAGMENT = "\nprecision highp float;\nvarying vec2 vU
|
|
|
25
25
|
export declare const OBJECT_VERTEX: string;
|
|
26
26
|
export declare const OBJECT_FRAGMENT: string;
|
|
27
27
|
/** A grain of dust in flight: a small square that always faces the viewer, at a place in the site's plane, its size in metres. */
|
|
28
|
-
export declare const DUST_VERTEX = "\nprecision highp float;\n// position (declared by three.js) is the grain's place; the corner of its square is in uv, -1 to 1\nuniform mat4 uVP;\nuniform vec3 uRight;\nuniform vec3 uUp;\nuniform float uSize;\nvarying vec2 vUv;\nvoid main() {\n vUv = uv * 2.0 - 1.0;\n vec3
|
|
29
|
-
export declare const DUST_FRAGMENT = "\nprecision highp float;\nvarying vec2 vUv;\nvoid main() {\n float r = length(vUv);\n if (r > 1.0) discard;\n gl_FragColor = vec4(vec3(0.
|
|
28
|
+
export declare const DUST_VERTEX = "\nprecision highp float;\n// position (declared by three.js) is the grain's place; the corner of its square is in uv, -1 to 1\nuniform mat4 uVP;\nuniform vec3 uRight;\nuniform vec3 uUp;\nuniform float uSize;\nuniform vec3 uEyeWorld;\nuniform float uMinAngle; // the least a grain shows as, in radians (a blast seen from far off)\nvarying vec2 vUv;\nvoid main() {\n vUv = uv * 2.0 - 1.0;\n vec3 c = vec3(position.x, position.y, -position.z);\n float size = max(uSize, distance(c, uEyeWorld) * uMinAngle);\n vec3 w = c + (uRight * vUv.x + uUp * vUv.y) * size;\n gl_Position = uVP * vec4(w, 1.0);\n}\n";
|
|
29
|
+
export declare const DUST_FRAGMENT = "\nprecision highp float;\nvarying vec2 vUv;\nvoid main() {\n float r = length(vUv);\n if (r > 1.0) discard;\n gl_FragColor = vec4(vec3(0.62), 0.32 * (1.0 - r * r));\n}\n";
|
|
30
|
+
/** The engine's plume: a cone below the bell, its place and size in uniforms, faint and warm, widest at its end (a vacuum lets a plume spread). position.x is the angle round it (0 to 1), position.y the way along it (0 to 1). */
|
|
31
|
+
export declare const PLUME_VERTEX = "\nprecision highp float;\nuniform mat4 uVP;\nuniform vec3 uBell; // the bell's exit, in the site's plane (east, up, north)\nuniform float uLength;\nuniform float uRadius;\nvarying float vAlong;\nvoid main() {\n float a = position.x * 6.2831853;\n float u = position.y;\n float r = 0.7 + (uRadius - 0.7) * pow(u, 0.6);\n vec3 w = uBell + vec3(cos(a) * r, -u * uLength, sin(a) * r);\n vAlong = u;\n gl_Position = uVP * vec4(w.x, w.y, -w.z, 1.0);\n}\n";
|
|
32
|
+
export declare const PLUME_FRAGMENT = "\nprecision highp float;\nuniform float uPlume; // the share of full thrust\nvarying float vAlong;\nvoid main() {\n float a = uPlume * 0.38 * (1.0 - vAlong) * (1.0 - vAlong);\n if (a < 0.003) discard;\n gl_FragColor = vec4(1.0, 0.92, 0.78, a);\n}\n";
|
package/dist/surface/glsl.js
CHANGED
|
@@ -463,10 +463,14 @@ uniform mat4 uVP;
|
|
|
463
463
|
uniform vec3 uRight;
|
|
464
464
|
uniform vec3 uUp;
|
|
465
465
|
uniform float uSize;
|
|
466
|
+
uniform vec3 uEyeWorld;
|
|
467
|
+
uniform float uMinAngle; // the least a grain shows as, in radians (a blast seen from far off)
|
|
466
468
|
varying vec2 vUv;
|
|
467
469
|
void main() {
|
|
468
470
|
vUv = uv * 2.0 - 1.0;
|
|
469
|
-
vec3
|
|
471
|
+
vec3 c = vec3(position.x, position.y, -position.z);
|
|
472
|
+
float size = max(uSize, distance(c, uEyeWorld) * uMinAngle);
|
|
473
|
+
vec3 w = c + (uRight * vUv.x + uUp * vUv.y) * size;
|
|
470
474
|
gl_Position = uVP * vec4(w, 1.0);
|
|
471
475
|
}
|
|
472
476
|
`;
|
|
@@ -476,6 +480,33 @@ varying vec2 vUv;
|
|
|
476
480
|
void main() {
|
|
477
481
|
float r = length(vUv);
|
|
478
482
|
if (r > 1.0) discard;
|
|
479
|
-
gl_FragColor = vec4(vec3(0.
|
|
483
|
+
gl_FragColor = vec4(vec3(0.62), 0.32 * (1.0 - r * r));
|
|
484
|
+
}
|
|
485
|
+
`;
|
|
486
|
+
/** The engine's plume: a cone below the bell, its place and size in uniforms, faint and warm, widest at its end (a vacuum lets a plume spread). position.x is the angle round it (0 to 1), position.y the way along it (0 to 1). */
|
|
487
|
+
export const PLUME_VERTEX = /* glsl */ `
|
|
488
|
+
precision highp float;
|
|
489
|
+
uniform mat4 uVP;
|
|
490
|
+
uniform vec3 uBell; // the bell's exit, in the site's plane (east, up, north)
|
|
491
|
+
uniform float uLength;
|
|
492
|
+
uniform float uRadius;
|
|
493
|
+
varying float vAlong;
|
|
494
|
+
void main() {
|
|
495
|
+
float a = position.x * 6.2831853;
|
|
496
|
+
float u = position.y;
|
|
497
|
+
float r = 0.7 + (uRadius - 0.7) * pow(u, 0.6);
|
|
498
|
+
vec3 w = uBell + vec3(cos(a) * r, -u * uLength, sin(a) * r);
|
|
499
|
+
vAlong = u;
|
|
500
|
+
gl_Position = uVP * vec4(w.x, w.y, -w.z, 1.0);
|
|
501
|
+
}
|
|
502
|
+
`;
|
|
503
|
+
export const PLUME_FRAGMENT = /* glsl */ `
|
|
504
|
+
precision highp float;
|
|
505
|
+
uniform float uPlume; // the share of full thrust
|
|
506
|
+
varying float vAlong;
|
|
507
|
+
void main() {
|
|
508
|
+
float a = uPlume * 0.38 * (1.0 - vAlong) * (1.0 - vAlong);
|
|
509
|
+
if (a < 0.003) discard;
|
|
510
|
+
gl_FragColor = vec4(1.0, 0.92, 0.78, a);
|
|
480
511
|
}
|
|
481
512
|
`;
|
package/dist/surface/index.d.ts
CHANGED
|
@@ -4,7 +4,8 @@ export { EYE_HEIGHT, FOV_LIMITS, WALK_SPEED, clampLook, forward, stepOver, viewP
|
|
|
4
4
|
export { decodeHeight, drop, emptyLevel, fillFromCoarser, groundAt, sampleLevel, tileAddress, type HeightLevel, type HeightLevelInfo, type TerrainManifest } from "./height.ts";
|
|
5
5
|
export { loadPlan, loadTerrain, type LoadJob, type LoadOptions, type Terrain, type TerrainProgress } from "./load.ts";
|
|
6
6
|
export type { SurfaceState } from "./element.ts";
|
|
7
|
-
export { landerParts, roverParts } from "./shapes.ts";
|
|
7
|
+
export { ascentParts, landerParts, roverParts } from "./shapes.ts";
|
|
8
|
+
export { calloutsBy, CALLOUTS, clockText, LANDING, landingAt, type Callout, type LandingPose } from "./landing.ts";
|
|
8
9
|
export { DustField } from "./dust.ts";
|
|
9
10
|
export { driveParts, driveStep, driveView, startDrive, ROVER, type DriveInput, type DriveState, type DriveView } from "./drive.ts";
|
|
10
11
|
export { keepAway, objectParts, objectsOf, partShadows, traverseOf, KEEP_OUT, type Part, type SiteObject } from "./objects.ts";
|
package/dist/surface/index.js
CHANGED
|
@@ -4,7 +4,8 @@ export { SURFACE_SITES, siteById } from "./site.js";
|
|
|
4
4
|
export { EYE_HEIGHT, FOV_LIMITS, WALK_SPEED, clampLook, forward, stepOver, viewProjection } from "./view.js";
|
|
5
5
|
export { decodeHeight, drop, emptyLevel, fillFromCoarser, groundAt, sampleLevel, tileAddress } from "./height.js";
|
|
6
6
|
export { loadPlan, loadTerrain } from "./load.js";
|
|
7
|
-
export { landerParts, roverParts } from "./shapes.js";
|
|
7
|
+
export { ascentParts, landerParts, roverParts } from "./shapes.js";
|
|
8
|
+
export { calloutsBy, CALLOUTS, clockText, LANDING, landingAt } from "./landing.js";
|
|
8
9
|
export { DustField } from "./dust.js";
|
|
9
10
|
export { driveParts, driveStep, driveView, startDrive, ROVER } from "./drive.js";
|
|
10
11
|
export { keepAway, objectParts, objectsOf, partShadows, traverseOf, KEEP_OUT } from "./objects.js";
|
package/dist/surface/land.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ export interface LandOptions {
|
|
|
21
21
|
pitch?: number;
|
|
22
22
|
fov?: number;
|
|
23
23
|
};
|
|
24
|
+
/** `"landing"` to watch Apollo 17's powered descent once down (the real moment: its Sun and Earth, the clock from T+4:00 or T+9:00): see `watch` of the standing view. */
|
|
25
|
+
watch?: "landing";
|
|
26
|
+
/** Which camera watches: `lander` (the commander's window, the default) or `ground` (an observer standing off the touchdown point). */
|
|
27
|
+
watchCamera?: "lander" | "ground";
|
|
28
|
+
/** Where the ground camera stands, as `"150 0"`: metres from the touchdown point and the bearing in degrees clockwise from north (150 m north by default). */
|
|
29
|
+
watchFrom?: string;
|
|
24
30
|
/** False to cut straight to the ground with no turn, no zoom and no fade (reduced motion does the same). */
|
|
25
31
|
smooth?: boolean;
|
|
26
32
|
/** Milliseconds to wait for the standing view to be live before giving up (20,000 by default). */
|
package/dist/surface/land.js
CHANGED
|
@@ -176,6 +176,14 @@ export async function land(space, siteId, options = {}) {
|
|
|
176
176
|
veil.style.opacity = "0";
|
|
177
177
|
fail(live ? "this device cannot draw the ground" : "the ground did not come in time");
|
|
178
178
|
}
|
|
179
|
+
// watching the descent: the standing view starts it as the veil goes up, so the first thing seen is its first frame
|
|
180
|
+
if (options.watch === "landing") {
|
|
181
|
+
if (options.watchCamera !== undefined)
|
|
182
|
+
surface.setAttribute("watch-camera", options.watchCamera);
|
|
183
|
+
if (options.watchFrom !== undefined)
|
|
184
|
+
surface.setAttribute("watch-from", options.watchFrom);
|
|
185
|
+
surface.setAttribute("watch", "landing");
|
|
186
|
+
}
|
|
179
187
|
veil.style.opacity = "0";
|
|
180
188
|
if (smooth)
|
|
181
189
|
await sleep(FADE_MS, landing);
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The descent's fixed facts: its length in seconds, when it began in real time, where the lunar module was at ignition, and the clock the view starts at (T+4:00, where the report has the radar locked: the first
|
|
3
|
+
* four minutes are 530 km up-range of the ground the package has, so they are a time lapse of the clock with no ground).
|
|
4
|
+
*
|
|
5
|
+
* @example
|
|
6
|
+
* ```ts
|
|
7
|
+
* import { LANDING } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
8
|
+
*
|
|
9
|
+
* console.log(`${LANDING.duration} s from ${new Date(LANDING.ignition).toISOString()}`);
|
|
10
|
+
* ```
|
|
11
|
+
*/
|
|
12
|
+
export declare const LANDING: {
|
|
13
|
+
/** Seconds from ignition to touchdown (the report's 12:05). */
|
|
14
|
+
readonly duration: 725;
|
|
15
|
+
/** Ignition in real time: 110:09:53 ground elapsed time, 12:05 before the touchdown at 19:54:57 UTC on 1972-12-11. */
|
|
16
|
+
readonly ignition: number;
|
|
17
|
+
/** The clock the view starts at, in seconds from ignition. */
|
|
18
|
+
readonly viewStart: 240;
|
|
19
|
+
/** At ignition (table 3-III): latitude and east longitude in degrees, altitude in metres (8.7 nautical miles), speed in m/s (5,550.3 ft/s) and heading (276.07 degrees). */
|
|
20
|
+
readonly start: {
|
|
21
|
+
readonly lat: 19.13;
|
|
22
|
+
readonly lon: 48.75;
|
|
23
|
+
readonly altitude: number;
|
|
24
|
+
readonly speed: number;
|
|
25
|
+
readonly heading: 276.07;
|
|
26
|
+
};
|
|
27
|
+
/** The ground speed the made curve ends at, and the descent rate at touchdown the report gives ("approximately 3 ft/sec"), in m/s. */
|
|
28
|
+
readonly touchdownDescent: number;
|
|
29
|
+
};
|
|
30
|
+
/**
|
|
31
|
+
* Where the lunar module is and how it moves at one moment of the descent.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* import { landingAt, type LandingPose } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
36
|
+
*
|
|
37
|
+
* const pose: LandingPose = landingAt(600);
|
|
38
|
+
* console.log(`${Math.round(pose.altitude)} m up, ${pose.descent.toFixed(1)} m/s down, throttle ${pose.throttle.toFixed(2)}`);
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export interface LandingPose {
|
|
42
|
+
/** Seconds from ignition. */
|
|
43
|
+
t: number;
|
|
44
|
+
/** Metres over the ground under it, and metres a second down (positive down) and along the ground. */
|
|
45
|
+
altitude: number;
|
|
46
|
+
descent: number;
|
|
47
|
+
speed: number;
|
|
48
|
+
/** Metres still to go along the ground to the touchdown point. */
|
|
49
|
+
toGo: number;
|
|
50
|
+
/** Metres east and north of the touchdown point, on the site's plane, and the heading it flies, degrees clockwise from north. */
|
|
51
|
+
east: number;
|
|
52
|
+
north: number;
|
|
53
|
+
heading: number;
|
|
54
|
+
/** The way the crew's window looks, degrees above the horizon (negative looks down), and the share of full thrust. */
|
|
55
|
+
pitch: number;
|
|
56
|
+
throttle: number;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* The lunar module at a moment of the descent. The altitude passes through the altitudes the report names, the speed starts at the report's and covers the real distance to the touchdown point, and the rest is a
|
|
60
|
+
* smooth curve of ours: `east` and `north` are on a straight line back from the touchdown point toward where the descent began, in metres on the site's plane (the curve of the Moon is the ground's to take off).
|
|
61
|
+
*
|
|
62
|
+
* @param t - Seconds from ignition (held between 0 and the length of the descent).
|
|
63
|
+
* @returns The pose.
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* import { landingAt } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
68
|
+
*
|
|
69
|
+
* const high = landingAt(562);
|
|
70
|
+
* console.log(`${Math.round(high.altitude)} m up at the high gate, ${high.speed.toFixed(0)} m/s along, ${Math.round(high.toGo)} m to go`);
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
export declare function landingAt(t: number): LandingPose;
|
|
74
|
+
/**
|
|
75
|
+
* One event the page shows as it passes: when (seconds from ignition), what it is in English and Japanese, and whether its TIME is the report's (the altitude events are placed by us on the curve).
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* import { CALLOUTS, type Callout } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
80
|
+
*
|
|
81
|
+
* const touchdown: Callout = CALLOUTS.find((c) => c.id === "touchdown")!;
|
|
82
|
+
* console.log(touchdown.en, touchdown.reported);
|
|
83
|
+
* ```
|
|
84
|
+
*/
|
|
85
|
+
export interface Callout {
|
|
86
|
+
id: string;
|
|
87
|
+
t: number;
|
|
88
|
+
en: string;
|
|
89
|
+
ja: string;
|
|
90
|
+
/** True where the time comes from the report's table of events; false where it is the moment the made curve reaches the altitude the report names. */
|
|
91
|
+
reported: boolean;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* The events of the descent as the report gives them (the times in its table of events) and the altitudes it names (placed on the curve), in the order they pass.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```ts
|
|
98
|
+
* import { CALLOUTS } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
99
|
+
*
|
|
100
|
+
* console.log(CALLOUTS.map((c) => `T+${c.t}s ${c.en}`).join("; "));
|
|
101
|
+
* ```
|
|
102
|
+
*/
|
|
103
|
+
export declare const CALLOUTS: readonly Callout[];
|
|
104
|
+
/**
|
|
105
|
+
* The events that have passed by a moment, the latest last.
|
|
106
|
+
*
|
|
107
|
+
* @param t - Seconds from ignition.
|
|
108
|
+
* @returns The events with a time at or before `t`.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```ts
|
|
112
|
+
* import { calloutsBy } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
113
|
+
*
|
|
114
|
+
* console.log(calloutsBy(600).map((c) => c.id).join(", "));
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function calloutsBy(t: number): Callout[];
|
|
118
|
+
/**
|
|
119
|
+
* The clock as the page shows it: `T+04:00` from ignition, and the ground elapsed time of the mission (ignition was 110:09:53).
|
|
120
|
+
*
|
|
121
|
+
* @param t - Seconds from ignition.
|
|
122
|
+
* @returns The two clocks as text.
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```ts
|
|
126
|
+
* import { clockText } from "@johnmorrisdotca/wakusei-planets/surface";
|
|
127
|
+
*
|
|
128
|
+
* console.log(clockText(240));
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
131
|
+
export declare function clockText(t: number): {
|
|
132
|
+
t: string;
|
|
133
|
+
get: string;
|
|
134
|
+
};
|