Reference
The realistic Earth's pure parts
import { … } from "@johnmorrisdotca/chikyu-earth/realistic";
Exports
| Name | Kind | What it is |
|---|---|---|
ATMOSPHERE_OUTER | constant | The glow reaches this many radii from the centre; the globe at 1x is drawn to fit inside it. |
chooseTier | function | The width to hold for a layer when the globe's disc has radius radiusPx device pixels: the smallest shipped width that gives TEXELS_PER_RADIUS_PIXEL texels per pixel, else the largest, never more than cap, never less than the smallest. |
createGate | function | A rate gate for the draw: asks that come faster than minMs apart become one, and the last ask is never lost, so a burst of changes costs one draw. |
discRadius | function | The disc's radius in CSS pixels in a box of width x height at zoom: it fits the glow in the box at 1x. |
frameCap | function | The frame rate cap for this device: maxFps (30 by default), lower on a small device. |
Gate | type | A rate gate for the draw: what createGate returns. |
julianDay | function | Julian day number of a moment in milliseconds since the Unix epoch. |
Layer | type | One of the pictures the realistic Earth and the space view draw with: day, night, clouds, water and moon. |
LightMode | type | How the Earth is lit: sun (the true light, with the night side dark and the city lights on it), lit (always lit, as if by daylight from the camera's side, the day picture and no city lights: the night side is never a black frame) or boost (the true terminator, with the night side raised so the land and coasts read). |
lookAt | function | Where the view is centred on the globe: the home centre, turned by yaw (west) and tipped by tilt (south), held to the poles; a drag right is yaw and a drag up is tilt, and the ground follows the pointer. |
MAX_TEXTURE | constant | The most pixels across a texture the package ever asks the GPU for. |
subsolarPoint | function | The point where the Sun is at the zenith at ms: latitude is the Sun's declination, longitude runs west at 15 degrees an hour. |
TEXELS_PER_RADIUS_PIXEL | constant | Texels across the whole circumference wanted per device pixel of the globe's radius: 3 is a little under 2 pi, so a texel is a little larger than a pixel. |
textureBytes | function | Bytes of GPU memory a texture of this width costs, with its mipmaps, at 4 bytes a pixel (the most it can be). |
textureCap | function | The cap for this device: low-memory phones stop at 2048, and the GPU's own limit and the option are never passed. |
ThreeParts | type | The parts of three.js the Earth and the space view use. |
TIERS | constant | The widths each layer is shipped in (every picture is 2:1, so the height is half). |
unitVector | function | A point on the globe as a unit vector: +z is longitude 0 on the equator, +x east, +y north. |