@johnmorrisdotca/chikyu-earth 0.61.0 → 0.63.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 +22 -0
- package/README.md +3 -3
- package/dist/realistic/cloud-fade.d.ts +22 -0
- package/dist/realistic/cloud-fade.js +44 -0
- package/dist/realistic/earth.d.ts +3 -0
- package/dist/realistic/earth.js +6 -1
- package/dist/realistic/element-base.d.ts +2 -0
- package/dist/realistic/element-base.js +8 -1
- package/dist/realistic/shaders.d.ts +1 -1
- package/dist/realistic/shaders.js +10 -0
- package/dist/space/element-base.d.ts +92 -4
- package/dist/space/element-base.js +220 -33
- package/dist/space/fly.d.ts +292 -0
- package/dist/space/fly.js +293 -0
- package/dist/space/index.d.ts +1 -0
- package/dist/space/index.js +1 -0
- package/dist/space/scene.d.ts +5 -0
- package/dist/space/scene.js +51 -5
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,27 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
## 0.63.0 - 2026-11-19
|
|
6
|
+
|
|
7
|
+
- **The view above a satellite has no facings, and a ride's camera never goes under the ground** (MODULES-1685).
|
|
8
|
+
- **Above.** `face()` in a ride with `view: "above"` returns `false` and leaves the camera as it was, and a `face` in `ride`'s options is left out there (`riding.face` is `null`). A facing there used to put the camera beside the satellite looking along the ground with the top of the picture (`aboveAxes`) along the line of sight, so three.js's `lookAt` had no way to turn the camera and took one from rounding, a different one each draw: the picture turned by up to 176 degrees between two reads and never settled. `up` put the camera under the satellite, inside the Earth (2,575 km under the ground for the ISS at the default 3,000 km).
|
|
9
|
+
- **Following a satellite** (`view: "follow"`) keeps its facings, and they now settle: along the ground (ahead, behind, left, right) the top of the picture is the sky, square to the line of sight.
|
|
10
|
+
- **Never under the ground.** In every view, facing, drag and glide the camera is held at least 1 km above the ground, and the near plane comes in when it is. A camera that looks at a satellite comes in towards it along its line of sight, so the satellite stays in its place in the picture; any other moves out along its line from the Earth's centre. The cases: a satellite that has come down, a camera following one from the far side of the Earth (it was 90 km under the ground in the test), a facing that would put it under the satellite, the straight line of a glide.
|
|
11
|
+
- **Tests.** `e2e/ride-steady.gl.ts`: above, each facing is refused and the camera holds its look; for every view and facing the camera stays above the ground; from the satellite and following it, every facing turns the camera and it holds still to under half a degree a second. They fail on 0.62.0. The ride guide in English and Japanese, `docs/ride-along.md` and the README.
|
|
12
|
+
|
|
13
|
+
## 0.62.0 - 2026-11-19
|
|
14
|
+
|
|
15
|
+
- **A fly-to on the space view, and moves that bend instead of stopping** (MODULES-1582).
|
|
16
|
+
- **`flyTo(lat, lon, { height, phase, smooth, signal })`** on `<chikyu-space>`: across, the Earth turns under the camera at the height it has until the place is below (a great circle, eased), then down to `height` km over it (30 by default, never under 15). `phase` is `across`, `down` or `both`. It resolves to `FlyEnd` (`arrived`, `redirected` or `stopped`, the place, the height then and what held the descent) and sends `chikyu-fly-start` and `chikyu-fly-end`; `stats.fly` says what it is doing. The controls' own turn is paused for it.
|
|
17
|
+
- **A new move bends the running one.** A `flyTo` or `goToPlace` while a move is going starts with the camera's own speed and acceleration and curves to the new place, so the speed and the way it goes are continuous (no stop, no jump); a descent cut short slows to rest without turning back. The realistic Earth's `goToPlace` is unchanged.
|
|
18
|
+
- **A hand ends it where it is**: a drag, pinch, wheel or key (from the element's own hands or a bound bar), or the `signal`. Reduced motion, `smooth: false` or a picture not live yet jumps there.
|
|
19
|
+
- **The floor.** The descent comes all the way down only with `tiles-finer` over land from 60 degrees south to 80 degrees north (the place is looked up in the 1:110m outlines, loaded only then); elsewhere it stops at 400 km (`FLY_FLOOR_KM`, the height the package's own pictures stay sharp, as the site's ride-above floor), and at a `zoom-max` the page set. Below about 320 km the look camera's nearest distance and near plane follow the descent, and the zoom limit is raised under the page's own; a page that never calls `flyTo` draws as before.
|
|
20
|
+
- **Pure parts** in `/space`: `planFly`, `flyAt`, `flyStateAt`, `flyStill`, `flyAim`, `flyLonLat`, `flyAcrossMs`, `flyDownMs`, `flyDistance`, `descentFloorKm` and the `FLY_*` constants, with unit tests (a redirect mid-turn and mid-descent: the speed carries across within 1 per cent, no step stops or jumps, the height never turns back); `e2e/fly.gl.ts` (the same in a real browser, a drag and a signal ending a move, reduced motion jumping 30 km over Tokyo and holding at 400 km over the sea) and a freeze check (one frame at a time, nothing at rest after). The places guide in English and Japanese.
|
|
21
|
+
- **Not yet:** the next tile level is not fetched ahead of the descent; the tiles load as the camera comes down, as they do for a zoom.
|
|
22
|
+
|
|
23
|
+
- **The clouds fade out when the view is close, so the sharp ground shows** (MODULES-1356). The cloud layer is one whole-Earth picture at most 2048 pixels across (about 20 km a texel) drawn over the ground, so from a few hundred kilometres up it blurred the finer tiles under it (a satellite ride's Below step, 486 km up, showed it). Its strength now goes from 1 to 0 as a texel grows from 8 to 32 device pixels wide, worked out from the pixel scale the map tiles use. Both `<chikyu-earth-realistic>` and `<chikyu-space>` do it; the space view does it for each point of the clouds by its own distance from the camera, so the ground under the camera goes sharp and the far ground and the horizon keep their clouds. `cloud-fade="16"` sets the width at which the clouds are gone (32 when left out, 1 to 1000), `cloud-fade="off"` (or `0`) keeps them at any zoom, and `stats.cloudFade` says how much is shown at the nearest ground (the space view) or over the disc (the realistic Earth). Nothing is drawn at rest. A unit test, `e2e/cloud-fade.gl.ts` on both elements, and the earth-tiles guide in English and Japanese.
|
|
24
|
+
|
|
3
25
|
## 0.61.0 - 2026-11-18
|
|
4
26
|
|
|
5
27
|
- **Places get a press event, a size and look each, layers, and names that give way to cities** (MODULES-1578). All of it is optional and a page that uses none of it draws as before.
|
package/README.md
CHANGED
|
@@ -252,7 +252,7 @@ console.log(bodyLabelText("en"), bodyLabelText("ja"), BODY_LABEL_ATTRIBUTES.leng
|
|
|
252
252
|
|
|
253
253
|
`route` on `<chikyu-earth>`, `<chikyu-earth-realistic>` and `<chikyu-space>` draws the line between two places (`lon,lat,lon,lat`). `routeInfo` gives the accurate distance on the Earth's real shape, the great-circle distance, the bearings and a flight time at 900 km/h. The line is off until it is set, and nothing is drawn at rest: [guide](docs/guides/routes.md).
|
|
254
254
|
|
|
255
|
-
`places` on `<chikyu-space>` and `<chikyu-earth-realistic>` marks places on the Earth, each a beam, a pin or a ring (`places-look`) standing out of the ground, turning with the Earth, hidden on its far side and dimmer at night: `kind: "here"` for the reader's own place (brighter, with a quiet pulse) and favourites, quieter, each with an optional `color`. Up to 5,000: the first 32 in sight stand up with their names, the rest are rings in one draw call, crowds are gathered with their count, and `goToPlace(id)` turns the view to one. Names never overlap; nothing is drawn at rest. Each place can have a `layer` (switched with `place-layers`), a `size` or `look` of its own and a `namePriority`, so a harbour is a short mark and its name gives way to a city's; a press on a place sends `chikyu-place-click` with its `id` and `kind`. `here-city` (off by default) names a `here` place with the nearest city within 100 km, in the page's language; kuni is loaded only then. The package never asks for the reader's place and stores or sends nothing: the page asks on a press and rounds the place with `nearby` first: [guide](docs/guides/places.md).
|
|
255
|
+
`places` on `<chikyu-space>` and `<chikyu-earth-realistic>` marks places on the Earth, each a beam, a pin or a ring (`places-look`) standing out of the ground, turning with the Earth, hidden on its far side and dimmer at night: `kind: "here"` for the reader's own place (brighter, with a quiet pulse) and favourites, quieter, each with an optional `color`. Up to 5,000: the first 32 in sight stand up with their names, the rest are rings in one draw call, crowds are gathered with their count, and `goToPlace(id)` turns the view to one. In the space view `flyTo(lat, lon, { height, phase })` goes across at the height the camera has, then down to hover over the place (30 km over land with `tiles-finer`, else 400 km); a new `flyTo` or `goToPlace` bends the running move without stopping it, a hand ends it where it is, and reduced motion jumps there. Names never overlap; nothing is drawn at rest. Each place can have a `layer` (switched with `place-layers`), a `size` or `look` of its own and a `namePriority`, so a harbour is a short mark and its name gives way to a city's; a press on a place sends `chikyu-place-click` with its `id` and `kind`. `here-city` (off by default) names a `here` place with the nearest city within 100 km, in the page's language; kuni is loaded only then. The package never asks for the reader's place and stores or sends nothing: the page asks on a press and rounds the place with `nearby` first: [guide](docs/guides/places.md).
|
|
256
256
|
|
|
257
257
|
```html
|
|
258
258
|
<chikyu-space places='[{"id":"me","lon":-79.4,"lat":43.7,"label":"You are here","kind":"here"}]'></chikyu-space>
|
|
@@ -359,7 +359,7 @@ Passes are only as good as the orbit data are new: each pass says how old its el
|
|
|
359
359
|
<p align="center"><img alt="Riding along with the ISS, tipped towards the horizon: the Earth's curve and atmosphere, and the orbits of the other stations in the sky" src="docs/images/space-ride-horizon.png" width="420"></p>
|
|
360
360
|
|
|
361
361
|
`space.ride({ group: "stations", index: 0 }, { look: "horizon" })` puts the camera on the ISS (or a Starlink satellite, the Moon, a planet) at its real place for the moment shown and looks at the Earth, which goes by beneath
|
|
362
|
-
as the body moves along its orbit; switch to another body and the camera glides there. Straight down or toward the horizon, from the body or following it at a distance, time faster or slower. A ridden satellite is in the picture by default (the camera a little behind and above it, a small drawing of it where the page has no model, not to scale); `ride-viewpoint="inside"` (property `rideViewpoint`, option `viewpoint`) puts the camera at the satellite instead. A drag turns the view where the camera is, like turning your head (the satellite leaves the picture as you look away); `ride-drag="orbit"` (property `rideDrag`, option `drag`) takes the camera round the satellite as before. Seen from above, the model shrinks as the ride rises and hands over to the ordinary mark by 2,000 km; `ride-model-size="fixed"` (property `rideModelSize`, option `modelSize`) keeps one size at every height. `ride-up="north"` (property `rideUp`, option `up`) puts north at the top of the view above a satellite, so it is seen to go the way it really goes; a small compass on a ride shows north and the heading (`compass="off"` hides it), `rideTrack` and `chikyu-ride-track` give the heading, ground point and whether the Sun lights it, and the chosen orbit is amber in sunlight and blue in the Earth's shadow (`path-light="off"` for one colour). `ride-model-share`, `ride-model-seat` and `ride-zoom` frame and zoom the ridden satellite (properties `rideModelShare`, `rideModelSeat`, `rideZoom`). It animates continuously, so it keeps to the
|
|
362
|
+
as the body moves along its orbit; switch to another body and the camera glides there. Straight down or toward the horizon, from the body or following it at a distance, time faster or slower. A ridden satellite is in the picture by default (the camera a little behind and above it, a small drawing of it where the page has no model, not to scale); `ride-viewpoint="inside"` (property `rideViewpoint`, option `viewpoint`) puts the camera at the satellite instead. A drag turns the view where the camera is, like turning your head (the satellite leaves the picture as you look away); `ride-drag="orbit"` (property `rideDrag`, option `drag`) takes the camera round the satellite as before. Seen from above, the model shrinks as the ride rises and hands over to the ordinary mark by 2,000 km; `ride-model-size="fixed"` (property `rideModelSize`, option `modelSize`) keeps one size at every height. `ride-up="north"` (property `rideUp`, option `up`) puts north at the top of the view above a satellite, so it is seen to go the way it really goes; a small compass on a ride shows north and the heading (`compass="off"` hides it), `rideTrack` and `chikyu-ride-track` give the heading, ground point and whether the Sun lights it, and the chosen orbit is amber in sunlight and blue in the Earth's shadow (`path-light="off"` for one colour). `ride-model-share`, `ride-model-seat` and `ride-zoom` frame and zoom the ridden satellite (properties `rideModelShare`, `rideModelSeat`, `rideZoom`). `face("ahead")` (behind, left, right, down, up; the keys W, S, A, D, F, R) turns a ride from the satellite or following it that way; the view above a satellite looks down on it and has no facings, so there `face()` returns `false` and the camera stays as it was. In every view the camera is never under the ground: it is held at least 1 km above it. It animates continuously, so it keeps to the
|
|
363
363
|
same budget: at most 30 frames a second (one a second for reduced motion), nothing drawn while paused, out of sight or hidden. [Ride along guide](docs/guides/ride-along.md), [docs/ride-along.md](docs/ride-along.md).
|
|
364
364
|
|
|
365
365
|
## Printable sheets
|
|
@@ -615,7 +615,7 @@ console.log(countryList().filter((country) => country.alpha2 === null).map((coun
|
|
|
615
615
|
|
|
616
616
|
## How to cite
|
|
617
617
|
|
|
618
|
-
> Morris, J. (2026). *Chikyu Earth* (version 0.
|
|
618
|
+
> Morris, J. (2026). *Chikyu Earth* (version 0.63.0) [Computer software]. https://github.com/johnmorrisdotca/chikyu-earth
|
|
619
619
|
|
|
620
620
|
GitHub's "Cite this repository" button reads [CITATION.cff](CITATION.cff) and gives BibTeX and APA. Cite the version you used (`npm ls @johnmorrisdotca/chikyu-earth`), and credit the sources behind the numbers and pictures: [NOTICE.md](NOTICE.md) says who made each one and under what terms.
|
|
621
621
|
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** The `cloud-fade` default: the texel width in device pixels at which the clouds are gone. 32 pixels of a 2048 texel is 0.6 km of ground a pixel, and the fade starts at 2.4 km a pixel; it keeps the clouds on the horizon seen from a low orbit. */
|
|
2
|
+
export declare const CLOUD_FADE_DEFAULT = 32;
|
|
3
|
+
/** The fade starts at this share of the width that ends it. */
|
|
4
|
+
export declare const CLOUD_FADE_START = 0.25;
|
|
5
|
+
/** The width of the finest cloud picture, in texels round the Earth. */
|
|
6
|
+
export declare const CLOUD_WIDTH: number;
|
|
7
|
+
/**
|
|
8
|
+
* A `cloud-fade` attribute: `off` or `0` is 0 (no fade), a number is the texel width in device pixels at which the clouds are gone (1 to 1000), anything else or leaving it out is the default.
|
|
9
|
+
*
|
|
10
|
+
* @param value - The attribute's text, or null.
|
|
11
|
+
* @returns The width, or 0 for off.
|
|
12
|
+
*/
|
|
13
|
+
export declare function readCloudFade(value: string | null): number;
|
|
14
|
+
/**
|
|
15
|
+
* How much of the clouds to show: 1 while a texel of the cloud picture is no wider than a quarter of `gone` device pixels, 0 from `gone` on, a smooth step between.
|
|
16
|
+
*
|
|
17
|
+
* @param radiusPx - The Earth's radius in device pixels at the nearest ground, as the map tiles read it.
|
|
18
|
+
* @param gone - The texel width in device pixels at which the clouds are gone; 0 or less turns the fade off.
|
|
19
|
+
* @param width - Texels round the Earth in the cloud picture.
|
|
20
|
+
* @returns A strength from 0 to 1.
|
|
21
|
+
*/
|
|
22
|
+
export declare function cloudFade(radiusPx: number, gone: number, width?: number): number;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
// The clouds give way to the ground when the view is close. The cloud picture is one whole-Earth map at most 2048 pixels across (about 20 km a texel), so from a few hundred kilometres
|
|
2
|
+
// up its texels are many pixels wide and it blurs the sharp ground under it. Its strength goes from 1 to 0 as a texel grows from a few device pixels to many. The figure is the one the
|
|
3
|
+
// map tiles use (`tileLevel`): the disc's radius in device pixels, so a texel is `2 * PI * radiusPx / width` pixels. A state of the view, not of time: it changes only when the view does.
|
|
4
|
+
// The realistic Earth is orthographic, so one radius serves the whole disc and the clouds' opacity is set from it. The space view is in perspective: the cloud shader does the same sum for each fragment with
|
|
5
|
+
// `radiusPx = focal / distance` from the camera to that fragment, so the ground under the camera goes sharp while the far ground and the horizon keep their clouds.
|
|
6
|
+
import { TIERS } from "./tiers.js";
|
|
7
|
+
/** The `cloud-fade` default: the texel width in device pixels at which the clouds are gone. 32 pixels of a 2048 texel is 0.6 km of ground a pixel, and the fade starts at 2.4 km a pixel; it keeps the clouds on the horizon seen from a low orbit. */
|
|
8
|
+
export const CLOUD_FADE_DEFAULT = 32;
|
|
9
|
+
/** The fade starts at this share of the width that ends it. */
|
|
10
|
+
export const CLOUD_FADE_START = 0.25;
|
|
11
|
+
/** The width of the finest cloud picture, in texels round the Earth. */
|
|
12
|
+
export const CLOUD_WIDTH = TIERS.clouds[TIERS.clouds.length - 1];
|
|
13
|
+
/**
|
|
14
|
+
* A `cloud-fade` attribute: `off` or `0` is 0 (no fade), a number is the texel width in device pixels at which the clouds are gone (1 to 1000), anything else or leaving it out is the default.
|
|
15
|
+
*
|
|
16
|
+
* @param value - The attribute's text, or null.
|
|
17
|
+
* @returns The width, or 0 for off.
|
|
18
|
+
*/
|
|
19
|
+
export function readCloudFade(value) {
|
|
20
|
+
if (value === null)
|
|
21
|
+
return CLOUD_FADE_DEFAULT;
|
|
22
|
+
if (value.trim() === "off")
|
|
23
|
+
return 0;
|
|
24
|
+
const width = Number(value);
|
|
25
|
+
if (value.trim() === "" || !Number.isFinite(width) || width < 0)
|
|
26
|
+
return CLOUD_FADE_DEFAULT;
|
|
27
|
+
return width === 0 ? 0 : Math.min(1000, Math.max(1, width));
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* How much of the clouds to show: 1 while a texel of the cloud picture is no wider than a quarter of `gone` device pixels, 0 from `gone` on, a smooth step between.
|
|
31
|
+
*
|
|
32
|
+
* @param radiusPx - The Earth's radius in device pixels at the nearest ground, as the map tiles read it.
|
|
33
|
+
* @param gone - The texel width in device pixels at which the clouds are gone; 0 or less turns the fade off.
|
|
34
|
+
* @param width - Texels round the Earth in the cloud picture.
|
|
35
|
+
* @returns A strength from 0 to 1.
|
|
36
|
+
*/
|
|
37
|
+
export function cloudFade(radiusPx, gone, width = CLOUD_WIDTH) {
|
|
38
|
+
if (!(gone > 0))
|
|
39
|
+
return 1;
|
|
40
|
+
const texel = (2 * Math.PI * radiusPx) / width;
|
|
41
|
+
const from = gone * CLOUD_FADE_START;
|
|
42
|
+
const t = Math.min(1, Math.max(0, (texel - from) / (gone - from)));
|
|
43
|
+
return 1 - t * t * (3 - 2 * t);
|
|
44
|
+
}
|
|
@@ -82,6 +82,9 @@ export interface EarthModel {
|
|
|
82
82
|
airThickness: number;
|
|
83
83
|
/** How fast the cloud picture is made to move eastward against the ground, degrees an hour: 0 (the default) keeps the clouds where the picture has them. The picture is one snapshot, not a forecast; a drift is only for life. */
|
|
84
84
|
cloudDrift: number;
|
|
85
|
+
/** The texel width in device pixels at which the clouds are gone (`cloud-fade`), 0 for no fade; and the share of the clouds shown at the last draw. */
|
|
86
|
+
cloudFade: number;
|
|
87
|
+
cloudShown: number;
|
|
85
88
|
/** For the `space` camera: the Earth's turn against the stars (degrees) when the camera was set; null until the next draw sets it. */
|
|
86
89
|
cameraSpin: number | null;
|
|
87
90
|
/** Game seconds a second (the clock's speed): the satellites are placed from it. */
|
package/dist/realistic/earth.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HOME_VIEW, lookAt } from "../view.js";
|
|
2
2
|
import { AIR_QUALITY, AIR_THICKNESS_DEFAULT, AIR_VERT, airFrag, airTop } from "./air.js";
|
|
3
3
|
import { CLOUD_FRAG, SURFACE_FRAG, SURFACE_VERT } from "./shaders.js";
|
|
4
|
+
import { cloudFade, CLOUD_FADE_DEFAULT } from "./cloud-fade.js";
|
|
4
5
|
import { newLightFade, stepLightFade } from "./light-fade.js";
|
|
5
6
|
import { prefersLessMotion } from "../meteors/note.js";
|
|
6
7
|
import { greenwichSidereal, subsolarPoint, unitVector } from "./sun.js";
|
|
@@ -49,6 +50,8 @@ export const newModel = () => ({
|
|
|
49
50
|
camera: "space",
|
|
50
51
|
airThickness: AIR_THICKNESS_DEFAULT,
|
|
51
52
|
cloudDrift: 0,
|
|
53
|
+
cloudFade: CLOUD_FADE_DEFAULT,
|
|
54
|
+
cloudShown: 1,
|
|
52
55
|
cameraSpin: null,
|
|
53
56
|
speed: 1,
|
|
54
57
|
satellites: newSatelliteState(),
|
|
@@ -247,12 +250,14 @@ export function createEarthItem(model, deps) {
|
|
|
247
250
|
sunDir.value.set(0, 0, 1);
|
|
248
251
|
}
|
|
249
252
|
cloudShift.value = -(((model.time / 3_600_000) * model.cloudDrift) % 360) / 360;
|
|
250
|
-
clouds.visible = model.clouds;
|
|
251
253
|
atmosphere.uniforms["thick"].value = model.airThickness;
|
|
252
254
|
glow.scale.setScalar(airTop(model.airThickness));
|
|
253
255
|
surface.uniforms["lights"].value = model.lights ? 1 - fade.mix : 0;
|
|
254
256
|
surface.uniforms["boost"].value = model.light === "boost" ? 1 : 0;
|
|
255
257
|
const radius = discRadius(size.width, size.height, view.zoom);
|
|
258
|
+
model.cloudShown = cloudFade(radius * model.ratio(), model.cloudFade);
|
|
259
|
+
cloudMaterial.uniforms["opacity"].value = 0.9 * model.cloudShown;
|
|
260
|
+
clouds.visible = model.clouds && model.cloudShown > 0;
|
|
256
261
|
camera.left = (-size.width / 2 - view.panX) / radius;
|
|
257
262
|
camera.right = (size.width / 2 - view.panX) / radius;
|
|
258
263
|
camera.top = (size.height / 2 + view.panY) / radius;
|
|
@@ -423,6 +423,8 @@ export declare class ChikyuEarthRealistic extends HTMLElement {
|
|
|
423
423
|
mix: number;
|
|
424
424
|
fading: boolean;
|
|
425
425
|
};
|
|
426
|
+
/** The share of the clouds shown at the last draw, 1 to 0: they give way to the ground as the cloud picture's texels grow past a few device pixels (`cloud-fade`). The disc is orthographic, so it is the same over the whole disc. */
|
|
427
|
+
cloudFade: number;
|
|
426
428
|
/** The page's paths: asked for, drawn (with the chosen satellite's own), left out over the cap of 16, unmatched, whether the chosen satellite's own orbit is drawn, draw calls they took at the last draw (0 or 1), the path under the mouse and the `chikyu-path-click` events sent. */
|
|
427
429
|
paths: PathStats;
|
|
428
430
|
draws: number;
|
|
@@ -43,6 +43,7 @@ import { framesPerSecond, readSmoothFps, smoothCap, SMOOTH_UP_TO, waitFor, watch
|
|
|
43
43
|
import { setSharedRenderer, setThreeLoader, takeRenderer } from "./shared.js";
|
|
44
44
|
export { setSharedRenderer, setThreeLoader };
|
|
45
45
|
import { MAX_TEXTURE, TIERS } from "./tiers.js";
|
|
46
|
+
import { readCloudFade } from "./cloud-fade.js";
|
|
46
47
|
import { mayWriteZoomMax, raisedZoomMax } from "./zoom-reach.js";
|
|
47
48
|
const STYLE = ":host{display:block;aspect-ratio:1/1;position:relative;isolation:isolate}" + IMMERSIVE_STYLE + "#stage,#overlay{position:absolute;inset:0}#overlay{pointer-events:none}.sp-sat{position:absolute;left:0;top:0;font:12px/16px system-ui,-apple-system,sans-serif;color:#fff;white-space:nowrap;text-shadow:0 0 3px #000,0 0 3px #000;pointer-events:none}.sp-sat[hidden]{display:none}.sp-sat[data-hover]{transition:opacity 180ms linear}@media (prefers-reduced-motion: reduce){.sp-sat[data-hover]{transition:none}}" + PLACE_STYLE + SKY_STYLE + COUNTRY_NAMES_STYLE + SEA_NAMES_STYLE + CITY_NAMES_STYLE + METEOR_NOTE_STYLE + NOTES_STYLE;
|
|
48
49
|
const RAD = Math.PI / 180;
|
|
@@ -166,7 +167,7 @@ export const readTime = (value) => {
|
|
|
166
167
|
* ```
|
|
167
168
|
*/
|
|
168
169
|
export class ChikyuEarthRealistic extends HTMLElement {
|
|
169
|
-
static observedAttributes = ["cloud-drift", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "smooth-fps", "tiles", "tiles-finer", "tiles-finer-layer", "tiles-finer-date", "tiles-finer-timeout", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "place-layers", "here-city", "route", "satellite-tint", "satellite-streak-max", "hover-path", "names-on-hover", "selected-path", "path-light", "path-hit", "path-priority", "estimate-far"];
|
|
170
|
+
static observedAttributes = ["cloud-drift", "cloud-fade", "center", "time", "speed", "clouds", "lights", "light", "live-seconds", "smooth-fps", "tiles", "tiles-finer", "tiles-finer-layer", "tiles-finer-date", "tiles-finer-timeout", "data", "camera", "immersive", "meteors", "meteors-label", "meteors-strength", ...BODY_LABEL_ATTRIBUTES, ...SKY_ATTRIBUTES, ...CITY_NAMES_ATTRIBUTES, ...BORDER_ATTRIBUTES, ...GRID_ATTRIBUTES, ...COUNTRY_NAMES_ATTRIBUTES, ...SEA_NAMES_ATTRIBUTES, "air-thickness", "air-label", "lang", "places", "places-look", "place-groups", "place-layers", "here-city", "route", "satellite-tint", "satellite-streak-max", "hover-path", "names-on-hover", "selected-path", "path-light", "path-hit", "path-priority", "estimate-far"];
|
|
170
171
|
#model = newModel();
|
|
171
172
|
#paint = createPaintState();
|
|
172
173
|
#mode = "now";
|
|
@@ -247,6 +248,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
247
248
|
this.#model.light = readLight(this.getAttribute("light"));
|
|
248
249
|
this.#model.camera = readCamera(this.getAttribute("camera"));
|
|
249
250
|
this.#model.cloudDrift = readDrift(this.getAttribute("cloud-drift"));
|
|
251
|
+
this.#model.cloudFade = readCloudFade(this.getAttribute("cloud-fade"));
|
|
250
252
|
this.#model.airThickness = readAirThickness(this.getAttribute("air-thickness"));
|
|
251
253
|
this.#applyBodyLabel();
|
|
252
254
|
this.#door.book.ownOnly(this.getAttribute("data") === "own");
|
|
@@ -495,6 +497,10 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
495
497
|
this.#model.cloudDrift = readDrift(value);
|
|
496
498
|
this.#gate?.soon();
|
|
497
499
|
}
|
|
500
|
+
else if (name === "cloud-fade") {
|
|
501
|
+
this.#model.cloudFade = readCloudFade(value);
|
|
502
|
+
this.#gate?.soon();
|
|
503
|
+
}
|
|
498
504
|
else if (name === "meteors")
|
|
499
505
|
this.meteors = this.#meteorsAsked();
|
|
500
506
|
else if (name === "meteors-strength") {
|
|
@@ -1278,6 +1284,7 @@ export class ChikyuEarthRealistic extends HTMLElement {
|
|
|
1278
1284
|
satellites: this.#satelliteStats(),
|
|
1279
1285
|
pace: { ...this.#pace },
|
|
1280
1286
|
lightFade: { mix: this.#model.lightFade.mix, fading: this.#model.lightFade.fading },
|
|
1287
|
+
cloudFade: this.#model.cloudShown,
|
|
1281
1288
|
paths: this.#pathControls?.stats() ?? emptyPathStats(),
|
|
1282
1289
|
tiles: this.#model.tiles?.stats ?? { ready: false, level: null, held: 0, shown: 0, loading: 0, failed: 0, requested: 0, heldBytes: 0, refused: 0, used: {}, finer: null, fading: false },
|
|
1283
1290
|
draws: stats?.draws ?? 0,
|
|
@@ -7,7 +7,7 @@ export declare const TILE_FRAG: string;
|
|
|
7
7
|
* `vUvG` is where the point is on the whole-Earth pictures.
|
|
8
8
|
*/
|
|
9
9
|
export declare const TILE_VERT = "\nuniform vec4 rect;\nuniform float radius;\nvarying vec2 vUv;\nvarying vec2 vUvG;\nvarying vec3 vNormal;\nvarying vec3 vWorld;\nvoid main() {\n vUv = uv;\n float lon = mix(rect.x, rect.z, uv.x);\n float lat = mix(rect.y, rect.w, uv.y);\n vec3 unit = vec3(cos(lat) * sin(lon), sin(lat), cos(lat) * cos(lon));\n vUvG = vec2((lon + 3.14159265358979) / 6.28318530717959, 0.5 - lat / 3.14159265358979);\n vNormal = normalize(mat3(modelMatrix) * unit);\n vec4 world = modelMatrix * vec4(unit * radius, 1.0);\n vWorld = world.xyz;\n gl_Position = projectionMatrix * viewMatrix * world;\n}";
|
|
10
|
-
export declare const CLOUD_FRAG = "\nuniform sampler2D cloudMap;\nuniform vec3 sunDir;\nuniform float shift;\nuniform float opacity;\nvarying vec2 vUv;\nvarying vec3 vNormal;\nvoid main() {\n vec3 n = normalize(vNormal);\n float ndl = dot(n, sunDir);\n float c = texture2D(cloudMap, vec2(vUv.x + shift, vUv.y)).r;\n float a = smoothstep(0.28, 0.88, c) * opacity;\n float day = smoothstep(-0.10, 0.25, ndl);\n vec3 col = mix(vec3(0.015, 0.02, 0.04), vec3(1.0), day * (0.18 + 0.82 * pow(max(ndl, 0.0), 0.45)));\n col += vec3(0.55, 0.28, 0.14) * smoothstep(-0.14, 0.0, ndl) * (1.0 - smoothstep(0.0, 0.25, ndl)) * 0.35;\n gl_FragColor = vec4(col, a);\n}";
|
|
10
|
+
export declare const CLOUD_FRAG = "\nuniform sampler2D cloudMap;\nuniform vec3 sunDir;\nuniform float shift;\nuniform float opacity;\nuniform float fadeGone;\nuniform float texelK;\nvarying vec2 vUv;\nvarying vec3 vNormal;\nvarying vec3 vWorld;\nvoid main() {\n vec3 n = normalize(vNormal);\n float ndl = dot(n, sunDir);\n float c = texture2D(cloudMap, vec2(vUv.x + shift, vUv.y)).r;\n float a = smoothstep(0.28, 0.88, c) * opacity;\n // a texel of the cloud picture is texelK / distance device pixels wide here; the clouds fade out as it grows (cloud-fade.ts, per fragment: the near ground goes sharp, the far ground and the horizon keep their clouds)\n if (fadeGone > 0.0 && texelK > 0.0) {\n float texel = texelK / length(vWorld - cameraPosition);\n float t = clamp((texel - fadeGone * 0.25) / (fadeGone * 0.75), 0.0, 1.0);\n a *= 1.0 - t * t * (3.0 - 2.0 * t);\n }\n float day = smoothstep(-0.10, 0.25, ndl);\n vec3 col = mix(vec3(0.015, 0.02, 0.04), vec3(1.0), day * (0.18 + 0.82 * pow(max(ndl, 0.0), 0.45)));\n col += vec3(0.55, 0.28, 0.14) * smoothstep(-0.14, 0.0, ndl) * (1.0 - smoothstep(0.0, 0.25, ndl)) * 0.35;\n gl_FragColor = vec4(col, a);\n}";
|
|
11
11
|
/** The Moon and other plain bodies: a picture (or a flat colour) lit by the Sun, with a trace of light on the dark side. */
|
|
12
12
|
export declare const BODY_FRAG = "\nuniform sampler2D map;\nuniform vec3 tint;\nuniform float textured;\nuniform float ambient;\nuniform vec3 sunDir;\nvarying vec2 vUv;\nvarying vec3 vNormal;\nvoid main() {\n vec3 n = normalize(vNormal);\n float ndl = dot(n, sunDir);\n vec3 albedo = textured > 0.5 ? texture2D(map, vUv).rgb : tint;\n float lit = smoothstep(-0.04, 0.12, ndl) * (0.10 + 0.95 * pow(max(ndl, 0.0), 0.6));\n gl_FragColor = vec4(albedo * (ambient + lit), 1.0);\n}";
|
|
13
13
|
/** A flat quad facing the camera: the Sun's disc and its glow. */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// The programs of the realistic Earth, as GLSL strings: the surface (day, night, sun glint), the cloud layer and the Moon and the Sun's glow. The air is `air.ts`.
|
|
2
2
|
// Colours are shaded in the textures' own (sRGB) space: a look, not a radiometric model.
|
|
3
|
+
import { CLOUD_FADE_START } from "./cloud-fade.js";
|
|
3
4
|
export const SURFACE_VERT = /* glsl */ `
|
|
4
5
|
varying vec2 vUv;
|
|
5
6
|
varying vec3 vNormal;
|
|
@@ -130,13 +131,22 @@ uniform sampler2D cloudMap;
|
|
|
130
131
|
uniform vec3 sunDir;
|
|
131
132
|
uniform float shift;
|
|
132
133
|
uniform float opacity;
|
|
134
|
+
uniform float fadeGone;
|
|
135
|
+
uniform float texelK;
|
|
133
136
|
varying vec2 vUv;
|
|
134
137
|
varying vec3 vNormal;
|
|
138
|
+
varying vec3 vWorld;
|
|
135
139
|
void main() {
|
|
136
140
|
vec3 n = normalize(vNormal);
|
|
137
141
|
float ndl = dot(n, sunDir);
|
|
138
142
|
float c = texture2D(cloudMap, vec2(vUv.x + shift, vUv.y)).r;
|
|
139
143
|
float a = smoothstep(0.28, 0.88, c) * opacity;
|
|
144
|
+
// a texel of the cloud picture is texelK / distance device pixels wide here; the clouds fade out as it grows (cloud-fade.ts, per fragment: the near ground goes sharp, the far ground and the horizon keep their clouds)
|
|
145
|
+
if (fadeGone > 0.0 && texelK > 0.0) {
|
|
146
|
+
float texel = texelK / length(vWorld - cameraPosition);
|
|
147
|
+
float t = clamp((texel - fadeGone * ${CLOUD_FADE_START}) / (fadeGone * ${1 - CLOUD_FADE_START}), 0.0, 1.0);
|
|
148
|
+
a *= 1.0 - t * t * (3.0 - 2.0 * t);
|
|
149
|
+
}
|
|
140
150
|
float day = smoothstep(-0.10, 0.25, ndl);
|
|
141
151
|
vec3 col = mix(vec3(0.015, 0.02, 0.04), vec3(1.0), day * (0.18 + 0.82 * pow(max(ndl, 0.0), 0.45)));
|
|
142
152
|
col += vec3(0.55, 0.28, 0.14) * smoothstep(-0.14, 0.0, ndl) * (1.0 - smoothstep(0.0, 0.25, ndl)) * 0.35;
|
|
@@ -17,6 +17,7 @@ import { setThreeLoader } from "../realistic/shared.ts";
|
|
|
17
17
|
import type { LightMode } from "../realistic/earth.ts";
|
|
18
18
|
import type { SatelliteInfo, SatelliteRef, Satellites } from "../satellites/types.ts";
|
|
19
19
|
import type { SatelliteHistory } from "../satellites/history.ts";
|
|
20
|
+
import { type FlyPhase } from "./fly.ts";
|
|
20
21
|
import { type PlanetName } from "./ephemeris.ts";
|
|
21
22
|
import { type SatelliteScreen, type SatelliteStyle } from "./satellite-layer.ts";
|
|
22
23
|
import { type SatelliteOthers } from "./satellite-focus.ts";
|
|
@@ -117,7 +118,7 @@ export type SpacePreset = "earth" | "moon" | "sun" | "inner" | "solar-system" |
|
|
|
117
118
|
export interface RideOptions {
|
|
118
119
|
view?: "from" | "follow" | "above";
|
|
119
120
|
look?: RideLook;
|
|
120
|
-
/** Face this way as the ride opens (`face`). */
|
|
121
|
+
/** Face this way as the ride opens (`face`). Left out of a ride above a satellite and of a body followed, which have no ways to face. */
|
|
121
122
|
face?: RideFace;
|
|
122
123
|
/** The radius of the ridden satellite's model as a share of the picture's height (0.02 to 1.2), for this ride: the element's `ride-model-share` when not given. Along the way it goes the default is 0.22, above the satellite 0.17 (its size at the lowest height). */
|
|
123
124
|
modelShare?: number;
|
|
@@ -162,6 +163,60 @@ export interface ObserveOptions {
|
|
|
162
163
|
/** Glide to the view (true when left out); false, or a reader who asked for reduced motion, jumps. */
|
|
163
164
|
smooth?: boolean;
|
|
164
165
|
}
|
|
166
|
+
/**
|
|
167
|
+
* The options of `flyTo`.
|
|
168
|
+
*
|
|
169
|
+
* @example
|
|
170
|
+
* ```ts no-run
|
|
171
|
+
* import type { FlyOptions } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
172
|
+
*
|
|
173
|
+
* const options: FlyOptions = { height: 30, phase: "both" };
|
|
174
|
+
* console.log(options.height);
|
|
175
|
+
* ```
|
|
176
|
+
*/
|
|
177
|
+
export interface FlyOptions {
|
|
178
|
+
/** The height to come down to, in kilometres above the ground (`FLY_HEIGHT_KM`, 30, when left out; never under `FLY_MIN_KM`, 15). `across` keeps the height it has. */
|
|
179
|
+
height?: number;
|
|
180
|
+
/** `across`, `down` or `both` (the default): see `FlyPhase`. */
|
|
181
|
+
phase?: FlyPhase;
|
|
182
|
+
/** Fly (true when left out); false, a reader who asked for reduced motion, or a picture that is not live yet, jumps there. */
|
|
183
|
+
smooth?: boolean;
|
|
184
|
+
/** Ends the move where it is, as a hand on the view does. */
|
|
185
|
+
signal?: AbortSignal;
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* How a fly-to ended, as `flyTo` gives it and `chikyu-fly-end` sends it: `arrived`, `redirected` (a new `flyTo` or `goToPlace` took it over, carrying its speed on), or `stopped` (a hand on the view, the
|
|
189
|
+
* signal, a ride, or the element leaving the page); the place, the phase, the camera's height then, and what held the descent up (`held`: `no-finer` where no finer picture lies under the place,
|
|
190
|
+
* `zoom-max` at a `zoom-max` the page set, else `null`).
|
|
191
|
+
*
|
|
192
|
+
* @example
|
|
193
|
+
* ```ts no-run
|
|
194
|
+
* import type { FlyEnd } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
195
|
+
*
|
|
196
|
+
* const say = (end: FlyEnd): string => `${end.reason} at ${Math.round(end.heightKm)} km`;
|
|
197
|
+
* console.log(typeof say);
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export interface FlyEnd {
|
|
201
|
+
reason: "arrived" | "redirected" | "stopped";
|
|
202
|
+
lon: number;
|
|
203
|
+
lat: number;
|
|
204
|
+
phase: FlyPhase;
|
|
205
|
+
heightKm: number;
|
|
206
|
+
held: FlyHeld;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* What held a descent above the height asked for: `no-finer` (no finer picture under the place: `FLY_FLOOR_KM`), `zoom-max` (the page's own `zoom-max`), or `null`.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* ```ts no-run
|
|
213
|
+
* import type { FlyHeld } from "@johnmorrisdotca/chikyu-earth/space/element";
|
|
214
|
+
*
|
|
215
|
+
* const held: FlyHeld = "no-finer";
|
|
216
|
+
* console.log(held);
|
|
217
|
+
* ```
|
|
218
|
+
*/
|
|
219
|
+
export type FlyHeld = "no-finer" | "zoom-max" | null;
|
|
165
220
|
/**
|
|
166
221
|
* What the camera is riding along with now: the body or satellite, how (`from`, `follow` or `above`), where it looks, the facing it looks round from (`null` when none was chosen), and the distance kept for a satellite.
|
|
167
222
|
*
|
|
@@ -375,7 +430,8 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
375
430
|
/**
|
|
376
431
|
* Turn the view so a place of `places` is in the middle, at a pace a reader can follow (at once with `smooth: false`, for a reader who asked for less motion, or before the picture is live); the zoom stays.
|
|
377
432
|
* The place is named by its `id`, or by its label in any case. The camera must be looking at the Earth: while it rides along or looks at another body nothing moves. The tilt is held to 90 degrees either
|
|
378
|
-
* way, so a place more than 90 degrees of latitude from `center` comes as near the middle as that allows.
|
|
433
|
+
* way, so a place more than 90 degrees of latitude from `center` comes as near the middle as that allows. A new `goToPlace` or `flyTo` while it turns does not stop it: the turn keeps its speed and
|
|
434
|
+
* the way it is going and curves to the new place. A hand on the view ends it where it is.
|
|
379
435
|
*
|
|
380
436
|
* @param text - The place's id or label.
|
|
381
437
|
* @param options - `smooth` (true by default).
|
|
@@ -384,6 +440,23 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
384
440
|
goToPlace(text: string, options?: {
|
|
385
441
|
smooth?: boolean;
|
|
386
442
|
}): Promise<Place | undefined>;
|
|
443
|
+
/**
|
|
444
|
+
* Fly the camera to a place: across, the Earth turns under the camera at the height it has until the place is below (along a great circle, eased), then down, a descent to `height` kilometres over
|
|
445
|
+
* it (30 by default). `phase` asks for one part alone, so a page can take a reader there one press at a time. A new `flyTo` or `goToPlace` while one is moving does not stop it: the camera keeps its
|
|
446
|
+
* speed and the way it is going and curves smoothly into the new move, and a descent cut short slows to rest without turning back before the new move goes across. A hand on the view (a drag, a pinch,
|
|
447
|
+
* the wheel, a key) or `signal` ends it where it is; a reader who asked for reduced motion, `smooth: false` or a picture that is not live yet goes there at once. The controls' own turn (Auto-turn) is
|
|
448
|
+
* paused, so the place stays below.
|
|
449
|
+
*
|
|
450
|
+
* The descent comes all the way down only where finer pictures lie under the place (`tiles-finer`, over land from 60 degrees south to 80 degrees north); elsewhere it stops at `FLY_FLOOR_KM` (400 km), and
|
|
451
|
+
* at a `zoom-max` the page set, and says so in `held` and `stats.fly`. Once a fly-to has come below about 320 km the zoom reaches as low as it came. The camera must be looking at the Earth: while it
|
|
452
|
+
* rides along or looks at another body nothing moves. `chikyu-fly-start` is sent when it starts, with `{ lon, lat, phase, heightKm, held }`, and `chikyu-fly-end` when it ends, with what it resolves to.
|
|
453
|
+
*
|
|
454
|
+
* @param lat - Degrees north.
|
|
455
|
+
* @param lon - Degrees east.
|
|
456
|
+
* @param options - `height`, `phase`, `smooth` and `signal` (`FlyOptions`).
|
|
457
|
+
* @returns How it ended, once it has; `undefined` when it cannot fly (a latitude or longitude that is not a number, or the camera not looking at the Earth).
|
|
458
|
+
*/
|
|
459
|
+
flyTo(lat: number, lon: number, options?: FlyOptions): Promise<FlyEnd | undefined>;
|
|
387
460
|
/**
|
|
388
461
|
* Whether places that crowd are gathered into one ring with their count (the attribute `place-groups`): on by default, `off` leaves every place its own ring. Setting the property writes the attribute.
|
|
389
462
|
*
|
|
@@ -604,6 +677,7 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
604
677
|
* Earth turns and slides beneath as it moves along its orbit (an ISS view goes round about every 90 minutes). A drag looks about from there (a drag right turns the camera to its left and a drag up tips it towards the bottom of its picture, so the ground follows the pointer), the shared controls' zoom narrows the view.
|
|
605
678
|
* A satellite is `{ group, index }` of a group set with `setSatellites`; it is placed exactly, one SGP4 call a frame, at any speed. Another call switches smoothly; `null` stops. The draw rate follows how
|
|
606
679
|
* fast the picture moves, never more than 30 a second (one a second for a reader who asked for reduced motion), and nothing is drawn out of sight.
|
|
680
|
+
* Whatever the view, facing, drag or glide, the camera is never under the ground: one that would be lower than 1 km above it is held there. A camera that looks at a satellite comes in towards it along its line of sight, so the satellite stays where it is in the picture; any other moves out along its line from the Earth's centre.
|
|
607
681
|
*
|
|
608
682
|
* @param target - A body name (`"Moon"`, `"Mars"`, ...) or a satellite `{ group, index }`, or `null` to stop.
|
|
609
683
|
* @param options - `view`, `look`, `distanceKm`, `smooth` (see `RideOptions`).
|
|
@@ -611,11 +685,11 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
611
685
|
ride(target: RideTarget | null, options?: RideOptions): void;
|
|
612
686
|
/**
|
|
613
687
|
* Face one way while riding: `ahead` along the way it goes, `behind`, `left` or `right` (as seen facing ahead), `down` straight at the Earth, `up` straight away from it.
|
|
614
|
-
*
|
|
688
|
+
* The camera glides there in half a second (at once for a reader who asked for reduced motion) and keeps the zoom.
|
|
615
689
|
* The facing stays pressed until the view is turned or tipped. `chikyu-ride-face` is sent with `{ face }` (`null` when it is let go). Keys, while the element is focused: W ahead, S behind, A left, D right, R up, F down. The arrow keys stay with the view controls.
|
|
616
690
|
*
|
|
617
691
|
* @param face - The way to face.
|
|
618
|
-
* Following a body (a planet, the Moon) there is no way to face: it returns `false
|
|
692
|
+
* Following a body (a planet, the Moon) there is no way to face, and none in the view above a satellite (`view: "above"`, which looks down on it): it returns `false` and the camera stays as it was. Held keys do not repeat, and keys typed in a field or in editable text are left to it.
|
|
619
693
|
*
|
|
620
694
|
* @returns Whether the camera faces that way now (`true` too when it already did, and nothing moves).
|
|
621
695
|
*/
|
|
@@ -1063,6 +1137,8 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
1063
1137
|
mix: number;
|
|
1064
1138
|
fading: boolean;
|
|
1065
1139
|
};
|
|
1140
|
+
/** The share of the clouds shown at the last draw, 1 to 0: they give way to the ground as the cloud picture's texels grow past a few device pixels (`cloud-fade`). In the space view it is the share at the nearest ground (the point the map tiles' level is chosen for); the far ground and the horizon keep more, as each fragment is faded by its own distance. */
|
|
1141
|
+
cloudFade: number;
|
|
1066
1142
|
/** The page's paths: asked for, drawn (with the chosen satellite's own), left out over the cap of 16, unmatched, whether the chosen satellite's own orbit is drawn, draw calls they took at the last draw (0 or 1), the path under the mouse and the `chikyu-path-click` events sent. */
|
|
1067
1143
|
paths: PathStats;
|
|
1068
1144
|
ride: {
|
|
@@ -1210,6 +1286,18 @@ export declare class ChikyuSpace extends HTMLElement {
|
|
|
1210
1286
|
countryNames: CountryNamesStats;
|
|
1211
1287
|
/** The names of oceans, seas and continents: whether `sea-names` is on, the Earth's radius on the screen, the names shown at the last draw, and how many times the layer was laid out. */
|
|
1212
1288
|
seaNames: SeaNamesStats;
|
|
1289
|
+
/**
|
|
1290
|
+
* The fly-to (`flyTo`, and `goToPlace`'s turn): whether one is moving and in which part, the camera's height above the ground in kilometres while it looks at the Earth (`null` otherwise), what held
|
|
1291
|
+
* the last descent up (`held`, as in `FlyEnd`), and how many moves have started and how many were taken over by a new one.
|
|
1292
|
+
*/
|
|
1293
|
+
fly: {
|
|
1294
|
+
flying: boolean;
|
|
1295
|
+
phase: "across" | "down" | null;
|
|
1296
|
+
heightKm: number | null;
|
|
1297
|
+
held: FlyHeld;
|
|
1298
|
+
moves: number;
|
|
1299
|
+
redirects: number;
|
|
1300
|
+
};
|
|
1213
1301
|
};
|
|
1214
1302
|
}
|
|
1215
1303
|
declare global {
|