@johnmorrisdotca/wakusei-planets 0.75.0 → 0.75.2
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 +26 -1
- package/NOTICE.md +17 -7
- package/README.md +6 -6
- package/dist/asteroids.d.ts +13 -13
- package/dist/asteroids.js +8 -8
- package/dist/bodies/dwarfs.js +1 -1
- package/dist/bodies/earth-look.js +1 -1
- package/dist/bodies/jupiter.js +1 -1
- package/dist/bodies/mars.js +1 -1
- package/dist/bodies/minor.js +23 -2
- package/dist/bodies/moons-neptune.js +1 -1
- package/dist/bodies/moons-pluto.js +2 -0
- package/dist/bodies/moons-saturn.js +1 -1
- package/dist/bodies/neptune.js +1 -1
- package/dist/bodies/pluto.js +1 -0
- package/dist/bodies/saturn.js +1 -1
- package/dist/bodies/uranus.js +1 -1
- package/dist/bodies/venus.js +1 -1
- package/dist/data/asteroids.js +0 -3
- package/dist/data/discovery.js +30 -0
- package/dist/data/estimated-moons.js +354 -354
- package/dist/data/minor.js +6 -0
- package/dist/data/moon-catalogue.d.ts +1 -1
- package/dist/data/moon-catalogue.js +368 -368
- package/dist/data/orbits.js +3 -0
- package/dist/data/shapes/arrokoth-craft.d.ts +2 -0
- package/dist/data/shapes/arrokoth-craft.js +8 -0
- package/dist/data/shapes/bennu-craft.d.ts +2 -0
- package/dist/data/shapes/bennu-craft.js +8 -0
- package/dist/data/shapes/eros-craft.d.ts +2 -0
- package/dist/data/shapes/eros-craft.js +8 -0
- package/dist/facts.d.ts +2 -2
- package/dist/facts.js +10 -4
- package/dist/moon-catalogue.d.ts +9 -9
- package/dist/moon-catalogue.js +11 -10
- package/dist/moon-pages/element.js +0 -2
- package/dist/moon-pages/hero.d.ts +1 -4
- package/dist/moon-pages/hero.js +5 -10
- package/dist/picture-credits.d.ts +1 -1
- package/dist/picture-credits.js +7 -1
- package/dist/place-radii.d.ts +1 -13
- package/dist/place-radii.js +1 -5
- package/dist/places.d.ts +1 -1
- package/dist/places.js +1 -1
- package/dist/portrait/model.js +3 -3
- package/dist/scene/body.d.ts +1 -0
- package/dist/scene/body.js +27 -8
- package/dist/scene/craft.d.ts +30 -0
- package/dist/scene/craft.js +63 -0
- package/dist/scene/glsl.js +3 -1
- package/dist/scene/look.d.ts +20 -0
- package/dist/scene/look.js +19 -0
- package/dist/scene/name-label.d.ts +10 -0
- package/dist/scene/name-label.js +93 -1
- package/dist/scene/painter.d.ts +2 -1
- package/dist/scene/painter.js +49 -4
- package/dist/scene/textures.d.ts +2 -2
- package/dist/shape-basis.d.ts +1 -1
- package/dist/shape-basis.js +2 -0
- package/dist/space/asteroid-ids.d.ts +1 -1
- package/dist/space/asteroid-ids.js +2 -2
- package/dist/space/bodies.js +1 -1
- package/dist/space/element.d.ts +18 -4
- package/dist/space/element.js +27 -5
- package/dist/space/frame.d.ts +1 -1
- package/dist/space/regions.d.ts +1 -1
- package/dist/space/scene.d.ts +2 -2
- package/dist/space/scene.js +3 -2
- package/dist/stops.js +3 -1
- package/dist/textures/arrokoth-craft-512.webp +0 -0
- package/dist/textures/bennu-craft-512.webp +0 -0
- package/dist/textures/eros-craft-512.webp +0 -0
- package/dist/textures/pluto-1024.webp +0 -0
- package/dist/textures/pluto-512.webp +0 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/scene/painter.js
CHANGED
|
@@ -9,12 +9,13 @@ import { cross } from "../vec.js";
|
|
|
9
9
|
import { bodyFragment, GLOW_FRAGMENT, GLOW_VERTEX, PAINTED_SURFACE, PAINTED_SURFACE_WINDOWED, RING_FRAGMENT_WORLD, RING_VERTEX_WORLD, VERTEX_WORLD } from "./glsl.js";
|
|
10
10
|
import { fallbackLook } from "./fallback.js";
|
|
11
11
|
import { createDetail } from "./detail.js";
|
|
12
|
-
import { detailOf, lookOf } from "./look.js";
|
|
12
|
+
import { atmosphereTint, detailOf, lookOf } from "./look.js";
|
|
13
|
+
import { craftGeometry, craftMaterial, craftPicture } from "./craft.js";
|
|
13
14
|
import { shapeGeometry } from "./shape.js";
|
|
14
15
|
import { seenRegion } from "./tiles.js";
|
|
15
16
|
import { moonOffset, orientation } from "./orient.js";
|
|
16
17
|
import { ringStrip } from "./rings.js";
|
|
17
|
-
import { createNameLabel, nameLabelText } from "./name-label.js";
|
|
18
|
+
import { createNameLabel, nameLabelText, shapeReach } from "./name-label.js";
|
|
18
19
|
import { roundShape } from "./round.js";
|
|
19
20
|
let pictureLoads = 0;
|
|
20
21
|
/**
|
|
@@ -154,7 +155,7 @@ function paint(T, id, context, bases, hold) {
|
|
|
154
155
|
uAmbient: { value: look.ambient ?? 0.04 },
|
|
155
156
|
uLimb: { value: look.limb ?? 0 },
|
|
156
157
|
uWrap: { value: look.wrap ?? (a === undefined ? 0.04 : 0.3) },
|
|
157
|
-
uAtmos: { value: new T.Vector3(...(a
|
|
158
|
+
uAtmos: { value: new T.Vector3(...atmosphereTint(a)) },
|
|
158
159
|
uAtmosPow: { value: a?.power ?? 3 },
|
|
159
160
|
uRimBase: { value: 0.12 },
|
|
160
161
|
uEmissive: { value: look.emissive === true ? 1 : 0 },
|
|
@@ -187,6 +188,9 @@ function paint(T, id, context, bases, hold) {
|
|
|
187
188
|
let ringOuter = 2;
|
|
188
189
|
const table = look.emissive === true ? null : ringStrip(facts, 1024);
|
|
189
190
|
let gone = false;
|
|
191
|
+
// the mesh picture of a body drawn from a mission's model: it is this painting's own, and it is given back with the painting
|
|
192
|
+
let craftMap;
|
|
193
|
+
let craftMat;
|
|
190
194
|
if (table !== null) {
|
|
191
195
|
ringInner = table.inner;
|
|
192
196
|
ringOuter = table.outer;
|
|
@@ -404,6 +408,37 @@ function paint(T, id, context, bases, hold) {
|
|
|
404
408
|
redraw();
|
|
405
409
|
}, () => undefined);
|
|
406
410
|
}
|
|
411
|
+
// a body whose picture is the mesh a mission published: the faces carry that model's own picture, not a map wrapped on a globe
|
|
412
|
+
if (look.craft !== undefined) {
|
|
413
|
+
look.craft().then((table) => {
|
|
414
|
+
if (gone)
|
|
415
|
+
return;
|
|
416
|
+
const shaped = acquire(T, `craft:${id}`, () => craftGeometry(T, table));
|
|
417
|
+
releases.push(shaped.release);
|
|
418
|
+
const material = acquire(T, `craftmat:${id}`, () => craftMaterial(T, look.ambient ?? 0.08));
|
|
419
|
+
releases.push(material.release);
|
|
420
|
+
materials.push(material.value);
|
|
421
|
+
craftMat = material.value;
|
|
422
|
+
mesh.geometry = shaped.value;
|
|
423
|
+
mesh.material = material.value;
|
|
424
|
+
scaleX = 1;
|
|
425
|
+
scaleY = 1;
|
|
426
|
+
scaleZ = 1;
|
|
427
|
+
void trackPicture(loadImage(T, `${bases.near}${table.map}`)).then((picture) => {
|
|
428
|
+
if (gone) {
|
|
429
|
+
picture.dispose();
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
// the painted maps do this too: a colour conversion would leave a second texture the painting does not own
|
|
433
|
+
picture.colorSpace = T.NoColorSpace;
|
|
434
|
+
craftPicture(picture);
|
|
435
|
+
craftMap = picture;
|
|
436
|
+
material.value.uniforms.uMap.value = picture;
|
|
437
|
+
redraw();
|
|
438
|
+
}, () => undefined);
|
|
439
|
+
redraw();
|
|
440
|
+
}, () => undefined);
|
|
441
|
+
}
|
|
407
442
|
const light = new T.Vector3();
|
|
408
443
|
const poleVec = new T.Vector3();
|
|
409
444
|
// the name on the globe: a child of the mesh, so it turns with the body; made when asked, drawn once its font is in
|
|
@@ -411,7 +446,7 @@ function paint(T, id, context, bases, hold) {
|
|
|
411
446
|
let labelText = "";
|
|
412
447
|
let labelShown = false;
|
|
413
448
|
// what `label` reports: one object, written at each draw (it is read for every body at every frame)
|
|
414
|
-
const labelReport = { shown: false, text: "", turn: 0, look: "" };
|
|
449
|
+
const labelReport = { shown: false, text: "", turn: 0, look: "", shell: 1 };
|
|
415
450
|
const setLabel = (next) => {
|
|
416
451
|
if (next === null || next === undefined || gone) {
|
|
417
452
|
if (label !== undefined) {
|
|
@@ -502,6 +537,10 @@ function paint(T, id, context, bases, hold) {
|
|
|
502
537
|
}
|
|
503
538
|
keepSized(info.radiusPx);
|
|
504
539
|
if (label !== undefined) {
|
|
540
|
+
// a lumpy shape stands out past the sphere the name is written on: the shell clears its highest point
|
|
541
|
+
labelReport.shell = shapeReach(mesh.geometry);
|
|
542
|
+
if (labelReport.shell > 1.002 || label.object.scale.x !== 1)
|
|
543
|
+
label.object.scale.setScalar(Math.max(1, labelReport.shell));
|
|
505
544
|
label.update(info.view?.camera, info.radiusPx, info.toSun);
|
|
506
545
|
const inner = label.object.children[0];
|
|
507
546
|
labelShown = inner !== undefined && inner.visible;
|
|
@@ -522,6 +561,12 @@ function paint(T, id, context, bases, hold) {
|
|
|
522
561
|
small?.dispose();
|
|
523
562
|
sharp?.dispose();
|
|
524
563
|
ringTexture?.dispose();
|
|
564
|
+
const mat = craftMat;
|
|
565
|
+
const map = craftMap;
|
|
566
|
+
if (mat !== undefined && mat.uniforms.uMap !== undefined && mat.uniforms.uMap.value === map)
|
|
567
|
+
mat.uniforms.uMap.value = null;
|
|
568
|
+
map?.dispose();
|
|
569
|
+
craftMap = undefined;
|
|
525
570
|
for (const d of disposables)
|
|
526
571
|
d.dispose();
|
|
527
572
|
for (const r of releases)
|
package/dist/scene/textures.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ import { type BodyMapSource } from "../door/map.ts";
|
|
|
11
11
|
* console.log(TEXTURE_BASE);
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
|
-
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.75.
|
|
14
|
+
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.75.2/dist/textures/";
|
|
15
15
|
/**
|
|
16
16
|
* Where the sharpest surface pictures are: the files of this exact version in the repository, on jsDelivr's GitHub address. The npm package holds only the two smaller widths, so a page that
|
|
17
17
|
* never zooms in never fetches them. Set `texture-far-base` on an element to serve them yourself.
|
|
@@ -23,7 +23,7 @@ export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdot
|
|
|
23
23
|
* console.log(TEXTURE_FAR_BASE);
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
|
-
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.75.
|
|
26
|
+
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.75.2/textures/";
|
|
27
27
|
/**
|
|
28
28
|
* Where the finer map tiles are by default: the demo site's `tiles/` folder (GitHub Pages sends `access-control-allow-origin: *`). The tiles are made by `scripts/make-body-tiles.py` and are in no package and no repository:
|
|
29
29
|
* a page that serves its own gives the folder in the `tiles` attribute, and `tiles="off"` turns them off. A page that sets `texture-base` (it serves its own pictures) has none unless it says where they are.
|
package/dist/shape-basis.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import type { BodyId } from "./facts.ts";
|
|
|
10
10
|
* console.log(basis);
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export type ShapeBasis = "shape-and-map" | "shape";
|
|
13
|
+
export type ShapeBasis = "shape-and-map" | "shape" | "craft";
|
|
14
14
|
/**
|
|
15
15
|
* How the picture of a body rests on measurement, or `undefined` for a body drawn from its facts alone (a sphere or an ellipsoid).
|
|
16
16
|
*
|
package/dist/shape-basis.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
const NOTE = {
|
|
2
2
|
shape: { en: "shape measured; colour from its measured brightness", ja: "形は測定したもの。色は測定した明るさから" },
|
|
3
3
|
"shape-and-map": { en: "shape and surface measured by spacecraft", ja: "形も表面も探査機が測定したもの" },
|
|
4
|
+
craft: { en: "shape measured by spacecraft; colour from its photograph, not a map", ja: "形は探査機が測定したもの。色は写真からで、地面の地図ではない" },
|
|
4
5
|
};
|
|
5
6
|
// The moons drawn with a measured shape (their looks carry `shape`), and whether a mission map is drawn on them too. test/shape.test.ts holds this table to the looks.
|
|
6
7
|
const BASIS = {
|
|
7
8
|
phobos: "shape-and-map", deimos: "shape-and-map", phoebe: "shape-and-map",
|
|
8
9
|
nix: "shape", hydra: "shape", proteus: "shape", larissa: "shape", amalthea: "shape", thebe: "shape", hyperion: "shape", janus: "shape", epimetheus: "shape", prometheus: "shape", pandora: "shape",
|
|
9
10
|
atlas: "shape", pan: "shape", daphnis: "shape", helene: "shape", telesto: "shape", calypso: "shape",
|
|
11
|
+
bennu: "craft", eros: "craft", arrokoth: "craft",
|
|
10
12
|
};
|
|
11
13
|
/**
|
|
12
14
|
* How the picture of a body rests on measurement, or `undefined` for a body drawn from its facts alone (a sphere or an ellipsoid).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/** The ids of the
|
|
1
|
+
/** The ids of the 101 bodies of `/asteroids`, in table order. Eros, Bennu and Arrokoth are bodies of the package, so they are not in this list. */
|
|
2
2
|
export declare const ASTEROID_IDS: readonly string[];
|
|
3
3
|
/** The prefix of an asteroid's key in the view: two asteroids (`europa`, `dione`) have the id of a moon of the package, so the view keeps its own names for them apart by it. A page never sees it: events, `sight()` and `riding` say the plain id. */
|
|
4
4
|
export declare const ASTEROID_PREFIX = "asteroid:";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// The ids of the asteroids of /asteroids, in table order: what the space view needs to tell an asteroid from a body (and to say so when the option `asteroids` is off) without loading the table, which is a chunk of its own
|
|
2
2
|
// that the view reaches only when the option is turned on. A test holds this list to the table. And how the view keys the asteroids among its own names (labels, places, the sight): two of them, `europa` and `dione`, have the id of a moon.
|
|
3
|
-
/** The ids of the
|
|
3
|
+
/** The ids of the 101 bodies of `/asteroids`, in table order. Eros, Bennu and Arrokoth are bodies of the package, so they are not in this list. */
|
|
4
4
|
export const ASTEROID_IDS = [
|
|
5
5
|
"hygiea", "interamnia", "europa", "davida", "euphrosyne", "patientia", "sylvia", "juno", "cybele", "thisbe", "eunomia", "psyche", "bamberga", "doris", "ursula",
|
|
6
6
|
"camilla", "hermione", "lomia", "dione", "daphne", "aurora", "egeria", "eugenia", "fortuna", "iris", "chicago", "themis", "gaspra", "ida", "mathilde", "lutetia",
|
|
7
|
-
"steins", "annefrank", "braille", "dinkinesh", "donaldjohanson", "masursky", "apl", "
|
|
7
|
+
"steins", "annefrank", "braille", "dinkinesh", "donaldjohanson", "masursky", "apl", "itokawa", "ryugu", "toutatis", "didymos",
|
|
8
8
|
"apophis", "torifune", "1998-ky26", "2024-yr4", "phaethon", "icarus", "geographos", "toro", "cruithne", "kamooalewa", "1950-da", "florence", "ganymed", "apollo",
|
|
9
9
|
"aten", "amor", "atira", "hermes", "wilson-harrington", "duende", "nereus", "golevka", "adonis", "eurybates", "polymele", "leucus", "orus", "patroclus", "hektor",
|
|
10
10
|
"achilles", "agamemnon", "nestor", "priamus", "diomedes", "odysseus", "ajax", "menelaus", "aneas", "anchises", "chariklo", "nessus", "asbolus", "hylonome",
|
package/dist/space/bodies.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Which bodies the space view can put at the middle of its view, and in what order a reader hops from one to the next. Pure: names in, names out.
|
|
2
2
|
import { BODIES, MOONS_OF } from "../facts.js";
|
|
3
3
|
/** Planets, dwarf planets and minor bodies, ordered by the size of their orbits (the semi-major axis), each followed by its moons nearest first. */
|
|
4
|
-
const SUN_ORDER = ["mercury", "venus", "earth", "mars", "vesta", "ceres", "pallas", "jupiter", "saturn", "chiron", "halley", "uranus", "pholus", "neptune", "pluto", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna"];
|
|
4
|
+
const SUN_ORDER = ["mercury", "venus", "earth", "bennu", "eros", "mars", "vesta", "ceres", "pallas", "jupiter", "saturn", "chiron", "halley", "uranus", "pholus", "neptune", "pluto", "orcus", "haumea", "quaoar", "arrokoth", "makemake", "gonggong", "eris", "sedna"];
|
|
5
5
|
/**
|
|
6
6
|
* Every body the package knows, in the order a hopper goes: the Sun, then each planet, dwarf planet and minor body from the Sun outwards, each followed by its moons nearest first (Mercury, Venus, the Earth and the
|
|
7
7
|
* Moon, Mars, Phobos and Deimos, Vesta, Ceres, Pallas, Jupiter and its four large moons, and on to Sedna).
|
package/dist/space/element.d.ts
CHANGED
|
@@ -96,7 +96,7 @@ export interface BodyHover extends BodyInfo {
|
|
|
96
96
|
* ```
|
|
97
97
|
*/
|
|
98
98
|
export interface BodySight extends Sight {
|
|
99
|
-
/** A body's id, a craft's own id (`voyager1`, `roadster`) when `kind` is `spacecraft`, or an orbiter's id (`mro`, the one `orbiter` takes) when `kind` is `orbiter`, or an asteroid's id from `/asteroids` (`
|
|
99
|
+
/** A body's id, a craft's own id (`voyager1`, `roadster`) when `kind` is `spacecraft`, or an orbiter's id (`mro`, the one `orbiter` takes) when `kind` is `orbiter`, or an asteroid's id from `/asteroids` (`itokawa`, with the option `asteroids` on) when `kind` is `small-body`. */
|
|
100
100
|
id: string;
|
|
101
101
|
kind: SpaceKind | "spacecraft" | "orbiter" | "small-body";
|
|
102
102
|
host?: BodyId;
|
|
@@ -606,6 +606,20 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
606
606
|
}, final?: boolean, reason?: string): void;
|
|
607
607
|
/** The body the camera looks at: any body the view places, by name in any case (`earth`, `sun`, `moon`, `mercury` to `neptune`, `pluto`, and the moons of the planets such as `titan`). At zoom 1 it fills the view; the yaw and tilt turn the camera round it. Setting it moves the camera there at once and keeps the zoom; `goTo` glides and brings the body into view. */
|
|
608
608
|
get body(): BodyId;
|
|
609
|
+
/**
|
|
610
|
+
* The body the camera is at, which is `body` unless `turnTo` has turned the view to another body from where the camera stands: then `body` is the body looked at and `at` is the one the camera is still at, so a page can tell "looking at" from "at".
|
|
611
|
+
* It follows `body` the moment the camera goes anywhere (`goTo`, setting `body`, a hop).
|
|
612
|
+
*
|
|
613
|
+
* @example
|
|
614
|
+
* ```ts no-run
|
|
615
|
+
* import type { WakuseiSpace } from "@johnmorrisdotca/wakusei-planets/space/element";
|
|
616
|
+
*
|
|
617
|
+
* const space = document.querySelector<WakuseiSpace>("wakusei-space")!;
|
|
618
|
+
* space.turnTo("mars", { smooth: false });
|
|
619
|
+
* console.log(space.body, space.at);
|
|
620
|
+
* ```
|
|
621
|
+
*/
|
|
622
|
+
get at(): BodyId;
|
|
609
623
|
set body(name: BodyId | string);
|
|
610
624
|
/** What the hopper can do from where it is: the body at the middle, and the bodies the previous and next hop lead to. */
|
|
611
625
|
get hopper(): {
|
|
@@ -621,7 +635,7 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
621
635
|
* tells the page where it went and where the next and previous hops lead. A name in any case, in English or Japanese, works.
|
|
622
636
|
*
|
|
623
637
|
*
|
|
624
|
-
* With the option `asteroids` on it takes an asteroid's id from `/asteroids` too (`"
|
|
638
|
+
* With the option `asteroids` on it takes an asteroid's id from `/asteroids` too (`"itokawa"`; `"asteroid:europa"` and `"asteroid:dione"` are the forms that mean the asteroid, for `europa` and `dione` are moons first): the view
|
|
625
639
|
* is set to the true scale (the squeezed scale cannot place a camera among the bodies, and going back to it ends the move), and the camera goes to a distance of a few times the asteroid's size (at least 200 km) looking at it
|
|
626
640
|
* and keeps it there as the clock runs: `riding` says which asteroid (`riding.target.id`), `wakusei-ride` is sent as for any ride and `wakusei-hop` is not (an asteroid is no stop of the hopper), and a `goTo` of a body or `ride(null)` ends it.
|
|
627
641
|
* Asked before the records are in, the move is made when they are, unless another move is asked for first.
|
|
@@ -637,7 +651,7 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
637
651
|
*
|
|
638
652
|
* const space = document.querySelector<WakuseiSpace>("wakusei-space")!;
|
|
639
653
|
* space.asteroids = true;
|
|
640
|
-
* space.goTo("
|
|
654
|
+
* space.goTo("itokawa");
|
|
641
655
|
* console.log(space.riding?.target);
|
|
642
656
|
* ```
|
|
643
657
|
*/
|
|
@@ -651,7 +665,7 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
651
665
|
/**
|
|
652
666
|
* Turn the camera where it stands until a body is in the picture, by the least turn: no move of the camera's place, only the way it looks. A body is in the picture when its middle is inside the picture less `margin` of
|
|
653
667
|
* each side (the left and right margins are `margin` of the width, the top and bottom `margin` of the height; 0.15 by default, 0 to 0.45). One already so is left alone and the answer is `false`, as it is for an id the
|
|
654
|
-
* view does not know, the body already looked at, and a view that is riding. The body becomes the one looked at: the camera stays at its place and looks at it, from as far
|
|
668
|
+
* view does not know, the body already looked at, and a view that is riding (a camera beside the Moon in a ride is not turned: ride off first). The body becomes the one looked at (`body`) while `at` still names the body the camera stands at: the camera stays at its place and looks at it, from as far
|
|
655
669
|
* as it stands (the zoom is worked out from that distance, inside the controls' limits; a body so far that the zoom's limit would move the camera is not turned to). It glides the way a move does, or at once with
|
|
656
670
|
* `smooth: false` or for a reader who prefers reduced motion; nothing is drawn at rest and one draw more at most ends it.
|
|
657
671
|
*
|
package/dist/space/element.js
CHANGED
|
@@ -206,6 +206,8 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
206
206
|
#hands;
|
|
207
207
|
#markLayer;
|
|
208
208
|
#markList;
|
|
209
|
+
/** The body the camera stands at while `turnTo` has turned the view to another: the body looked at is `to`, the camera is still at `at`. Let go when the camera goes to a body. */
|
|
210
|
+
#turned = null;
|
|
209
211
|
#markLoading;
|
|
210
212
|
#markHeard;
|
|
211
213
|
#placeGlide = 0;
|
|
@@ -1180,7 +1182,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1180
1182
|
return id !== undefined && this.#model.asteroids && this.#model.asteroidSet !== null && this.#model.asteroidSet.ids.includes(id);
|
|
1181
1183
|
}
|
|
1182
1184
|
/**
|
|
1183
|
-
* The asteroid a `goTo` or `ride` names, as its plain id, or `undefined` where the name is none and the call goes on as it did: `
|
|
1185
|
+
* The asteroid a `goTo` or `ride` names, as its plain id, or `undefined` where the name is none and the call goes on as it did: `itokawa`, or `asteroid:itokawa` (the form that always means the asteroid; `europa` and `dione`
|
|
1184
1186
|
* are moons first). Throws a `RangeError` when it is one and the option `asteroids` is off, and, with the option on, for a name that is neither a body of the view nor an asteroid.
|
|
1185
1187
|
*/
|
|
1186
1188
|
#asteroidNamed(target, call) {
|
|
@@ -1191,7 +1193,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1191
1193
|
return undefined;
|
|
1192
1194
|
if (!ASTEROID_IDS.includes(id)) {
|
|
1193
1195
|
if (prefixed || this.#model.asteroids)
|
|
1194
|
-
throw new RangeError(`${call}(${JSON.stringify(target)}): not a body of the view and not an asteroid of /asteroids (an asteroid's id is one of asteroidList(), such as "
|
|
1196
|
+
throw new RangeError(`${call}(${JSON.stringify(target)}): not a body of the view and not an asteroid of /asteroids (an asteroid's id is one of asteroidList(), such as "itokawa")`);
|
|
1195
1197
|
return undefined;
|
|
1196
1198
|
}
|
|
1197
1199
|
if (!this.#model.asteroids)
|
|
@@ -1716,6 +1718,22 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1716
1718
|
get body() {
|
|
1717
1719
|
return this.#model.focus;
|
|
1718
1720
|
}
|
|
1721
|
+
/**
|
|
1722
|
+
* The body the camera is at, which is `body` unless `turnTo` has turned the view to another body from where the camera stands: then `body` is the body looked at and `at` is the one the camera is still at, so a page can tell "looking at" from "at".
|
|
1723
|
+
* It follows `body` the moment the camera goes anywhere (`goTo`, setting `body`, a hop).
|
|
1724
|
+
*
|
|
1725
|
+
* @example
|
|
1726
|
+
* ```ts no-run
|
|
1727
|
+
* import type { WakuseiSpace } from "@johnmorrisdotca/wakusei-planets/space/element";
|
|
1728
|
+
*
|
|
1729
|
+
* const space = document.querySelector<WakuseiSpace>("wakusei-space")!;
|
|
1730
|
+
* space.turnTo("mars", { smooth: false });
|
|
1731
|
+
* console.log(space.body, space.at);
|
|
1732
|
+
* ```
|
|
1733
|
+
*/
|
|
1734
|
+
get at() {
|
|
1735
|
+
return this.#turned !== null && this.#turned.to === this.#model.focus ? this.#turned.at : this.#model.focus;
|
|
1736
|
+
}
|
|
1719
1737
|
set body(name) {
|
|
1720
1738
|
const id = readBody(name);
|
|
1721
1739
|
if (!id)
|
|
@@ -1725,6 +1743,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1725
1743
|
/** Move the camera to `id` (not yet drawn) and tell the page. */
|
|
1726
1744
|
#centre(id) {
|
|
1727
1745
|
const was = this.#model.focus;
|
|
1746
|
+
this.#turned = null;
|
|
1728
1747
|
this.#model.focus = id;
|
|
1729
1748
|
this.#gate?.request();
|
|
1730
1749
|
if (was !== id)
|
|
@@ -1743,7 +1762,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1743
1762
|
* tells the page where it went and where the next and previous hops lead. A name in any case, in English or Japanese, works.
|
|
1744
1763
|
*
|
|
1745
1764
|
*
|
|
1746
|
-
* With the option `asteroids` on it takes an asteroid's id from `/asteroids` too (`"
|
|
1765
|
+
* With the option `asteroids` on it takes an asteroid's id from `/asteroids` too (`"itokawa"`; `"asteroid:europa"` and `"asteroid:dione"` are the forms that mean the asteroid, for `europa` and `dione` are moons first): the view
|
|
1747
1766
|
* is set to the true scale (the squeezed scale cannot place a camera among the bodies, and going back to it ends the move), and the camera goes to a distance of a few times the asteroid's size (at least 200 km) looking at it
|
|
1748
1767
|
* and keeps it there as the clock runs: `riding` says which asteroid (`riding.target.id`), `wakusei-ride` is sent as for any ride and `wakusei-hop` is not (an asteroid is no stop of the hopper), and a `goTo` of a body or `ride(null)` ends it.
|
|
1749
1768
|
* Asked before the records are in, the move is made when they are, unless another move is asked for first.
|
|
@@ -1759,7 +1778,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1759
1778
|
*
|
|
1760
1779
|
* const space = document.querySelector<WakuseiSpace>("wakusei-space")!;
|
|
1761
1780
|
* space.asteroids = true;
|
|
1762
|
-
* space.goTo("
|
|
1781
|
+
* space.goTo("itokawa");
|
|
1763
1782
|
* console.log(space.riding?.target);
|
|
1764
1783
|
* ```
|
|
1765
1784
|
*/
|
|
@@ -1786,6 +1805,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1786
1805
|
model.region = null;
|
|
1787
1806
|
this.#showRegion();
|
|
1788
1807
|
this.#selected = id;
|
|
1808
|
+
this.#turned = null;
|
|
1789
1809
|
this.#model.focus = id;
|
|
1790
1810
|
const zoom = options.zoom ?? 1;
|
|
1791
1811
|
// the side the camera comes from, as the controls' yaw and tilt: the element's own hands are set to it here, and a bar bound to the element (which holds the view's state) hears it in the event with the zoom
|
|
@@ -1809,7 +1829,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1809
1829
|
/**
|
|
1810
1830
|
* Turn the camera where it stands until a body is in the picture, by the least turn: no move of the camera's place, only the way it looks. A body is in the picture when its middle is inside the picture less `margin` of
|
|
1811
1831
|
* each side (the left and right margins are `margin` of the width, the top and bottom `margin` of the height; 0.15 by default, 0 to 0.45). One already so is left alone and the answer is `false`, as it is for an id the
|
|
1812
|
-
* view does not know, the body already looked at, and a view that is riding. The body becomes the one looked at: the camera stays at its place and looks at it, from as far
|
|
1832
|
+
* view does not know, the body already looked at, and a view that is riding (a camera beside the Moon in a ride is not turned: ride off first). The body becomes the one looked at (`body`) while `at` still names the body the camera stands at: the camera stays at its place and looks at it, from as far
|
|
1813
1833
|
* as it stands (the zoom is worked out from that distance, inside the controls' limits; a body so far that the zoom's limit would move the camera is not turned to). It glides the way a move does, or at once with
|
|
1814
1834
|
* `smooth: false` or for a reader who prefers reduced motion; nothing is drawn at rest and one draw more at most ends it.
|
|
1815
1835
|
*
|
|
@@ -1869,6 +1889,8 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1869
1889
|
model.region = null;
|
|
1870
1890
|
this.#showRegion();
|
|
1871
1891
|
this.#selected = id;
|
|
1892
|
+
// the camera stays at the body it stood at, or the one it was already turned from: the view looks at `id`
|
|
1893
|
+
this.#turned = { at: this.#turned !== null && this.#turned.to === model.focus ? this.#turned.at : model.focus, to: id };
|
|
1872
1894
|
model.focus = id;
|
|
1873
1895
|
if (this.#hands !== undefined && !this.hasAttribute("data-kazoku-bar"))
|
|
1874
1896
|
this.#hands.controller.set({ yaw, tilt, zoom }, true, "jump");
|
package/dist/space/frame.d.ts
CHANGED
|
@@ -78,7 +78,7 @@ export type SpaceDwarf = DwarfId;
|
|
|
78
78
|
* console.log(SPACE_MINORS.join(", "));
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
|
-
export declare const SPACE_MINORS: readonly ["vesta", "pallas", "chiron", "pholus", "halley"];
|
|
81
|
+
export declare const SPACE_MINORS: readonly ["bennu", "eros", "vesta", "pallas", "chiron", "pholus", "halley", "arrokoth"];
|
|
82
82
|
/**
|
|
83
83
|
* One of the minor bodies in `SPACE_MINORS`.
|
|
84
84
|
*
|
package/dist/space/regions.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export declare const SUN_REGIONS: readonly [{
|
|
|
47
47
|
readonly en: "Whole solar system";
|
|
48
48
|
readonly ja: "太陽系全体";
|
|
49
49
|
};
|
|
50
|
-
readonly bodies: readonly ["earth", "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto", "ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna", "vesta", "pallas", "chiron", "pholus", "halley"];
|
|
50
|
+
readonly bodies: readonly ["earth", "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto", "ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna", "bennu", "eros", "vesta", "pallas", "chiron", "pholus", "halley", "arrokoth"];
|
|
51
51
|
}];
|
|
52
52
|
/**
|
|
53
53
|
* The `id` of one of the stages in `SUN_REGIONS`.
|
package/dist/space/scene.d.ts
CHANGED
|
@@ -28,7 +28,7 @@ export declare const FIT_DISTANCE = 4.1;
|
|
|
28
28
|
/** How much of the picture's shorter side a body's disc is framed across at zoom 1, in the body's radii: 1, and more for a ringed body. */
|
|
29
29
|
export declare const framedOf: (id: string) => number;
|
|
30
30
|
/**
|
|
31
|
-
* The twenty-
|
|
31
|
+
* The twenty-seven bodies the space view places, names and lets a reader choose: the Earth, the Sun, the Moon, the seven other planets, Pluto, the eight other dwarf planets and the eight minor bodies (Bennu, Eros, Vesta, Pallas, Chiron, Pholus, Halley and Arrokoth). The moons of the planets and of the dwarf planets are placed round their hosts.
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```ts no-run
|
|
@@ -37,7 +37,7 @@ export declare const framedOf: (id: string) => number;
|
|
|
37
37
|
* console.log(SPACE_BODIES.join(", "));
|
|
38
38
|
* ```
|
|
39
39
|
*/
|
|
40
|
-
export declare const SPACE_BODIES: readonly ["earth", "sun", "moon", "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto", "ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna", "vesta", "pallas", "chiron", "pholus", "halley"];
|
|
40
|
+
export declare const SPACE_BODIES: readonly ["earth", "sun", "moon", "mercury", "venus", "mars", "jupiter", "saturn", "uranus", "neptune", "pluto", "ceres", "orcus", "haumea", "quaoar", "makemake", "gonggong", "eris", "sedna", "bennu", "eros", "vesta", "pallas", "chiron", "pholus", "halley", "arrokoth"];
|
|
41
41
|
/**
|
|
42
42
|
* One of the bodies in `SPACE_BODIES`, by the package's usual lower-case name.
|
|
43
43
|
*
|
package/dist/space/scene.js
CHANGED
|
@@ -77,7 +77,7 @@ const ROADSTER_PX = 3;
|
|
|
77
77
|
const ROADSTER_ORBIT_MS = 560 * 86_400_000;
|
|
78
78
|
const ROADSTER_ORBIT_KEEP_MS = 30 * 86_400_000;
|
|
79
79
|
/**
|
|
80
|
-
* The twenty-
|
|
80
|
+
* The twenty-seven bodies the space view places, names and lets a reader choose: the Earth, the Sun, the Moon, the seven other planets, Pluto, the eight other dwarf planets and the eight minor bodies (Bennu, Eros, Vesta, Pallas, Chiron, Pholus, Halley and Arrokoth). The moons of the planets and of the dwarf planets are placed round their hosts.
|
|
81
81
|
*
|
|
82
82
|
* @example
|
|
83
83
|
* ```ts no-run
|
|
@@ -721,7 +721,8 @@ export function createSpaceItem(model, deps) {
|
|
|
721
721
|
camera.position.set(target.x + aim[0] * distance, target.y + aim[1] * distance, target.z + aim[2] * distance);
|
|
722
722
|
camera.up.set(upNow[0], upNow[1], upNow[2]);
|
|
723
723
|
camera.lookAt(target);
|
|
724
|
-
camera
|
|
724
|
+
// the floor is a tenth of the distance when the camera is nearer than 0.005 (about 32 km): Bennu's middle is 1 km from the eye, inside the old floor of 0.0005, and a point nearer than the near plane is not drawn or placed
|
|
725
|
+
camera.near = Math.max(Math.min(0.0005, distance * 0.1), distance * 0.02 - focusRadius * 0.5, focusRadius * 0.01);
|
|
725
726
|
camera.far = Math.max(2000, distance * 4 + (mode === "true" ? 40 * 23_481 : 400));
|
|
726
727
|
}
|
|
727
728
|
// a move to a new target: the camera travels from where the last draw left it to the view just set up, along the path `travelPose` gives (the body left kept in the picture through the
|
package/dist/stops.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
// (https://nssdc.gsfc.nasa.gov/planetary/factsheet/) for the Sun (132,712 × 10^6), Mercury (0.022032 × 10^6) and Venus (0.32486 × 10^6).
|
|
5
5
|
// Ceres, Eris, Makemake and Haumea: the mass on JPL "Planetary Physical Parameters" (https://ssd.jpl.nasa.gov/planets/phys_par.html)
|
|
6
6
|
// times the CODATA 2018 G that page names. Escape speeds for the Sun and those planets are the speeds those pages print.
|
|
7
|
-
// Vesta (17.2882844) and Pallas (13.63): the GM of JPL's Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api
|
|
7
|
+
// Bennu (4.8904e-9), Eros (4.463e-4), Vesta (17.2882844) and Pallas (13.63): the GM of JPL's Small-Body Database (https://ssd-api.jpl.nasa.gov/sbdb.api; Bennu and Eros read 2026-11-23, the others 2026-11-10), from Chesley et al. 2020, Yeomans et al. 2000, Park et al. 2025 and Vernazza et al. 2021.
|
|
8
8
|
// A moon's escape speed is sqrt(2 GM / radius) from this package's radius. Nereid, and the dwarf planets and moons
|
|
9
9
|
// whose pages do not print a mass, are left empty.
|
|
10
10
|
import { heliocentric, meanSunAu, moonVector } from "./ephemeris.js";
|
|
@@ -31,6 +31,8 @@ const GM = {
|
|
|
31
31
|
eris: mass(16_600e18),
|
|
32
32
|
makemake: mass(3_100e18),
|
|
33
33
|
haumea: mass(4_006e18),
|
|
34
|
+
bennu: 4.8904e-9,
|
|
35
|
+
eros: 4.463e-4,
|
|
34
36
|
vesta: 17.2882844,
|
|
35
37
|
pallas: 13.63,
|
|
36
38
|
moon: 4_902.8,
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.75.
|
|
1
|
+
export declare const VERSION = "0.75.2";
|
package/dist/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// The published package version. Snippets and texture addresses name it. test/version.test.ts keeps it equal to package.json.
|
|
2
|
-
export const VERSION = "0.75.
|
|
2
|
+
export const VERSION = "0.75.2";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.75.
|
|
3
|
+
"version": "0.75.2",
|
|
4
4
|
"description": "Wakusei Planets 惑星 — The Sun, planets and moons for the web: each as a clean line drawing, a shaded realistic drawing or a painted surface map, with real sizes, axial tilt and rotation as data, and positions of the moons for any date and time. SVG for the lines, three.js (optional) for the rest.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"planets",
|