@johnmorrisdotca/wakusei-planets 0.52.0 → 0.53.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 +4 -0
- package/README.md +3 -3
- package/dist/scene/textures.d.ts +2 -2
- package/dist/space/arrows.d.ts +51 -0
- package/dist/space/arrows.js +46 -0
- package/dist/space/element.d.ts +7 -0
- package/dist/space/element.js +16 -2
- package/dist/space/index.d.ts +1 -1
- package/dist/space/index.js +1 -1
- package/dist/space/scene.d.ts +3 -1
- package/dist/space/scene.js +4 -3
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.53.0] - 2026-11-14
|
|
6
|
+
|
|
7
|
+
- **The spin arrow can sit above the pole** (MODULES-1359). `help-place` (and `space.helpPlace`) chooses where help mode's curved arrow is drawn. `pole`, the default, draws a small arrow just outside the surface, around the north-pole line. `across` draws the wide arrow a little off the centre, across the body, which is how it was drawn before. The arrow still turns by the right-hand rule about the axis the body really spins about.
|
|
8
|
+
|
|
5
9
|
## [0.52.0] - 2026-11-13
|
|
6
10
|
|
|
7
11
|
- **The craft page's Play moves only its marker** (MODULES-1339). `demo/craft.html` no longer redraws the whole chart on each Play step: it moves the marker and the line and leaves the rest alone, and `e2e/craft-freeze.demo.ts` counts the craft loop's frames apart from the page's others. Demo page only: the package is unchanged.
|
package/README.md
CHANGED
|
@@ -19,7 +19,7 @@ Wakusei Planets runs in the browser of a phone, a tablet or a computer: nothing
|
|
|
19
19
|
|
|
20
20
|
<p align="center"><img alt="The demo on a desk: Saturn in the painted look, turning in the big view, with the page's links to the portrait builder, the colouring sheets, the space view, the star page and the size line-up above it, and the choice of body and its moons below" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-desk.webp" width="620"> <img alt="The same page on a phone: the same links in rows, and Saturn in the painted look below them" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/main/docs/images/home-phone.webp" width="200"></p>
|
|
21
21
|
|
|
22
|
-
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
22
|
+
<p align="center"><img alt="Every body at one scale, the Earth among them: each small body has a magnified picture joined by a line, and the Sun shows only its edge" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.53.0/docs/images/lineup-desk.png" width="640"></p>
|
|
23
23
|
|
|
24
24
|
## Who it is for
|
|
25
25
|
|
|
@@ -388,7 +388,7 @@ The tiles of every body share one 48 MB budget, six loads at a time for a source
|
|
|
388
388
|
|
|
389
389
|
## The portrait builder
|
|
390
390
|
|
|
391
|
-
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.
|
|
391
|
+
<p align="center"><img alt="The Sun and the planets in an arc, painted, with their names, in the portrait builder" src="https://raw.githubusercontent.com/johnmorrisdotca/wakusei-planets/v0.53.0/docs/images/portrait-family.png" width="640"></p>
|
|
392
392
|
|
|
393
393
|
[The portrait builder](https://johnmorrisdotca.github.io/wakusei-planets/portrait.html) puts any bodies in one picture: drag them, size them, turn them, order them front to back, arrange them in a row, an arc, a grid or at true orbit distance (true or readable sizes, a planet's moons round it in orbit order), light them from one direction, and take the code, a PNG or an SVG. The scene is kept in the address, and every body is drawn in one WebGL scene, so the page holds one WebGL context. [The portrait builder](docs/guides/portrait-builder.md) is its guide.
|
|
394
394
|
|
|
@@ -537,7 +537,7 @@ BODIES.pluto.kind; // "dwarf-planet"
|
|
|
537
537
|
|
|
538
538
|
If this package helps a paper, a talk or a class, please cite it as software. GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA; in plain text:
|
|
539
539
|
|
|
540
|
-
> Morris, J. (2026). *Wakusei Planets* (version 0.
|
|
540
|
+
> Morris, J. (2026). *Wakusei Planets* (version 0.53.0) [Computer software]. https://github.com/johnmorrisdotca/wakusei-planets
|
|
541
541
|
|
|
542
542
|
Cite the version you used (`npm ls @johnmorrisdotca/wakusei-planets`), and cite the sources of the numbers you use as well: [NOTICE.md](NOTICE.md) names each one, with the paper or the page it was read from (the IAU working group's report for sizes and poles, VSOP87B, ELP2000-82B, L1.2 and TASS1.7 for positions, and NASA's JPL Horizons for the fits and the spacecraft).
|
|
543
543
|
|
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.
|
|
14
|
+
export declare const TEXTURE_BASE = "https://cdn.jsdelivr.net/npm/@johnmorrisdotca/wakusei-planets@0.53.0/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.
|
|
26
|
+
export declare const TEXTURE_FAR_BASE = "https://cdn.jsdelivr.net/gh/johnmorrisdotca/wakusei-planets@v0.53.0/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/space/arrows.d.ts
CHANGED
|
@@ -111,3 +111,54 @@ export declare function spinArrow(centre: Vec3, axis: Vec3, radius: number, lift
|
|
|
111
111
|
arc: Vec3[];
|
|
112
112
|
head: [Vec3, Vec3];
|
|
113
113
|
};
|
|
114
|
+
/**
|
|
115
|
+
* Where help mode draws the curved arrow: `pole` rings the north-pole line, `across` cuts across the body.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* import type { HelpPlace } from "@johnmorrisdotca/wakusei-planets/space";
|
|
120
|
+
*
|
|
121
|
+
* const place: HelpPlace = "pole";
|
|
122
|
+
* console.log(place);
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export type HelpPlace = "pole" | "across";
|
|
126
|
+
/**
|
|
127
|
+
* Which place a page asked for (the attribute `help-place`). `across` is the wide arrow across the body. Anything else, including nothing, is `pole`.
|
|
128
|
+
*
|
|
129
|
+
* @param value - The attribute's text, or the property.
|
|
130
|
+
* @returns `pole` or `across`.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* import { readHelpPlace } from "@johnmorrisdotca/wakusei-planets/space";
|
|
135
|
+
*
|
|
136
|
+
* console.log(readHelpPlace(null), readHelpPlace("across"));
|
|
137
|
+
* ```
|
|
138
|
+
*/
|
|
139
|
+
export declare function readHelpPlace(value: string | null | undefined): HelpPlace;
|
|
140
|
+
/**
|
|
141
|
+
* The help mode's spin arrow in one of its two places. `pole` (the default) is a small circle just outside the surface, centred on the north-pole line. `across` is the wide circle a little off the centre, the way the arrow was drawn
|
|
142
|
+
* before. Either way the arrow turns by the right-hand rule about `axis`, so a body that spins backwards still shows that.
|
|
143
|
+
*
|
|
144
|
+
* @param centre - The body's centre.
|
|
145
|
+
* @param axis - The unit axis it spins about.
|
|
146
|
+
* @param pole - The unit vector to its north pole.
|
|
147
|
+
* @param radius - The body's drawn radius, in the scene's units.
|
|
148
|
+
* @param place - `pole` or `across`. Left out, `pole`.
|
|
149
|
+
* @param segments - How many pieces the arc is cut into.
|
|
150
|
+
* @returns The arc, the arrowhead's wings, and the middle of the circle.
|
|
151
|
+
*
|
|
152
|
+
* @example
|
|
153
|
+
* ```ts
|
|
154
|
+
* import { helpSpin } from "@johnmorrisdotca/wakusei-planets/space";
|
|
155
|
+
*
|
|
156
|
+
* const arrow = helpSpin([0, 0, 0], [0, 1, 0], [0, 1, 0], 2);
|
|
157
|
+
* console.log(arrow.middle[1].toFixed(1), arrow.arc.length);
|
|
158
|
+
* ```
|
|
159
|
+
*/
|
|
160
|
+
export declare function helpSpin(centre: Vec3, axis: Vec3, pole: Vec3, radius: number, place?: HelpPlace, segments?: number): {
|
|
161
|
+
arc: Vec3[];
|
|
162
|
+
head: [Vec3, Vec3];
|
|
163
|
+
middle: Vec3;
|
|
164
|
+
};
|
package/dist/space/arrows.js
CHANGED
|
@@ -147,3 +147,49 @@ export function spinArrow(centre, axis, radius, lift, segments = 28) {
|
|
|
147
147
|
const head = [add(tip, add(scale(tangent, -back), scale(outward, back * 0.55))), add(tip, add(scale(tangent, -back), scale(outward, -back * 0.55)))];
|
|
148
148
|
return { arc, head };
|
|
149
149
|
}
|
|
150
|
+
/**
|
|
151
|
+
* Which place a page asked for (the attribute `help-place`). `across` is the wide arrow across the body. Anything else, including nothing, is `pole`.
|
|
152
|
+
*
|
|
153
|
+
* @param value - The attribute's text, or the property.
|
|
154
|
+
* @returns `pole` or `across`.
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```ts
|
|
158
|
+
* import { readHelpPlace } from "@johnmorrisdotca/wakusei-planets/space";
|
|
159
|
+
*
|
|
160
|
+
* console.log(readHelpPlace(null), readHelpPlace("across"));
|
|
161
|
+
* ```
|
|
162
|
+
*/
|
|
163
|
+
export function readHelpPlace(value) {
|
|
164
|
+
return value === "across" ? "across" : "pole";
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* The help mode's spin arrow in one of its two places. `pole` (the default) is a small circle just outside the surface, centred on the north-pole line. `across` is the wide circle a little off the centre, the way the arrow was drawn
|
|
168
|
+
* before. Either way the arrow turns by the right-hand rule about `axis`, so a body that spins backwards still shows that.
|
|
169
|
+
*
|
|
170
|
+
* @param centre - The body's centre.
|
|
171
|
+
* @param axis - The unit axis it spins about.
|
|
172
|
+
* @param pole - The unit vector to its north pole.
|
|
173
|
+
* @param radius - The body's drawn radius, in the scene's units.
|
|
174
|
+
* @param place - `pole` or `across`. Left out, `pole`.
|
|
175
|
+
* @param segments - How many pieces the arc is cut into.
|
|
176
|
+
* @returns The arc, the arrowhead's wings, and the middle of the circle.
|
|
177
|
+
*
|
|
178
|
+
* @example
|
|
179
|
+
* ```ts
|
|
180
|
+
* import { helpSpin } from "@johnmorrisdotca/wakusei-planets/space";
|
|
181
|
+
*
|
|
182
|
+
* const arrow = helpSpin([0, 0, 0], [0, 1, 0], [0, 1, 0], 2);
|
|
183
|
+
* console.log(arrow.middle[1].toFixed(1), arrow.arc.length);
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
export function helpSpin(centre, axis, pole, radius, place = "pole", segments = 28) {
|
|
187
|
+
if (place === "across") {
|
|
188
|
+
const lift = 0.4 * radius;
|
|
189
|
+
const drawn = spinArrow(centre, axis, 1.3 * radius, lift, segments);
|
|
190
|
+
return { ...drawn, middle: add(centre, scale(axis, lift)) };
|
|
191
|
+
}
|
|
192
|
+
const at = add(centre, scale(unit(pole), 1.25 * radius));
|
|
193
|
+
const drawn = spinArrow(at, axis, 0.45 * radius, 0, segments);
|
|
194
|
+
return { ...drawn, middle: at };
|
|
195
|
+
}
|
package/dist/space/element.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type ViewController } from "@johnmorrisdotca/kazoku-ui/view-controls";
|
|
2
2
|
import "../tables/minor.ts";
|
|
3
3
|
import { type BodyId } from "../facts.ts";
|
|
4
|
+
import { type HelpPlace } from "./arrows.ts";
|
|
4
5
|
import { type SpaceKind } from "./bodies.ts";
|
|
5
6
|
import { type Sight, type SightEdge } from "./sight.ts";
|
|
6
7
|
import { type NameLabelOptions } from "../scene/name-label.ts";
|
|
@@ -455,6 +456,12 @@ export declare class WakuseiSpace extends HTMLElement {
|
|
|
455
456
|
*/
|
|
456
457
|
get helpThrough(): boolean;
|
|
457
458
|
set helpThrough(value: boolean);
|
|
459
|
+
/**
|
|
460
|
+
* Where the spin arrow sits (the attribute `help-place`; `pole` by default). `pole` draws a small arrow just outside the surface, around the north-pole line. `across` draws the wide arrow a little off the centre, across the body.
|
|
461
|
+
* Either way it turns by the right-hand rule about the axis the body really spins about.
|
|
462
|
+
*/
|
|
463
|
+
get helpPlace(): HelpPlace;
|
|
464
|
+
set helpPlace(value: HelpPlace);
|
|
458
465
|
/** How the bodies are drawn: `realistic` (shaded from the body's real colours and features) or `painted` (public-domain surface maps). */
|
|
459
466
|
get look(): "realistic" | "painted";
|
|
460
467
|
set look(value: "realistic" | "painted");
|
package/dist/space/element.js
CHANGED
|
@@ -2,7 +2,7 @@ import { carryControls } from "@johnmorrisdotca/kazoku-ui/view-controls";
|
|
|
2
2
|
import "../tables/minor.js";
|
|
3
3
|
import { BODIES, BODY_IDS, MOONS_OF } from "../facts.js";
|
|
4
4
|
import { createGate, frameCap } from "../gate.js";
|
|
5
|
-
import { arrowCount } from "./arrows.js";
|
|
5
|
+
import { arrowCount, readHelpPlace } from "./arrows.js";
|
|
6
6
|
import { createGameClock } from "./clock.js";
|
|
7
7
|
import { bodyKindOf, findBody, hopFrom, hostOf, HOP_ORDER, systemOf } from "./bodies.js";
|
|
8
8
|
import { sightChanged, sightOf, withinMargin } from "./sight.js";
|
|
@@ -141,7 +141,7 @@ const orbiterLines = (value) => (value === "chosen" || value === "none" ? value
|
|
|
141
141
|
* ```
|
|
142
142
|
*/
|
|
143
143
|
export class WakuseiSpace extends HTMLElement {
|
|
144
|
-
static observedAttributes = ["center", "time", "speed", "scale", "labels", "labels-always", "covered", "roadster", "spacecraft", "orbiters", "orbiter", "orbiter-lines", "orbiter-track", "orbits", "help", "look", "light", "lang", "data", "arrows", "help-through", "places", "surface-names", "earth-places", "earth-places-look", "all-moons", "far-opacity", "transition", "pace", "belts", "moon-size", ...NAME_LABEL_ATTRIBUTES];
|
|
144
|
+
static observedAttributes = ["center", "time", "speed", "scale", "labels", "labels-always", "covered", "roadster", "spacecraft", "orbiters", "orbiter", "orbiter-lines", "orbiter-track", "orbits", "help", "look", "light", "lang", "data", "arrows", "help-through", "help-place", "places", "surface-names", "earth-places", "earth-places-look", "all-moons", "far-opacity", "transition", "pace", "belts", "moon-size", ...NAME_LABEL_ATTRIBUTES];
|
|
145
145
|
#model = newSpaceModel();
|
|
146
146
|
#allMoons = false;
|
|
147
147
|
#catalogue;
|
|
@@ -221,6 +221,7 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
221
221
|
this.#model.arrowCount = arrowCount(this.getAttribute("arrows"));
|
|
222
222
|
this.#model.help = this.hasAttribute("help") && this.getAttribute("help") !== "off";
|
|
223
223
|
this.#model.helpThrough = this.hasAttribute("help-through") && this.getAttribute("help-through") !== "off";
|
|
224
|
+
this.#model.helpPlace = readHelpPlace(this.getAttribute("help-place"));
|
|
224
225
|
this.#travel = { kind: readTravel(this.getAttribute("transition"), "turn-travel"), pace: readPace(this.getAttribute("pace"), 1) };
|
|
225
226
|
this.#model.look = this.getAttribute("look") === "painted" ? "painted" : "realistic";
|
|
226
227
|
this.#model.light = readLight(this.getAttribute("light"));
|
|
@@ -388,6 +389,8 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
388
389
|
this.#farStrength();
|
|
389
390
|
else if (name === "help-through")
|
|
390
391
|
this.helpThrough = value !== null && value !== "off";
|
|
392
|
+
else if (name === "help-place")
|
|
393
|
+
this.helpPlace = readHelpPlace(value);
|
|
391
394
|
else if (name === "transition")
|
|
392
395
|
this.transition = readTravel(value, "turn-travel");
|
|
393
396
|
else if (name === "pace")
|
|
@@ -1214,6 +1217,17 @@ export class WakuseiSpace extends HTMLElement {
|
|
|
1214
1217
|
this.#model.helpThrough = value;
|
|
1215
1218
|
this.#gate?.request();
|
|
1216
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* Where the spin arrow sits (the attribute `help-place`; `pole` by default). `pole` draws a small arrow just outside the surface, around the north-pole line. `across` draws the wide arrow a little off the centre, across the body.
|
|
1222
|
+
* Either way it turns by the right-hand rule about the axis the body really spins about.
|
|
1223
|
+
*/
|
|
1224
|
+
get helpPlace() {
|
|
1225
|
+
return this.#model.helpPlace;
|
|
1226
|
+
}
|
|
1227
|
+
set helpPlace(value) {
|
|
1228
|
+
this.#model.helpPlace = value === "across" ? "across" : "pole";
|
|
1229
|
+
this.#gate?.request();
|
|
1230
|
+
}
|
|
1217
1231
|
/** How the bodies are drawn: `realistic` (shaded from the body's real colours and features) or `painted` (public-domain surface maps). */
|
|
1218
1232
|
get look() {
|
|
1219
1233
|
return this.#model.look === "painted" ? "painted" : "realistic";
|
package/dist/space/index.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export { RIDE_FOV, ridePose, type RideInput, type RideLook, type RidePose } from
|
|
|
5
5
|
export { chooseLabels, LABEL_GAP, nameSpot, type LabelBox } from "./labels.ts";
|
|
6
6
|
export { bodyKindOf, findBody, HOP_ORDER, hopFrom, hostOf, systemOf, type SpaceKind } from "./bodies.ts";
|
|
7
7
|
export { besideMoon, BESIDE_RADII, type BesideCamera, type BesideInput } from "./beside.ts";
|
|
8
|
-
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, spinArrow, type OrbitArrow } from "./arrows.ts";
|
|
8
|
+
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, helpSpin, readHelpPlace, spinArrow, type HelpPlace, type OrbitArrow } from "./arrows.ts";
|
|
9
9
|
export { spinAxis, type SpinAxis } from "./spin.ts";
|
|
10
10
|
export { COVER_ARROW_GAP, COVER_MIN_PX, coverArrows, coveredBy, type CoverArrow, type CoverEntry } from "./covered.ts";
|
|
11
11
|
export { TRAVEL_CLEARANCE, arrivalSide, travelArrival, travelPlan, travelPose, type ArrivalCompanion, type TravelBody, type TravelInput, type TravelKind, type TravelPlan, type TravelSample, type TravelSight, type TravelView } from "./travel.ts";
|
package/dist/space/index.js
CHANGED
|
@@ -6,7 +6,7 @@ export { RIDE_FOV, ridePose } from "./ride.js";
|
|
|
6
6
|
export { chooseLabels, LABEL_GAP, nameSpot } from "./labels.js";
|
|
7
7
|
export { bodyKindOf, findBody, HOP_ORDER, hopFrom, hostOf, systemOf } from "./bodies.js";
|
|
8
8
|
export { besideMoon, BESIDE_RADII } from "./beside.js";
|
|
9
|
-
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, spinArrow } from "./arrows.js";
|
|
9
|
+
export { ARROWS_PER_ORBIT, arrowCount, arrowSites, MAX_ARROWS_PER_ORBIT, chevron, helpSpin, readHelpPlace, spinArrow } from "./arrows.js";
|
|
10
10
|
export { spinAxis } from "./spin.js";
|
|
11
11
|
export { COVER_ARROW_GAP, COVER_MIN_PX, coverArrows, coveredBy } from "./covered.js";
|
|
12
12
|
export { TRAVEL_CLEARANCE, arrivalSide, travelArrival, travelPlan, travelPose } from "./travel.js";
|
package/dist/space/scene.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ import { type BeltId } from "../belts/index.ts";
|
|
|
8
8
|
import { type PaintLabel, type WakuseiPainter } from "../scene/painter.ts";
|
|
9
9
|
import "../bodies/all.ts";
|
|
10
10
|
import { type Vec3 } from "../vec.ts";
|
|
11
|
-
import { type OrbitArrow } from "./arrows.ts";
|
|
11
|
+
import { type HelpPlace, type OrbitArrow } from "./arrows.ts";
|
|
12
12
|
import type { SightInput } from "./sight.ts";
|
|
13
13
|
import { type SpaceDwarf, type SpaceFrame, type SpacePlanet, type SpaceVec3 } from "./frame.ts";
|
|
14
14
|
import { type PaintSpec, type PaintTrail } from "../paint/trail.ts";
|
|
@@ -211,6 +211,8 @@ export interface SpaceModel {
|
|
|
211
211
|
help: boolean;
|
|
212
212
|
/** Help mode draws its lines whole over the globe (`true`); by default they have depth against the body they are on, so the axis shows only outside the globe and the part of the arrow behind it is hidden. */
|
|
213
213
|
helpThrough: boolean;
|
|
214
|
+
/** Where the spin arrow sits: `pole` rings the north-pole line, `across` cuts across the body. */
|
|
215
|
+
helpPlace: HelpPlace;
|
|
214
216
|
/** How many arrowheads each orbit line carries: 0 to `MAX_ARROWS_PER_ORBIT`, two by default. */
|
|
215
217
|
arrowCount: number;
|
|
216
218
|
/** Show the spacecraft in orbit round the Moon and Mars: a dot each on its orbit line, named, once its body is big enough on the screen. Off by default; their paths are loaded when first shown. */
|
package/dist/space/scene.js
CHANGED
|
@@ -9,7 +9,7 @@ import "../bodies/all.js";
|
|
|
9
9
|
import { turn } from "../vec.js";
|
|
10
10
|
import { groundDirection } from "./aim.js";
|
|
11
11
|
import { hostOf } from "./bodies.js";
|
|
12
|
-
import { arrowSites, ARROWS_PER_ORBIT, chevron,
|
|
12
|
+
import { arrowSites, ARROWS_PER_ORBIT, chevron, helpSpin, MAX_ARROWS_PER_ORBIT } from "./arrows.js";
|
|
13
13
|
import { besideMoon } from "./beside.js";
|
|
14
14
|
import { coveredBy } from "./covered.js";
|
|
15
15
|
import { spinAxis } from "./spin.js";
|
|
@@ -97,6 +97,7 @@ export const newSpaceModel = () => ({
|
|
|
97
97
|
arrows: {},
|
|
98
98
|
help: false,
|
|
99
99
|
helpThrough: false,
|
|
100
|
+
helpPlace: "pole",
|
|
100
101
|
arrowPx: 0,
|
|
101
102
|
arrowCount: ARROWS_PER_ORBIT,
|
|
102
103
|
orbiters: false,
|
|
@@ -1072,7 +1073,7 @@ export function createSpaceItem(model, deps) {
|
|
|
1072
1073
|
model.helpDrawn = null;
|
|
1073
1074
|
if (model.help) {
|
|
1074
1075
|
const turn = spinAxis(focus, model.time);
|
|
1075
|
-
const spin =
|
|
1076
|
+
const spin = helpSpin(focusPos, turn.axis, turn.pole, focusRadius, model.helpPlace, HELP_SEGMENTS);
|
|
1076
1077
|
const reach = 1.8 * focusRadius;
|
|
1077
1078
|
const segments = [
|
|
1078
1079
|
[focusPos[0] - turn.pole[0] * reach, focusPos[1] - turn.pole[1] * reach, focusPos[2] - turn.pole[2] * reach],
|
|
@@ -1085,7 +1086,7 @@ export function createSpaceItem(model, deps) {
|
|
|
1085
1086
|
segments.forEach((p, i) => helpPositions.set(p, i * 3));
|
|
1086
1087
|
helpGeometry.getAttribute("position").needsUpdate = true;
|
|
1087
1088
|
// the axis the drawn arc turns about, measured from its own points, round the middle of its circle
|
|
1088
|
-
const middle =
|
|
1089
|
+
const middle = spin.middle;
|
|
1089
1090
|
let sum = [0, 0, 0];
|
|
1090
1091
|
for (let i = 0; i < HELP_SEGMENTS; i += 1) {
|
|
1091
1092
|
const a = minus(spin.arc[i], middle);
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.53.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = "0.
|
|
1
|
+
export const VERSION = "0.53.0";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/wakusei-planets",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.53.0",
|
|
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",
|