@johnmorrisdotca/chikyu-earth 0.46.5 → 0.47.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 +13 -0
- package/README.md +4 -3
- package/dist/beam/geometry.d.ts +131 -0
- package/dist/beam/geometry.js +141 -0
- package/dist/beam/layer.d.ts +47 -0
- package/dist/beam/layer.js +308 -0
- package/dist/markers/place-layer.d.ts +4 -0
- package/dist/markers/place-layer.js +20 -6
- package/dist/place/index.d.ts +230 -0
- package/dist/place/index.js +183 -0
- package/dist/place/land.d.ts +30 -0
- package/dist/place/land.js +177 -0
- package/dist/place/water.d.ts +15 -0
- package/dist/place/water.js +63 -0
- package/dist/realistic/earth.d.ts +9 -1
- package/dist/realistic/earth.js +13 -0
- package/dist/realistic/element-base.d.ts +21 -0
- package/dist/realistic/element-base.js +58 -3
- package/dist/space/element-base.d.ts +136 -2
- package/dist/space/element-base.js +356 -8
- package/dist/space/ephemeris.d.ts +1 -1
- package/dist/space/ephemeris.js +4 -2
- package/dist/space/follow.d.ts +36 -0
- package/dist/space/follow.js +46 -0
- package/dist/space/index.d.ts +3 -1
- package/dist/space/index.js +2 -0
- package/dist/space/ride.d.ts +3 -2
- package/dist/space/ride.js +6 -4
- package/dist/space/satellite-hover.d.ts +47 -0
- package/dist/space/satellite-hover.js +183 -0
- package/dist/space/satellite-layer.d.ts +56 -1
- package/dist/space/satellite-layer.js +93 -31
- package/dist/space/satellite-model.d.ts +2 -1
- package/dist/space/satellite-model.js +4 -3
- package/dist/space/scene.d.ts +41 -0
- package/dist/space/scene.js +96 -12
- package/package.json +6 -1
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// How much of the Earth's turn the space camera takes. 0 holds the stars (the camera stays where it was set). 1 turns with the Earth.
|
|
2
|
+
// A change keeps the longitude under the middle of the view: the anchor (or, at 1, the yaw) is moved so the aim does not jump.
|
|
3
|
+
/** Keep a share between 0 and 1. Anything that is not a number is 0. */
|
|
4
|
+
export const clampFollow = (value) => (Number.isFinite(value) ? Math.min(1, Math.max(0, value)) : 0);
|
|
5
|
+
/**
|
|
6
|
+
* The sidereal angle the camera uses, in degrees. `anchor` is the Earth's turn when the camera was set, `spin` is the turn now.
|
|
7
|
+
*
|
|
8
|
+
* @param anchor - The Earth's turn, in degrees, remembered for the space camera.
|
|
9
|
+
* @param spin - The Earth's turn now, in degrees.
|
|
10
|
+
* @param follow - 0 holds the stars, 1 turns with the Earth.
|
|
11
|
+
* @returns The angle added to the place the camera looks at.
|
|
12
|
+
*/
|
|
13
|
+
export const followSpin = (anchor, spin, follow) => {
|
|
14
|
+
const share = clampFollow(follow);
|
|
15
|
+
return anchor + share * (spin - anchor);
|
|
16
|
+
};
|
|
17
|
+
/**
|
|
18
|
+
* The longitude, in degrees, under the middle of the view. The same place before and after a change of `follow`.
|
|
19
|
+
*
|
|
20
|
+
* @param anchor - The Earth's turn remembered for the camera.
|
|
21
|
+
* @param spin - The Earth's turn now.
|
|
22
|
+
* @param follow - The share of that turn the camera takes.
|
|
23
|
+
* @param centreLon - The home longitude.
|
|
24
|
+
* @param yaw - The view's yaw, in degrees.
|
|
25
|
+
* @returns Longitude under the middle, in degrees.
|
|
26
|
+
*/
|
|
27
|
+
export const groundLongitude = (anchor, spin, follow, centreLon, yaw) => followSpin(anchor, spin, follow) + centreLon - yaw - spin;
|
|
28
|
+
const wrap = (deg) => ((((deg + 180) % 360) + 360) % 360) - 180;
|
|
29
|
+
/**
|
|
30
|
+
* Move the camera's anchor, and the yaw when the share becomes 1, so the longitude under the middle stays put.
|
|
31
|
+
*
|
|
32
|
+
* @param anchor - The anchor before the change.
|
|
33
|
+
* @param spin - The Earth's turn now.
|
|
34
|
+
* @param from - The share before the change.
|
|
35
|
+
* @param to - The share after the change.
|
|
36
|
+
* @param yaw - The view's yaw before the change.
|
|
37
|
+
* @returns The anchor and yaw to use with `to`.
|
|
38
|
+
*/
|
|
39
|
+
export function retargetFollow(anchor, spin, from, to, yaw) {
|
|
40
|
+
const next = clampFollow(to);
|
|
41
|
+
const oldSpin = followSpin(anchor, spin, from);
|
|
42
|
+
if (next >= 1)
|
|
43
|
+
return { anchor: spin, yaw: wrap(yaw + (spin - oldSpin)) };
|
|
44
|
+
const nextAnchor = (oldSpin - next * spin) / (1 - next);
|
|
45
|
+
return { anchor: nextAnchor, yaw };
|
|
46
|
+
}
|
package/dist/space/index.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ export { AU_IN_EARTH_RADII, blend, createTrack, EARTH_RADIUS_KM, frameAt, orbitP
|
|
|
2
2
|
export { compress, MOON_COMPRESSED, placeAround, placeMoon, placeSun, RADIUS, SUN_COMPRESSED, truePosition, type ScaleMode } from "./scale.ts";
|
|
3
3
|
export { fitDistance, plainPainter, type BodyDrawing, type BodyMoon, type BodyPainter, type BodyView, type PaintContext, type SatellitePainter } from "./scene.ts";
|
|
4
4
|
export { faceOffset, OUTSIDE_KM, outsidePose, RIDE_FACES, RIDE_FOV, rideFov, ridePose, rideTiltLimits, rideTurnDegrees, type RideFace, type RideInput, type RideLook, type RidePose, type RideModelSize, type RideViewpoint } from "./ride.ts";
|
|
5
|
-
export type
|
|
5
|
+
export { earthHides, type SatelliteScreen } from "./satellite-layer.ts";
|
|
6
6
|
export { ABOVE_MODEL_KM, ABOVE_MODEL_SHARE, aboveAxes, aboveModelShare, MODEL_FADE_FROM_KM, MODEL_FADE_TO_KM, MODEL_HANDOVER_PX, MODEL_RADIUS_SHARE, modelMatrix, modelRadius, satelliteAxes } from "./satellite-model.ts";
|
|
7
7
|
export { genericSatellite, satelliteKind, type SatelliteKind } from "./generic-satellite.ts";
|
|
8
|
+
export { BEAM_ATTRIBUTES, BEAM_COLOUR, BEAM_ELEVATION, beamCells, footprintAngle, footprintKm, readBeam, type BeamCells, type BeamOptions } from "../beam/geometry.ts";
|
|
9
|
+
export type { BeamStats } from "../beam/layer.ts";
|
package/dist/space/index.js
CHANGED
|
@@ -4,5 +4,7 @@ export { AU_IN_EARTH_RADII, blend, createTrack, EARTH_RADIUS_KM, frameAt, orbitP
|
|
|
4
4
|
export { compress, MOON_COMPRESSED, placeAround, placeMoon, placeSun, RADIUS, SUN_COMPRESSED, truePosition } from "./scale.js";
|
|
5
5
|
export { fitDistance, plainPainter } from "./scene.js";
|
|
6
6
|
export { faceOffset, OUTSIDE_KM, outsidePose, RIDE_FACES, RIDE_FOV, rideFov, ridePose, rideTiltLimits, rideTurnDegrees } from "./ride.js";
|
|
7
|
+
export { earthHides } from "./satellite-layer.js";
|
|
7
8
|
export { ABOVE_MODEL_KM, ABOVE_MODEL_SHARE, aboveAxes, aboveModelShare, MODEL_FADE_FROM_KM, MODEL_FADE_TO_KM, MODEL_HANDOVER_PX, MODEL_RADIUS_SHARE, modelMatrix, modelRadius, satelliteAxes } from "./satellite-model.js";
|
|
8
9
|
export { genericSatellite, satelliteKind } from "./generic-satellite.js";
|
|
10
|
+
export { BEAM_ATTRIBUTES, BEAM_COLOUR, BEAM_ELEVATION, beamCells, footprintAngle, footprintKm, readBeam } from "../beam/geometry.js";
|
package/dist/space/ride.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export declare function faceOffset(face: RideFace): {
|
|
|
64
64
|
tilt: number;
|
|
65
65
|
};
|
|
66
66
|
/**
|
|
67
|
-
* The field of view, in degrees, of a riding camera at a zoom: the natural 60 divided by the zoom, held between 5 and 100.
|
|
67
|
+
* The field of view, in degrees, of a riding camera at a zoom: the natural 60 divided by the zoom, held between 1.5 and 100 (a zoom of 40, the most a ride takes, is 1.5 degrees).
|
|
68
68
|
*
|
|
69
69
|
* @param zoom - The shared controls' zoom.
|
|
70
70
|
* @returns The field of view in degrees.
|
|
@@ -203,6 +203,7 @@ export declare const OUTSIDE_KM = 25;
|
|
|
203
203
|
*
|
|
204
204
|
* @param pose - The pose from `ridePose` for the camera at the satellite.
|
|
205
205
|
* @param look - The look the pose was made with.
|
|
206
|
+
* @param low - How far below the middle of the picture the satellite is, as a share of half its height (0 the middle, 1 the bottom edge); by default 0.8 looking along and 0 looking down.
|
|
206
207
|
* @returns The pose moved back from the satellite, with how far the camera is from it in Earth radii and how many degrees below the middle of the picture the satellite is.
|
|
207
208
|
*
|
|
208
209
|
* @example
|
|
@@ -214,7 +215,7 @@ export declare const OUTSIDE_KM = 25;
|
|
|
214
215
|
* console.log(out.distance.toFixed(4), out.below.toFixed(1), out.pose.position.map((n) => n.toFixed(4)).join(","));
|
|
215
216
|
* ```
|
|
216
217
|
*/
|
|
217
|
-
export declare function outsidePose(pose: RidePose, look: RideLook): {
|
|
218
|
+
export declare function outsidePose(pose: RidePose, look: RideLook, low?: number): {
|
|
218
219
|
pose: RidePose;
|
|
219
220
|
distance: number;
|
|
220
221
|
below: number;
|
package/dist/space/ride.js
CHANGED
|
@@ -54,7 +54,7 @@ export function faceOffset(face) {
|
|
|
54
54
|
return { yaw: 0, tilt: 0 };
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
|
-
* The field of view, in degrees, of a riding camera at a zoom: the natural 60 divided by the zoom, held between 5 and 100.
|
|
57
|
+
* The field of view, in degrees, of a riding camera at a zoom: the natural 60 divided by the zoom, held between 1.5 and 100 (a zoom of 40, the most a ride takes, is 1.5 degrees).
|
|
58
58
|
*
|
|
59
59
|
* @param zoom - The shared controls' zoom.
|
|
60
60
|
* @returns The field of view in degrees.
|
|
@@ -67,7 +67,7 @@ export function faceOffset(face) {
|
|
|
67
67
|
* ```
|
|
68
68
|
*/
|
|
69
69
|
export function rideFov(zoom) {
|
|
70
|
-
return Math.min(100, Math.max(5, RIDE_FOV / Math.max(0.05, zoom)));
|
|
70
|
+
return Math.min(100, Math.max(1.5, RIDE_FOV / Math.max(0.05, zoom)));
|
|
71
71
|
}
|
|
72
72
|
/**
|
|
73
73
|
* How many degrees the camera turns for a change of the controls' yaw at a zoom. The controls wrap their yaw into -180 to 180, so a page adds up the turns itself, change by change (`wrapYaw` of the change, scaled by this at the zoom of the moment), and hands
|
|
@@ -140,6 +140,7 @@ const OUTSIDE_LOW = 0.8;
|
|
|
140
140
|
*
|
|
141
141
|
* @param pose - The pose from `ridePose` for the camera at the satellite.
|
|
142
142
|
* @param look - The look the pose was made with.
|
|
143
|
+
* @param low - How far below the middle of the picture the satellite is, as a share of half its height (0 the middle, 1 the bottom edge); by default 0.8 looking along and 0 looking down.
|
|
143
144
|
* @returns The pose moved back from the satellite, with how far the camera is from it in Earth radii and how many degrees below the middle of the picture the satellite is.
|
|
144
145
|
*
|
|
145
146
|
* @example
|
|
@@ -151,10 +152,11 @@ const OUTSIDE_LOW = 0.8;
|
|
|
151
152
|
* console.log(out.distance.toFixed(4), out.below.toFixed(1), out.pose.position.map((n) => n.toFixed(4)).join(","));
|
|
152
153
|
* ```
|
|
153
154
|
*/
|
|
154
|
-
export function outsidePose(pose, look) {
|
|
155
|
+
export function outsidePose(pose, look, low) {
|
|
155
156
|
const height = Math.max(0, norm(pose.position) - 1);
|
|
156
157
|
const distance = Math.max(1e-5, Math.min(OUTSIDE_KM / 6371, height * 0.5));
|
|
157
|
-
const
|
|
158
|
+
const lowNow = low ?? (look === "horizon" ? OUTSIDE_LOW : 0);
|
|
159
|
+
const below = Math.atan(Math.max(0, lowNow) * Math.tan((pose.fov / 2) * RAD));
|
|
158
160
|
// the satellite is along the line of sight turned `below` down (towards the bottom of the picture): the camera is back along that line
|
|
159
161
|
const line = add(scale(pose.forward, Math.cos(below)), scale(pose.up, -Math.sin(below)));
|
|
160
162
|
return { pose: { ...pose, position: add(pose.position, scale(line, -distance)) }, distance, below: below / RAD };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { SatelliteRef } from "../satellites/types.ts";
|
|
2
|
+
import { type SatelliteState } from "./satellite-layer.ts";
|
|
3
|
+
/** The faint orbit is on unless `hover-path` is `off`. Left unset, it follows `names-on-hover` (itself on unless `off`). */
|
|
4
|
+
export declare const hoverPathOn: (path: string | null, names: string | null) => boolean;
|
|
5
|
+
/** A name is shown when the pointer rests on a satellite, unless `names-on-hover` is `off`. */
|
|
6
|
+
export declare const namesOnHover: (value: string | null) => boolean;
|
|
7
|
+
export interface HoverPlace {
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
visible: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** What the element hands the hover: the satellite state, how to find a satellite, and where to put its name. */
|
|
13
|
+
export interface SatelliteHoverHost {
|
|
14
|
+
element: HTMLElement;
|
|
15
|
+
state: SatelliteState;
|
|
16
|
+
pick(x: number, y: number): SatelliteRef | null;
|
|
17
|
+
place(ref: SatelliteRef): HoverPlace | null;
|
|
18
|
+
name(ref: SatelliteRef): string | undefined;
|
|
19
|
+
selected(): SatelliteRef | null;
|
|
20
|
+
request(): void;
|
|
21
|
+
labelParent(): HTMLElement | null;
|
|
22
|
+
pathOn(): boolean;
|
|
23
|
+
namesOn(): boolean;
|
|
24
|
+
style(): {
|
|
25
|
+
color: string;
|
|
26
|
+
opacity: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface SatelliteHover {
|
|
30
|
+
/** Read the attributes again (they changed, or the element just connected). */
|
|
31
|
+
sync(): void;
|
|
32
|
+
/** Move the name to where the last draw put the satellite. Does not ask for a draw. */
|
|
33
|
+
follow(place: HoverPlace | null): void;
|
|
34
|
+
stop(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Show a satellite's name, and ask for its faint orbit, while a mouse rests on it. One at a time. Leaving fades both; reduced motion takes them away at once.
|
|
38
|
+
* Nothing is asked of the picture while the pointer is still.
|
|
39
|
+
*/
|
|
40
|
+
export declare function bindSatelliteHover(host: SatelliteHoverHost): SatelliteHover;
|
|
41
|
+
/** A blank custom property is the default. `Number("")` is 0, which would hide the orbit. */
|
|
42
|
+
export declare const hoverOpacityOf: (text: string) => number;
|
|
43
|
+
/** Colour and opacity from the element's own custom properties, or the faint orbit's own. */
|
|
44
|
+
export declare function hoverStyleOf(element: HTMLElement): {
|
|
45
|
+
color: string;
|
|
46
|
+
opacity: number;
|
|
47
|
+
};
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { prefersLessMotion } from "../meteors/note.js";
|
|
2
|
+
import { fadeLeft, HOVER_PATH_OPACITY } from "./satellite-layer.js";
|
|
3
|
+
/** The faint orbit is on unless `hover-path` is `off`. Left unset, it follows `names-on-hover` (itself on unless `off`). */
|
|
4
|
+
export const hoverPathOn = (path, names) => (path === "off" ? false : path !== null ? true : names !== "off");
|
|
5
|
+
/** A name is shown when the pointer rests on a satellite, unless `names-on-hover` is `off`. */
|
|
6
|
+
export const namesOnHover = (value) => value !== "off";
|
|
7
|
+
const same = (a, b) => a !== null && b !== null && a.group === b.group && a.index === b.index;
|
|
8
|
+
/**
|
|
9
|
+
* Show a satellite's name, and ask for its faint orbit, while a mouse rests on it. One at a time. Leaving fades both; reduced motion takes them away at once.
|
|
10
|
+
* Nothing is asked of the picture while the pointer is still.
|
|
11
|
+
*/
|
|
12
|
+
export function bindSatelliteHover(host) {
|
|
13
|
+
let label;
|
|
14
|
+
let leaving = false;
|
|
15
|
+
let timer;
|
|
16
|
+
let queued = false;
|
|
17
|
+
let point = null;
|
|
18
|
+
const clearTimer = () => {
|
|
19
|
+
if (timer !== undefined)
|
|
20
|
+
clearTimeout(timer);
|
|
21
|
+
timer = undefined;
|
|
22
|
+
};
|
|
23
|
+
const hideName = (now) => {
|
|
24
|
+
if (!label)
|
|
25
|
+
return;
|
|
26
|
+
label.style.opacity = "0";
|
|
27
|
+
if (now || prefersLessMotion())
|
|
28
|
+
label.hidden = true;
|
|
29
|
+
};
|
|
30
|
+
const showName = (ref, place) => {
|
|
31
|
+
const box = host.labelParent();
|
|
32
|
+
const naming = host.namesOn() && ref && place && place.visible && !same(ref, host.selected()) ? ref : null;
|
|
33
|
+
if (!box || !naming || !place) {
|
|
34
|
+
hideName(true);
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (!label) {
|
|
38
|
+
label = box.ownerDocument.createElement("div");
|
|
39
|
+
label.className = "sp-sat";
|
|
40
|
+
label.dataset["hover"] = "true";
|
|
41
|
+
box.append(label);
|
|
42
|
+
}
|
|
43
|
+
const text = host.name(naming) ?? "";
|
|
44
|
+
if (label.textContent !== text)
|
|
45
|
+
label.textContent = text;
|
|
46
|
+
label.hidden = text === "";
|
|
47
|
+
label.style.opacity = "1";
|
|
48
|
+
label.style.transform = `translate(${Math.round(place.x + 10)}px,${Math.round(place.y - 8)}px)`;
|
|
49
|
+
};
|
|
50
|
+
const apply = () => {
|
|
51
|
+
queued = false;
|
|
52
|
+
if (!point)
|
|
53
|
+
return;
|
|
54
|
+
if (point.x < 0)
|
|
55
|
+
return;
|
|
56
|
+
const ref = host.pathOn() || host.namesOn() ? host.pick(point.x, point.y) : null;
|
|
57
|
+
const hover = host.state.hover;
|
|
58
|
+
const path = host.pathOn() ? ref : null;
|
|
59
|
+
if (!path && (hover.ref || hover.fade > 0)) {
|
|
60
|
+
leave();
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
if (same(path, hover.ref) && hover.fade === 1 && hover.enabled === host.pathOn()) {
|
|
64
|
+
showName(ref, ref ? host.place(ref) : null);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
clearTimer();
|
|
68
|
+
leaving = false;
|
|
69
|
+
const look = host.style();
|
|
70
|
+
hover.color = look.color;
|
|
71
|
+
hover.opacity = look.opacity;
|
|
72
|
+
hover.enabled = host.pathOn();
|
|
73
|
+
hover.ref = path;
|
|
74
|
+
hover.fade = path ? 1 : 0;
|
|
75
|
+
showName(ref, ref ? host.place(ref) : null);
|
|
76
|
+
host.request();
|
|
77
|
+
};
|
|
78
|
+
const queue = (x, y) => {
|
|
79
|
+
point = { x, y };
|
|
80
|
+
if (queued)
|
|
81
|
+
return;
|
|
82
|
+
queued = true;
|
|
83
|
+
host.element.ownerDocument.defaultView?.requestAnimationFrame(apply);
|
|
84
|
+
};
|
|
85
|
+
const leave = () => {
|
|
86
|
+
point = null;
|
|
87
|
+
const hover = host.state.hover;
|
|
88
|
+
if (!hover.ref && hover.fade === 0) {
|
|
89
|
+
hideName(true);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
clearTimer();
|
|
93
|
+
if (prefersLessMotion()) {
|
|
94
|
+
leaving = false;
|
|
95
|
+
hover.ref = null;
|
|
96
|
+
hover.fade = 0;
|
|
97
|
+
hideName(true);
|
|
98
|
+
host.request();
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
leaving = true;
|
|
102
|
+
const from = hover.fade;
|
|
103
|
+
const started = performance.now();
|
|
104
|
+
hideName(false);
|
|
105
|
+
const step = () => {
|
|
106
|
+
const left = fadeLeft(performance.now() - started, from);
|
|
107
|
+
hover.fade = left;
|
|
108
|
+
host.request();
|
|
109
|
+
if (left > 0)
|
|
110
|
+
timer = setTimeout(step, 32);
|
|
111
|
+
else {
|
|
112
|
+
hover.ref = null;
|
|
113
|
+
hover.fade = 0;
|
|
114
|
+
leaving = false;
|
|
115
|
+
hideName(true);
|
|
116
|
+
host.request();
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
step();
|
|
120
|
+
};
|
|
121
|
+
const move = (event) => {
|
|
122
|
+
if (event.pointerType === "touch" || event.buttons !== 0)
|
|
123
|
+
return;
|
|
124
|
+
const rect = host.element.getBoundingClientRect();
|
|
125
|
+
queue(event.clientX - rect.left, event.clientY - rect.top);
|
|
126
|
+
};
|
|
127
|
+
const down = (event) => {
|
|
128
|
+
if (event.pointerType === "touch")
|
|
129
|
+
return;
|
|
130
|
+
leave();
|
|
131
|
+
};
|
|
132
|
+
host.element.addEventListener("pointermove", move);
|
|
133
|
+
host.element.addEventListener("pointerdown", down);
|
|
134
|
+
host.element.addEventListener("pointerleave", leave);
|
|
135
|
+
host.element.addEventListener("pointercancel", leave);
|
|
136
|
+
return {
|
|
137
|
+
sync() {
|
|
138
|
+
const on = host.pathOn();
|
|
139
|
+
const hover = host.state.hover;
|
|
140
|
+
const look = host.style();
|
|
141
|
+
hover.color = look.color;
|
|
142
|
+
hover.opacity = look.opacity;
|
|
143
|
+
if (hover.enabled === on)
|
|
144
|
+
return;
|
|
145
|
+
hover.enabled = on;
|
|
146
|
+
if (!on) {
|
|
147
|
+
clearTimer();
|
|
148
|
+
leaving = false;
|
|
149
|
+
hover.ref = null;
|
|
150
|
+
hover.fade = 0;
|
|
151
|
+
hideName(!host.namesOn());
|
|
152
|
+
}
|
|
153
|
+
host.request();
|
|
154
|
+
},
|
|
155
|
+
follow(place) {
|
|
156
|
+
if (leaving || !host.state.hover.ref)
|
|
157
|
+
return;
|
|
158
|
+
showName(host.state.hover.ref, place);
|
|
159
|
+
},
|
|
160
|
+
stop() {
|
|
161
|
+
clearTimer();
|
|
162
|
+
host.element.removeEventListener("pointermove", move);
|
|
163
|
+
host.element.removeEventListener("pointerdown", down);
|
|
164
|
+
host.element.removeEventListener("pointerleave", leave);
|
|
165
|
+
host.element.removeEventListener("pointercancel", leave);
|
|
166
|
+
label?.remove();
|
|
167
|
+
label = undefined;
|
|
168
|
+
host.state.hover.ref = null;
|
|
169
|
+
host.state.hover.fade = 0;
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
}
|
|
173
|
+
/** A blank custom property is the default. `Number("")` is 0, which would hide the orbit. */
|
|
174
|
+
export const hoverOpacityOf = (text) => {
|
|
175
|
+
const raw = text.trim() === "" ? Number.NaN : Number(text);
|
|
176
|
+
return Number.isFinite(raw) && raw >= 0 && raw <= 1 ? raw : HOVER_PATH_OPACITY;
|
|
177
|
+
};
|
|
178
|
+
/** Colour and opacity from the element's own custom properties, or the faint orbit's own. */
|
|
179
|
+
export function hoverStyleOf(element) {
|
|
180
|
+
const css = element.ownerDocument.defaultView?.getComputedStyle(element);
|
|
181
|
+
const color = css?.getPropertyValue("--chikyu-hover-path").trim() || "#ffffff";
|
|
182
|
+
return { color, opacity: hoverOpacityOf(css?.getPropertyValue("--chikyu-hover-path-opacity") ?? "") };
|
|
183
|
+
}
|
|
@@ -28,6 +28,17 @@ export interface SatelliteState {
|
|
|
28
28
|
orbitTint: boolean;
|
|
29
29
|
/** One group shown on its own. `null` leaves every group as the page set it. */
|
|
30
30
|
focus: SatelliteFocus | null;
|
|
31
|
+
/**
|
|
32
|
+
* The satellite the pointer rests on, and the faint orbit drawn for it. `fade` is 1 while the pointer rests and falls to 0 after it leaves.
|
|
33
|
+
* `enabled` is off when the page turns the faint orbit off. The path is computed once per satellite, from the elements already loaded.
|
|
34
|
+
*/
|
|
35
|
+
hover: {
|
|
36
|
+
ref: SatelliteRef | null;
|
|
37
|
+
fade: number;
|
|
38
|
+
enabled: boolean;
|
|
39
|
+
color: string;
|
|
40
|
+
opacity: number;
|
|
41
|
+
};
|
|
31
42
|
/**
|
|
32
43
|
* The pixel ceiling of a streak's length on the screen above the interpolation limit, in CSS pixels at the Earth's own distance (`satellite-streak-max`). A streak is also never longer than {@link STREAK_REACH} Earth radii, so it shrinks with the Earth.
|
|
33
44
|
* 0 draws the whole stretch one frame spans, however long that is.
|
|
@@ -50,6 +61,9 @@ export interface SatelliteState {
|
|
|
50
61
|
updates: number;
|
|
51
62
|
totalMs: number;
|
|
52
63
|
selectedRing: boolean;
|
|
64
|
+
hoverPath: boolean;
|
|
65
|
+
hoverOpacity: number;
|
|
66
|
+
selectedOpacity: number;
|
|
53
67
|
};
|
|
54
68
|
}
|
|
55
69
|
/**
|
|
@@ -82,6 +96,20 @@ export declare function longestStreak(segments: Float32Array, count: number, ear
|
|
|
82
96
|
export declare const newSatelliteState: () => SatelliteState;
|
|
83
97
|
/** The most orbits a group may draw all at once, one line each. */
|
|
84
98
|
export declare const MAX_ORBIT_GROUP = 40;
|
|
99
|
+
/** How bright the chosen satellite's orbit is. The orbit under the pointer is about a third of this, so the two are told apart at a glance. */
|
|
100
|
+
export declare const SELECTED_PATH_OPACITY = 0.85;
|
|
101
|
+
/** The orbit under the pointer, before it fades. A page may set another with `--chikyu-hover-path-opacity`. */
|
|
102
|
+
export declare const HOVER_PATH_OPACITY: number;
|
|
103
|
+
/** How long the faint orbit takes to go after the pointer leaves, in milliseconds. Reduced motion takes it away at once. */
|
|
104
|
+
export declare const HOVER_FADE_MS = 180;
|
|
105
|
+
/**
|
|
106
|
+
* How much of the faint orbit is left `elapsedMs` into its fade, from `from` (1 while the pointer rests) down to 0.
|
|
107
|
+
*
|
|
108
|
+
* @param elapsedMs - Milliseconds since the pointer left.
|
|
109
|
+
* @param from - The opacity share when the fade began, 0 to 1.
|
|
110
|
+
* @returns The share still drawn, 0 when the fade is over.
|
|
111
|
+
*/
|
|
112
|
+
export declare const fadeLeft: (elapsedMs: number, from: number) => number;
|
|
85
113
|
/** How long, in milliseconds of wall time, a satellite's place is kept before SGP4 places it again when the clock is too fast to interpolate: about once a second. */
|
|
86
114
|
export declare const PIN_PERIOD_MS = 1000;
|
|
87
115
|
/**
|
|
@@ -127,7 +155,32 @@ export declare function screenEdge(x: number, y: number, width: number, height:
|
|
|
127
155
|
*/
|
|
128
156
|
export declare function edgeBeyondCamera(x: number, y: number): ScreenEdge;
|
|
129
157
|
/**
|
|
130
|
-
*
|
|
158
|
+
* Whether the Earth hides a satellite. The Earth is the unit sphere at the origin. True when the line from the camera to the satellite meets that sphere before it arrives. A graze at the limb is not hidden (the line only touches the sphere), and neither is a satellite in front of the Earth. This is not the test for a satellite behind the camera.
|
|
159
|
+
*
|
|
160
|
+
* @param camera - The camera, in the same units as the sphere (Earth radii).
|
|
161
|
+
* @param satellite - The satellite, in those units.
|
|
162
|
+
* @returns True when the globe is in the way.
|
|
163
|
+
*
|
|
164
|
+
* @example
|
|
165
|
+
* ```ts
|
|
166
|
+
* import { earthHides } from "@johnmorrisdotca/chikyu-earth/space";
|
|
167
|
+
*
|
|
168
|
+
* const camera = { x: 0, y: 0, z: 4 };
|
|
169
|
+
* console.log(earthHides(camera, { x: 0, y: 0, z: 1.2 }));
|
|
170
|
+
* console.log(earthHides(camera, { x: 0, y: 0, z: -1.2 }));
|
|
171
|
+
* ```
|
|
172
|
+
*/
|
|
173
|
+
export declare function earthHides(camera: {
|
|
174
|
+
x: number;
|
|
175
|
+
y: number;
|
|
176
|
+
z: number;
|
|
177
|
+
}, satellite: {
|
|
178
|
+
x: number;
|
|
179
|
+
y: number;
|
|
180
|
+
z: number;
|
|
181
|
+
}): boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Where a satellite is on the screen now: in CSS pixels from the view's top left (which may lie outside the box), whether it can be seen, which edge it lies beyond, whether it is behind the camera, whether the Earth hides it, and how high it is.
|
|
131
184
|
*
|
|
132
185
|
* @example
|
|
133
186
|
* ```ts
|
|
@@ -148,6 +201,8 @@ export interface SatelliteScreen {
|
|
|
148
201
|
edge: ScreenEdge | null;
|
|
149
202
|
/** The satellite is behind the camera. The picture would put it on the opposite side, so `edge` is taken from the camera's own axes. */
|
|
150
203
|
behind: boolean;
|
|
204
|
+
/** The Earth hides the satellite: the line from the camera meets the globe before the satellite. False at the limb, in front, and when the satellite is only behind the camera. */
|
|
205
|
+
occluded: boolean;
|
|
151
206
|
}
|
|
152
207
|
export interface SatelliteLayer {
|
|
153
208
|
/** Where one satellite of a shown group is on the screen as of the last update, or `null` when its group is not shown or it is not placed (its elements are too old). A satellite outside the picture or behind the camera is still returned, with `visible` false. */
|
|
@@ -54,10 +54,24 @@ export function longestStreak(segments, count, earthPx) {
|
|
|
54
54
|
}
|
|
55
55
|
return longest * earthPx;
|
|
56
56
|
}
|
|
57
|
-
export const newSatelliteState = () => ({ groups: new Map(), selected: null, marked: new Set(), pinned: [], orbitTint: false, focus: null, modelOver: null, streakMax: DEFAULT_STREAK_MAX, drawn: { placed: 0, segments: 0, tooFast: false, dotScale: 1, longestStreakPx: 0, streakCapPx: 0, weight: 1, fade: 1, earthPx: 0, updateMs: 0, maxUpdateMs: 0, updates: 0, totalMs: 0, selectedRing: false } });
|
|
57
|
+
export const newSatelliteState = () => ({ groups: new Map(), selected: null, marked: new Set(), pinned: [], orbitTint: false, focus: null, modelOver: null, hover: { ref: null, fade: 0, enabled: true, color: "#ffffff", opacity: HOVER_PATH_OPACITY }, streakMax: DEFAULT_STREAK_MAX, drawn: { placed: 0, segments: 0, tooFast: false, dotScale: 1, longestStreakPx: 0, streakCapPx: 0, weight: 1, fade: 1, earthPx: 0, updateMs: 0, maxUpdateMs: 0, updates: 0, totalMs: 0, selectedRing: false, hoverPath: false, hoverOpacity: 0, selectedOpacity: 0 } });
|
|
58
58
|
/** The most orbits a group may draw all at once, one line each. */
|
|
59
59
|
export const MAX_ORBIT_GROUP = 40;
|
|
60
60
|
const ORBIT_POINTS = 120;
|
|
61
|
+
/** How bright the chosen satellite's orbit is. The orbit under the pointer is about a third of this, so the two are told apart at a glance. */
|
|
62
|
+
export const SELECTED_PATH_OPACITY = 0.85;
|
|
63
|
+
/** The orbit under the pointer, before it fades. A page may set another with `--chikyu-hover-path-opacity`. */
|
|
64
|
+
export const HOVER_PATH_OPACITY = SELECTED_PATH_OPACITY / 3;
|
|
65
|
+
/** How long the faint orbit takes to go after the pointer leaves, in milliseconds. Reduced motion takes it away at once. */
|
|
66
|
+
export const HOVER_FADE_MS = 180;
|
|
67
|
+
/**
|
|
68
|
+
* How much of the faint orbit is left `elapsedMs` into its fade, from `from` (1 while the pointer rests) down to 0.
|
|
69
|
+
*
|
|
70
|
+
* @param elapsedMs - Milliseconds since the pointer left.
|
|
71
|
+
* @param from - The opacity share when the fade began, 0 to 1.
|
|
72
|
+
* @returns The share still drawn, 0 when the fade is over.
|
|
73
|
+
*/
|
|
74
|
+
export const fadeLeft = (elapsedMs, from) => from * (1 - Math.min(1, Math.max(0, elapsedMs) / HOVER_FADE_MS));
|
|
61
75
|
const ORBIT_REFRESH_GAME_MS = 30 * 60_000;
|
|
62
76
|
const ORBIT_REFRESH_WALL_MS = 1000;
|
|
63
77
|
const POINT_VERT = /* glsl */ `
|
|
@@ -160,6 +174,37 @@ export function edgeBeyondCamera(x, y) {
|
|
|
160
174
|
return x < 0 ? "left" : "right";
|
|
161
175
|
return y >= 0 ? "top" : "bottom";
|
|
162
176
|
}
|
|
177
|
+
/**
|
|
178
|
+
* Whether the Earth hides a satellite. The Earth is the unit sphere at the origin. True when the line from the camera to the satellite meets that sphere before it arrives. A graze at the limb is not hidden (the line only touches the sphere), and neither is a satellite in front of the Earth. This is not the test for a satellite behind the camera.
|
|
179
|
+
*
|
|
180
|
+
* @param camera - The camera, in the same units as the sphere (Earth radii).
|
|
181
|
+
* @param satellite - The satellite, in those units.
|
|
182
|
+
* @returns True when the globe is in the way.
|
|
183
|
+
*
|
|
184
|
+
* @example
|
|
185
|
+
* ```ts
|
|
186
|
+
* import { earthHides } from "@johnmorrisdotca/chikyu-earth/space";
|
|
187
|
+
*
|
|
188
|
+
* const camera = { x: 0, y: 0, z: 4 };
|
|
189
|
+
* console.log(earthHides(camera, { x: 0, y: 0, z: 1.2 }));
|
|
190
|
+
* console.log(earthHides(camera, { x: 0, y: 0, z: -1.2 }));
|
|
191
|
+
* ```
|
|
192
|
+
*/
|
|
193
|
+
export function earthHides(camera, satellite) {
|
|
194
|
+
const px = satellite.x - camera.x;
|
|
195
|
+
const py = satellite.y - camera.y;
|
|
196
|
+
const pz = satellite.z - camera.z;
|
|
197
|
+
const len2 = px * px + py * py + pz * pz;
|
|
198
|
+
if (!(len2 > 0))
|
|
199
|
+
return false;
|
|
200
|
+
const t = Math.max(0, Math.min(1, -(camera.x * px + camera.y * py + camera.z * pz) / len2));
|
|
201
|
+
const nx = camera.x + px * t;
|
|
202
|
+
const ny = camera.y + py * t;
|
|
203
|
+
const nz = camera.z + pz * t;
|
|
204
|
+
return nx * nx + ny * ny + nz * nz < 0.998;
|
|
205
|
+
}
|
|
206
|
+
/** An orthographic view: the satellite is behind the Earth's disc when it is further than the centre and inside the disc. A graze at the limb (just inside radius 1) is not hidden. */
|
|
207
|
+
const earthHidesDisc = (right, up, depth, centreDepth) => depth < centreDepth && right * right + up * up < 0.996;
|
|
163
208
|
export function createSatelliteLayer(three, scene, state, ratio) {
|
|
164
209
|
if (!three.Points)
|
|
165
210
|
throw new Error("Satellites need `Points` from three.js: add it to the parts the three loader hands over (see setThreeLoader)");
|
|
@@ -192,7 +237,17 @@ export function createSatelliteLayer(three, scene, state, ratio) {
|
|
|
192
237
|
selectedPoints.renderOrder = 6;
|
|
193
238
|
selectedPoints.visible = false;
|
|
194
239
|
scene.add(selectedPoints);
|
|
195
|
-
|
|
240
|
+
// One line for the whole life of the layer, rewritten in place: a hover does not make a new buffer. It is about a third as bright as the chosen orbit, so it reads thinner and fainter. WebGL draws a line one pixel wide, and the chosen orbit is left as it is.
|
|
241
|
+
const hoverLine = { positions: new Float32Array(ORBIT_POINTS * 3), geometry: new three.BufferGeometry(), material: new three.LineBasicMaterial({ color: "#ffffff", transparent: true, opacity: HOVER_PATH_OPACITY }) };
|
|
242
|
+
hoverLine.geometry.setAttribute("position", new three.BufferAttribute(hoverLine.positions, 3));
|
|
243
|
+
const hoverLoop = new three.LineLoop(hoverLine.geometry, hoverLine.material);
|
|
244
|
+
hoverLoop.name = "hover-path";
|
|
245
|
+
hoverLoop.frustumCulled = false;
|
|
246
|
+
hoverLoop.visible = false;
|
|
247
|
+
hoverLoop.renderOrder = 4;
|
|
248
|
+
scene.add(hoverLoop);
|
|
249
|
+
let hoverKey = "";
|
|
250
|
+
const selectedLine = { positions: new Float32Array(ORBIT_POINTS * 3), geometry: new three.BufferGeometry(), material: new three.LineBasicMaterial({ color: "#ffffff", transparent: true, opacity: SELECTED_PATH_OPACITY }) };
|
|
196
251
|
selectedLine.geometry.setAttribute("position", new three.BufferAttribute(selectedLine.positions, 3));
|
|
197
252
|
const selectedLoop = new three.LineLoop(selectedLine.geometry, selectedLine.material);
|
|
198
253
|
selectedLoop.frustumCulled = false;
|
|
@@ -438,13 +493,39 @@ export function createSatelliteLayer(three, scene, state, ratio) {
|
|
|
438
493
|
}
|
|
439
494
|
selectedLoop.visible = true;
|
|
440
495
|
selectedMaterial.uniforms["size"].value = 14 * ratio();
|
|
496
|
+
state.drawn.selectedOpacity = selectedLine.material.opacity;
|
|
441
497
|
}
|
|
442
498
|
else {
|
|
443
499
|
selectedPoints.visible = false;
|
|
444
500
|
state.drawn.selectedRing = false;
|
|
445
501
|
selectedLoop.visible = false;
|
|
446
502
|
selectedKey = "";
|
|
503
|
+
state.drawn.selectedOpacity = 0;
|
|
504
|
+
}
|
|
505
|
+
// The faint orbit: one path at a time, computed once from the elements already loaded, hidden while it is the chosen satellite's own orbit.
|
|
506
|
+
const hover = state.hover;
|
|
507
|
+
const hoverRef = hover.enabled && hover.fade > 0 ? hover.ref : null;
|
|
508
|
+
const hoverSet = hoverRef ? find(hoverRef) : undefined;
|
|
509
|
+
const sameAsSelected = Boolean(hoverRef && state.selected && hoverRef.group === state.selected.group && hoverRef.index === state.selected.index);
|
|
510
|
+
const hoverOk = Boolean(hoverRef && hoverSet && !sameAsSelected && hoverRef.index >= 0 && hoverRef.index < hoverSet.count && hoverSet.visible(hoverRef.index));
|
|
511
|
+
if (hoverOk && hoverRef && hoverSet) {
|
|
512
|
+
const key = `${hoverRef.group}:${hoverRef.index}`;
|
|
513
|
+
if (key !== hoverKey) {
|
|
514
|
+
hoverKey = key;
|
|
515
|
+
hoverLine.positions.set(hoverSet.orbit(hoverRef.index, time, ORBIT_POINTS).subarray(0, ORBIT_POINTS * 3));
|
|
516
|
+
hoverLine.geometry.getAttribute("position").needsUpdate = true;
|
|
517
|
+
}
|
|
518
|
+
hoverLine.material.color.set(hover.color || "#ffffff");
|
|
519
|
+
hoverLine.material.opacity = hover.opacity * hover.fade;
|
|
520
|
+
hoverLoop.visible = hoverLine.material.opacity > 0;
|
|
521
|
+
}
|
|
522
|
+
else {
|
|
523
|
+
hoverLoop.visible = false;
|
|
524
|
+
if (!hoverRef)
|
|
525
|
+
hoverKey = "";
|
|
447
526
|
}
|
|
527
|
+
state.drawn.hoverPath = hoverLoop.visible;
|
|
528
|
+
state.drawn.hoverOpacity = hoverLoop.visible ? hoverLine.material.opacity : 0;
|
|
448
529
|
state.drawn.placed = placed;
|
|
449
530
|
state.drawn.segments = segments;
|
|
450
531
|
state.drawn.longestStreakPx = longest;
|
|
@@ -500,22 +581,11 @@ export function createSatelliteLayer(three, scene, state, ratio) {
|
|
|
500
581
|
continue;
|
|
501
582
|
if (ortho) {
|
|
502
583
|
view.copy(world).applyMatrix4(camera.matrixWorldInverse);
|
|
503
|
-
if (view.
|
|
504
|
-
continue;
|
|
505
|
-
}
|
|
506
|
-
else {
|
|
507
|
-
// behind the Earth: the line from the camera to the satellite passes through the unit sphere before it gets there
|
|
508
|
-
const px = world.x - c.x;
|
|
509
|
-
const py = world.y - c.y;
|
|
510
|
-
const pz = world.z - c.z;
|
|
511
|
-
const len2 = px * px + py * py + pz * pz;
|
|
512
|
-
const t = Math.max(0, Math.min(1, -(c.x * px + c.y * py + c.z * pz) / len2));
|
|
513
|
-
const nx = c.x + px * t;
|
|
514
|
-
const ny = c.y + py * t;
|
|
515
|
-
const nz = c.z + pz * t;
|
|
516
|
-
if (nx * nx + ny * ny + nz * nz < 0.998)
|
|
584
|
+
if (earthHidesDisc(view.x, view.y, view.z, centreDepth))
|
|
517
585
|
continue;
|
|
518
586
|
}
|
|
587
|
+
else if (earthHides(c, world))
|
|
588
|
+
continue;
|
|
519
589
|
best = { group: name, index: i };
|
|
520
590
|
bestD = d;
|
|
521
591
|
}
|
|
@@ -557,23 +627,13 @@ export function createSatelliteLayer(three, scene, state, ratio) {
|
|
|
557
627
|
const up = view.y;
|
|
558
628
|
const depth = view.z;
|
|
559
629
|
const centreDepth = world.set(0, 0, 0).applyMatrix4(camera.matrixWorldInverse).z;
|
|
560
|
-
hidden =
|
|
630
|
+
hidden = earthHidesDisc(right, up, depth, centreDepth);
|
|
561
631
|
world.set(p[i], p[i + 1], p[i + 2]).applyMatrix4(scene.matrixWorld);
|
|
562
632
|
}
|
|
563
|
-
else
|
|
564
|
-
|
|
565
|
-
const px = world.x - c.x;
|
|
566
|
-
const py = world.y - c.y;
|
|
567
|
-
const pz = world.z - c.z;
|
|
568
|
-
const len2 = px * px + py * py + pz * pz;
|
|
569
|
-
const t = Math.max(0, Math.min(1, -(c.x * px + c.y * py + c.z * pz) / len2));
|
|
570
|
-
const nx = c.x + px * t;
|
|
571
|
-
const ny = c.y + py * t;
|
|
572
|
-
const nz = c.z + pz * t;
|
|
573
|
-
hidden = nx * nx + ny * ny + nz * nz < 0.998;
|
|
574
|
-
}
|
|
633
|
+
else
|
|
634
|
+
hidden = earthHides(c, world);
|
|
575
635
|
}
|
|
576
|
-
return { x, y, visible: !behind && !hidden && edge === null, heightKm, edge, behind };
|
|
636
|
+
return { x, y, visible: !behind && !hidden && edge === null, heightKm, edge, behind, occluded: hidden };
|
|
577
637
|
},
|
|
578
638
|
place(camera, size) {
|
|
579
639
|
if (!selectedPoints.visible)
|
|
@@ -590,11 +650,13 @@ export function createSatelliteLayer(three, scene, state, ratio) {
|
|
|
590
650
|
for (const entry of drawn.values())
|
|
591
651
|
drop(entry);
|
|
592
652
|
drawn.clear();
|
|
593
|
-
scene.remove(selectedPoints, selectedLoop);
|
|
653
|
+
scene.remove(selectedPoints, selectedLoop, hoverLoop);
|
|
594
654
|
selectedGeometry.dispose();
|
|
595
655
|
selectedMaterial.dispose();
|
|
596
656
|
selectedLine.geometry.dispose();
|
|
597
657
|
selectedLine.material.dispose();
|
|
658
|
+
hoverLine.geometry.dispose();
|
|
659
|
+
hoverLine.material.dispose();
|
|
598
660
|
},
|
|
599
661
|
};
|
|
600
662
|
}
|
|
@@ -154,6 +154,7 @@ export declare const MODEL_HANDOVER_PX = 10;
|
|
|
154
154
|
* Pure, so a test can ask it at any height.
|
|
155
155
|
*
|
|
156
156
|
* @param distanceKm - The camera's distance from the satellite, in kilometres.
|
|
157
|
+
* @param lowest - The share at the lowest height, `ABOVE_MODEL_SHARE` by default (a page sets it with `ride-model-share`).
|
|
157
158
|
* @returns The share, from 0 to 0.17.
|
|
158
159
|
*
|
|
159
160
|
* @example
|
|
@@ -163,4 +164,4 @@ export declare const MODEL_HANDOVER_PX = 10;
|
|
|
163
164
|
* console.log(aboveModelShare(150), aboveModelShare(1000) < aboveModelShare(150), aboveModelShare(6000));
|
|
164
165
|
* ```
|
|
165
166
|
*/
|
|
166
|
-
export declare function aboveModelShare(distanceKm: number): number;
|
|
167
|
+
export declare function aboveModelShare(distanceKm: number, lowest?: number): number;
|