@johnmorrisdotca/wakusei-planets 0.45.1 → 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.
Files changed (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/NOTICE.md +12 -0
  3. package/README.md +4 -3
  4. package/dist/scene/body.d.ts +1 -1
  5. package/dist/scene/textures.d.ts +2 -2
  6. package/dist/space/element.d.ts +7 -0
  7. package/dist/space/element.js +12 -0
  8. package/dist/surface/detail.d.ts +186 -0
  9. package/dist/surface/detail.js +316 -0
  10. package/dist/surface/element.d.ts +103 -0
  11. package/dist/surface/element.js +685 -0
  12. package/dist/surface/glsl.d.ts +26 -0
  13. package/dist/surface/glsl.js +457 -0
  14. package/dist/surface/height.d.ts +257 -0
  15. package/dist/surface/height.js +232 -0
  16. package/dist/surface/index.d.ts +10 -0
  17. package/dist/surface/index.js +10 -0
  18. package/dist/surface/land.d.ts +111 -0
  19. package/dist/surface/land.js +261 -0
  20. package/dist/surface/load.d.ts +133 -0
  21. package/dist/surface/load.js +183 -0
  22. package/dist/surface/objects-apollo-17.d.ts +4 -0
  23. package/dist/surface/objects-apollo-17.js +19 -0
  24. package/dist/surface/objects.d.ts +127 -0
  25. package/dist/surface/objects.js +179 -0
  26. package/dist/surface/rocks.d.ts +45 -0
  27. package/dist/surface/rocks.js +166 -0
  28. package/dist/surface/scene.d.ts +72 -0
  29. package/dist/surface/scene.js +488 -0
  30. package/dist/surface/shapes.d.ts +62 -0
  31. package/dist/surface/shapes.js +247 -0
  32. package/dist/surface/site.d.ts +58 -0
  33. package/dist/surface/site.js +38 -0
  34. package/dist/surface/sky.d.ts +81 -0
  35. package/dist/surface/sky.js +60 -0
  36. package/dist/surface/view.d.ts +129 -0
  37. package/dist/surface/view.js +139 -0
  38. package/dist/version.d.ts +1 -1
  39. package/dist/version.js +1 -1
  40. package/package.json +23 -1
@@ -0,0 +1,316 @@
1
+ // The made detail: what is smaller than the 5 m grid. Craters by the lunar size-frequency law (many small, few large, soft rims, a depth of a fifth of the diameter when fresh and shallower as they
2
+ // age), laid on a seeded grid of cells, so the same place is always the same. It is MADE, not measured, and the page says so. The shader (glsl.ts) holds the same formulas; this is the same
3
+ // maths in JS, for the feet (the eyes follow the made ground too), for the rocks (placed on the ground and denser by fresh rims) and for the tests that hold the two together.
4
+ // Every random number is an integer hash (PCG, 32 bit) cut to 24 bits, so the two agree exactly.
5
+ import { keepAway } from "./objects.js";
6
+ /** The objects the made ground keeps away from: set for the site being stood on (`setKeepOut`), none until then. */
7
+ let keepObjects = [];
8
+ /**
9
+ * Say which objects the made craters and rocks keep away from (the ones `objectsOf` gives for the site), or none. The shader holds the same list.
10
+ *
11
+ * @param objects - The objects.
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { madeGround, objectsOf, setKeepOut } from "@johnmorrisdotca/wakusei-planets/surface";
16
+ *
17
+ * const [lander] = objectsOf("apollo-17");
18
+ * setKeepOut(objectsOf("apollo-17"));
19
+ * console.log(madeGround(lander!.east, lander!.north, 0.35).h);
20
+ * setKeepOut([]);
21
+ * ```
22
+ */
23
+ export function setKeepOut(objects) {
24
+ keepObjects = objects;
25
+ }
26
+ /** The smallest crater's nominal diameter in metres: each octave doubles it, up to `OCTAVES` octaves (0.5, 1, 2, 4, 8, 16). A crater in an octave is between 1 and 2 times its nominal diameter. */
27
+ export const D0 = 0.5;
28
+ export const OCTAVES = 6;
29
+ /** A cell is this many nominal diameters across, with at most one crater in it. */
30
+ export const CELL = 3;
31
+ /** The share of a cell, from its edge, within which the craters of the cell over the edge are looked for. */
32
+ export const NEAR_EDGE = 0.2;
33
+ const mul = (a, b) => Math.imul(a, b) >>> 0;
34
+ /** The PCG hash of two 32 bit integers, as the shader does it. */
35
+ export function pcg2d(x, y) {
36
+ let vx = (mul(x, 1664525) + 1013904223) >>> 0;
37
+ let vy = (mul(y, 1664525) + 1013904223) >>> 0;
38
+ vx = (vx + mul(vy, 1664525)) >>> 0;
39
+ vy = (vy + mul(vx, 1664525)) >>> 0;
40
+ vx = (vx ^ (vx >>> 16)) >>> 0;
41
+ vy = (vy ^ (vy >>> 16)) >>> 0;
42
+ vx = (vx + mul(vy, 1664525)) >>> 0;
43
+ vy = (vy + mul(vx, 1664525)) >>> 0;
44
+ vx = (vx ^ (vx >>> 16)) >>> 0;
45
+ vy = (vy ^ (vy >>> 16)) >>> 0;
46
+ return [vx, vy];
47
+ }
48
+ /** A hash cut to a number from 0 up to but not including 1, exact in 24 bits. */
49
+ export const unit24 = (h) => (h >>> 8) / 16777216;
50
+ /** The share of cells that hold a crater in an octave: many small, few large. */
51
+ export const occupancy = (octave) => (octave >= 3 ? 0.5 : 1) * 0.36 * Math.pow(2, -0.5 * octave);
52
+ /**
53
+ * The crater in a cell of an octave, or `undefined` for an empty cell.
54
+ *
55
+ * @param cx - The cell's column.
56
+ * @param cy - The cell's row.
57
+ * @param octave - 0 for the smallest (0.5 m) up.
58
+ * @returns The crater, or `undefined` when the cell holds none (most cells do not: see `occupancy`).
59
+ *
60
+ * @example
61
+ * ```ts
62
+ * import { craterIn } from "@johnmorrisdotca/wakusei-planets/surface";
63
+ *
64
+ * console.log(craterIn(4, -2, 3)?.radius.toFixed(2), craterIn(0, 0, 3));
65
+ * ```
66
+ */
67
+ export function craterIn(cx, cy, octave) {
68
+ const [a, b] = pcg2d((cx | 0) >>> 0, ((cy | 0) + octave * 7919) >>> 0);
69
+ if (unit24(a) >= occupancy(octave))
70
+ return undefined;
71
+ const [c, d] = pcg2d(((cx | 0) + 104729) >>> 0, ((cy | 0) + octave * 7919 + 15485863) >>> 0);
72
+ const nominal = D0 * 2 ** octave;
73
+ const cell = CELL * nominal;
74
+ const diameter = nominal * (1 + (octave === OCTAVES - 1 ? 0.25 : 1) * unit24(d));
75
+ // most craters are old: of every hundred, about four are fresh (age under 0.15) and three in four are worn (over 0.7): soft, shallow, nearly rimless bowls
76
+ const r = (a & 255) / 255;
77
+ const age = 1 - r * r * r * r;
78
+ const radius = diameter / 2;
79
+ const vary = 0.6 + 0.4 * ((c & 255) / 255);
80
+ return {
81
+ x: (cx + 0.25 + 0.5 * unit24(b)) * cell,
82
+ y: (cy + 0.25 + 0.5 * unit24(c)) * cell,
83
+ radius,
84
+ depth: diameter * (0.2 - 0.17 * age) * vary,
85
+ rim: 0.045 * diameter * (1 - age) ** 1.5,
86
+ rimWidth: 0.22 + 0.5 * age,
87
+ age,
88
+ };
89
+ }
90
+ /**
91
+ * A crater's height at a point: the bowl, the soft rim. Also the slope along x and y.
92
+ *
93
+ * @param c - The crater.
94
+ * @param px - Metres east of the site.
95
+ * @param py - Metres north of the site.
96
+ * @returns The height in metres (negative in the bowl, positive on the rim) and the slope along east (`gx`) and north (`gy`).
97
+ *
98
+ * @example
99
+ * ```ts
100
+ * import { craterProfile, type Crater } from "@johnmorrisdotca/wakusei-planets/surface";
101
+ *
102
+ * const crater: Crater = { x: 0, y: 0, radius: 4, depth: 0.8, rim: 0.2, rimWidth: 0.3, age: 0.2 };
103
+ * console.log(craterProfile(crater, 0, 0).h.toFixed(2), craterProfile(crater, 4, 0).h.toFixed(2));
104
+ * ```
105
+ */
106
+ export function craterProfile(c, px, py) {
107
+ const dx = px - c.x;
108
+ const dy = py - c.y;
109
+ const r = Math.hypot(dx, dy);
110
+ const x = r / c.radius;
111
+ let h = 0;
112
+ let dh = 0;
113
+ if (x < 1) {
114
+ // a fresh bowl is a plain parabola with a sharp edge; a worn one has a flat rim and a slope that dies out at the edge, so no outline shows
115
+ const bowl = 1 - x * x;
116
+ const pw = 1 + c.age;
117
+ h = -c.depth * bowl ** pw;
118
+ dh = 2 * c.depth * pw * x * bowl ** c.age;
119
+ }
120
+ const e = (x - 1) / c.rimWidth;
121
+ const rim = c.rim * Math.exp(-e * e);
122
+ h += rim;
123
+ dh += (-2 * c.rim * e * Math.exp(-e * e)) / c.rimWidth;
124
+ // a long soft apron past the rim: the ejecta, a thin tail
125
+ if (x > 1) {
126
+ const tail = 0.25 * c.rim * Math.pow(1 / x, 3);
127
+ h += tail;
128
+ dh += -0.75 * c.rim * Math.pow(1 / x, 4);
129
+ }
130
+ const k = r > 1e-9 ? dh / (c.radius * r) : 0;
131
+ return { h, gx: k * dx, gy: k * dy };
132
+ }
133
+ /** How far a crater's reach goes in multiples of its radius, beyond which the apron is too faint to count. */
134
+ export const REACH = 4;
135
+ /**
136
+ * The made ground's height at a point, and its slope, from every crater of every octave not smaller than `fromDiameter` (a crater is faded in over a factor of two above it, so none
137
+ * pops). The cell the point is in is looked at in each octave, and a neighbouring cell when the point is within a fifth of the edge between them: a crater is kept to the middle of its cell, so its rim and the strong part of its apron reach no further.
138
+ *
139
+ * @param x - Metres east of the site.
140
+ * @param y - Metres north of the site.
141
+ * @param fromDiameter - The smallest nominal diameter to count, in metres: a distance's worth of pixels (craters smaller than a few pixels only shimmer).
142
+ * @returns The height in metres and the slope along east and north.
143
+ *
144
+ * @example
145
+ * ```ts
146
+ * import { madeGround } from "@johnmorrisdotca/wakusei-planets/surface";
147
+ *
148
+ * console.log(madeGround(12.5, -8, 0.5).h.toFixed(2));
149
+ * ```
150
+ */
151
+ export function madeGround(x, y, fromDiameter) {
152
+ let h = 0;
153
+ let gx = 0;
154
+ let gy = 0;
155
+ for (let octave = OCTAVES - 1; octave >= 0; octave -= 1) {
156
+ const nominal = D0 * 2 ** octave;
157
+ const fade = Math.max(0, Math.min(1, (nominal / fromDiameter - 1) * 1));
158
+ if (fade <= 0)
159
+ break;
160
+ const cell = CELL * nominal;
161
+ const ix = Math.floor(x / cell);
162
+ const iy = Math.floor(y / cell);
163
+ const fx = x / cell - ix;
164
+ const fy = y / cell - iy;
165
+ for (let j = -1; j <= 1; j += 1) {
166
+ for (let i = -1; i <= 1; i += 1) {
167
+ // a crater is kept inside the middle half of its cell and no wider than a third of it, so a neighbour's reaches this cell only within a fifth of the cell's edge
168
+ if ((i === -1 && fx > NEAR_EDGE) || (i === 1 && fx < 1 - NEAR_EDGE) || (j === -1 && fy > NEAR_EDGE) || (j === 1 && fy < 1 - NEAR_EDGE))
169
+ continue;
170
+ const crater = craterIn(ix + i, iy + j, octave);
171
+ if (crater === undefined)
172
+ continue;
173
+ const p = craterProfile(crater, x, y);
174
+ h += fade * p.h;
175
+ gx += fade * p.gx;
176
+ gy += fade * p.gy;
177
+ }
178
+ }
179
+ }
180
+ const keep = keepAway(x, y, keepObjects);
181
+ return { h: h * keep, gx: gx * keep, gy: gy * keep };
182
+ }
183
+ /** The rocks of a class are `ROCK_MIN * 2 ** class` metres: 0.05, 0.1, 0.2, 0.4, 0.8, 1.6; a rock of a class is between 1 and 1.4 times that. */
184
+ export const ROCK_MIN = 0.05;
185
+ export const ROCK_CLASSES = 6;
186
+ /** Rocks a square metre is dealt of the smallest class (two and a half times what stays on ground far from a rim: a rock is kept in proportion to how near a young rim it is), and the side of the cells they are laid on, in metres. */
187
+ const ROCK_DENSITY = 0.8;
188
+ const ROCK_CELL = 6;
189
+ /**
190
+ * How much denser the rocks are at a point for fresh crater rims near it: 1 away from any, up to 5 on a young crater's rim.
191
+ *
192
+ * @param x - Metres east of the site.
193
+ * @param y - Metres north of the site.
194
+ * @returns A factor from 1 (no young rim near) up to 5 (on one).
195
+ *
196
+ * @example
197
+ * ```ts
198
+ * import { rimBoost } from "@johnmorrisdotca/wakusei-planets/surface";
199
+ *
200
+ * console.log(rimBoost(0, 0), rimBoost(51, -19) >= 1);
201
+ * ```
202
+ */
203
+ export function rimBoost(x, y) {
204
+ let boost = 1;
205
+ for (let octave = 2; octave < OCTAVES; octave += 1) {
206
+ const cell = CELL * D0 * 2 ** octave;
207
+ const ix = Math.floor(x / cell);
208
+ const iy = Math.floor(y / cell);
209
+ for (let j = -1; j <= 1; j += 1) {
210
+ for (let i = -1; i <= 1; i += 1) {
211
+ const c = craterIn(ix + i, iy + j, octave);
212
+ if (c === undefined || c.age > 0.35)
213
+ continue;
214
+ const t = Math.abs(Math.hypot(x - c.x, y - c.y) / c.radius - 1.0);
215
+ if (t < 0.4)
216
+ boost = Math.max(boost, 1 + 4 * (1 - t / 0.4) * (1 - c.age / 0.35));
217
+ }
218
+ }
219
+ }
220
+ return boost;
221
+ }
222
+ /**
223
+ * The rocks round a point, within `radius` metres: seeded and fixed to the place. Many small, few large (about a third as many of each class up), denser by fresh rims; a rock too small for a few pixels at its
224
+ * distance is left out, so nothing shimmers. They are made, not measured.
225
+ *
226
+ * @param cx - Metres east of the site.
227
+ * @param cy - Metres north of the site.
228
+ * @param radius - How far round to look, in metres.
229
+ * @param pixel - The angle one pixel takes in radians (a rock smaller than three pixels at its distance is left out).
230
+ * @returns The rocks, nearest first.
231
+ *
232
+ * @example
233
+ * ```ts
234
+ * import { rocksAround } from "@johnmorrisdotca/wakusei-planets/surface";
235
+ *
236
+ * console.log(rocksAround(0, 0, 20, 0.0024).length > 100);
237
+ * ```
238
+ */
239
+ export function rocksAround(cx, cy, radius, pixel) {
240
+ const out = [];
241
+ const i0 = Math.floor((cx - radius) / ROCK_CELL);
242
+ const i1 = Math.floor((cx + radius) / ROCK_CELL);
243
+ const j0 = Math.floor((cy - radius) / ROCK_CELL);
244
+ const j1 = Math.floor((cy + radius) / ROCK_CELL);
245
+ for (let j = j0; j <= j1; j += 1) {
246
+ for (let i = i0; i <= i1; i += 1) {
247
+ for (let k = 0; k < ROCK_CLASSES; k += 1) {
248
+ const [a, b] = pcg2d((i | 0) >>> 0, ((j | 0) + k * 6151 + 1000003) >>> 0);
249
+ const lambda = ROCK_DENSITY * ROCK_CELL * ROCK_CELL * 0.3 ** k;
250
+ let count = Math.floor(lambda);
251
+ if (unit24(a) < lambda - count)
252
+ count += 1;
253
+ for (let n = 0; n < Math.min(count, 48); n += 1) {
254
+ const [c, d] = pcg2d(((i | 0) + n * 31 + 7) >>> 0, ((j | 0) + k * 6151 + n * 977 + 1000033) >>> 0);
255
+ const x = (i + unit24(c)) * ROCK_CELL;
256
+ const y = (j + unit24(d)) * ROCK_CELL;
257
+ const dist = Math.hypot(x - cx, y - cy);
258
+ if (dist > radius)
259
+ continue;
260
+ const size = ROCK_MIN * 2 ** k * (1 + 0.4 * unit24(b >>> 0 ^ (c << 3)));
261
+ if (size < 3 * dist * pixel)
262
+ continue;
263
+ // fewer where the rims are not near: two fifths of what is dealt on the plain, all of it by a young rim
264
+ const boost = rimBoost(x, y);
265
+ if (unit24(pcg2d(c, d)[0]) > 0.3 * boost)
266
+ continue;
267
+ if (keepAway(x, y, keepObjects) < 0.5)
268
+ continue;
269
+ const [e, f] = pcg2d(c ^ 0x9e3779b9, d + 17);
270
+ out.push({ x, y, size, shape: e % 3, turn: unit24(f) * Math.PI * 2, tone: 0.75 + 0.5 * unit24(e >>> 3), flat: 0.45 + 0.4 * unit24(f >>> 5) });
271
+ }
272
+ }
273
+ }
274
+ }
275
+ return out.sort((p, q) => Math.hypot(p.x - cx, p.y - cy) - Math.hypot(q.x - cx, q.y - cy));
276
+ }
277
+ /**
278
+ * The nearest place to a point where a person can stand without being in a made crater or on a made rim: the made ground there is level over two metres round. The landing point itself is
279
+ * the first tried, so most of the time a person stands where the lunar module stood.
280
+ *
281
+ * @param x - Metres east of the site.
282
+ * @param y - Metres north of the site.
283
+ * @returns A place within thirty metres of the point.
284
+ *
285
+ * @example
286
+ * ```ts
287
+ * import { standingPlace } from "@johnmorrisdotca/wakusei-planets/surface";
288
+ *
289
+ * const place = standingPlace(0, 0);
290
+ * console.log(Math.hypot(place.x, place.y) < 30);
291
+ * ```
292
+ */
293
+ export function standingPlace(x = 0, y = 0) {
294
+ const level = (px, py) => {
295
+ const here = madeGround(px, py, 0.35);
296
+ if (Math.hypot(here.gx, here.gy) > 0.05)
297
+ return false;
298
+ for (let k = 0; k < 8; k += 1) {
299
+ const a = (k * Math.PI) / 4;
300
+ if (Math.abs(madeGround(px + 2.2 * Math.cos(a), py + 2.2 * Math.sin(a), 0.35).h - here.h) > 0.12)
301
+ return false;
302
+ }
303
+ return true;
304
+ };
305
+ for (let r = 0; r <= 30; r += 2) {
306
+ const n = Math.max(1, Math.round(r * 1.2));
307
+ for (let k = 0; k < n; k += 1) {
308
+ const a = (k / n) * Math.PI * 2;
309
+ const px = x + r * Math.cos(a);
310
+ const py = y + r * Math.sin(a);
311
+ if (level(px, py))
312
+ return { x: px, y: py };
313
+ }
314
+ }
315
+ return { x, y };
316
+ }
@@ -0,0 +1,103 @@
1
+ import type { SharedRenderer } from "@johnmorrisdotca/kazoku-ui/renderer";
2
+ import type { ThreeParts } from "../scene/body.ts";
3
+ import { setThreeLoader } from "../scene/shared.ts";
4
+ import { type HeightLevel, type TerrainManifest } from "./height.ts";
5
+ import { type TerrainProgress } from "./load.ts";
6
+ import { type SurfaceScene } from "./scene.ts";
7
+ import { type SiteObject } from "./objects.ts";
8
+ import { type MoonSky } from "./sky.ts";
9
+ import { type Look } from "./view.ts";
10
+ export { setThreeLoader };
11
+ /**
12
+ * What the element is doing: `loading` (the heights are on their way), `live` (drawn), `lost` (the page's graphics context was lost and will come back), `unavailable` (no WebGL, or no heights for
13
+ * the site: nothing can be drawn) or `idle` (not yet asked to).
14
+ *
15
+ * @example
16
+ * ```ts no-run
17
+ * import type { SurfaceState } from "@johnmorrisdotca/wakusei-planets/surface";
18
+ *
19
+ * const ready = (state: SurfaceState): boolean => state === "live";
20
+ * console.log(ready("loading"));
21
+ * ```
22
+ */
23
+ export type SurfaceState = "idle" | "loading" | "live" | "lost" | "unavailable";
24
+ /**
25
+ * The `<wakusei-surface>` custom element: standing on a body.
26
+ *
27
+ * Attributes: `body` (`moon`), `site` (a name from `SURFACE_SITES`, `apollo-17`), `time` (an ISO date and time, or milliseconds since 1970; the site's own landing moment when left out; `now` for the real time),
28
+ * `heading` (degrees clockwise from north to look toward), `pitch` (degrees up), `fov` (the view's height in degrees: zoom), `tiles` (the folder the height tiles are served from; the demo site's `tiles/` by default),
29
+ * `lang` (`en` or `ja`: the words on the picture).
30
+ *
31
+ * A drag turns the view; the keys W, A, S, D and the arrow keys walk (1.4 metres a second, over the real ground: it rises and falls under the eyes), Q and E turn, + and - zoom, and Ctrl with the wheel or a
32
+ * pinch zooms. Nothing is drawn at rest.
33
+ *
34
+ * @example
35
+ * ```ts no-run
36
+ * import type { WakuseiSurface } from "@johnmorrisdotca/wakusei-planets/surface/element";
37
+ *
38
+ * const view = document.createElement("wakusei-surface") as WakuseiSurface;
39
+ * view.setAttribute("site", "apollo-17");
40
+ * document.body.append(view);
41
+ * ```
42
+ */
43
+ export declare class WakuseiSurface extends HTMLElement {
44
+ #private;
45
+ static observedAttributes: string[];
46
+ /** Whether the first view of the ground is in (the heights are fetched and the view could draw at once): true while on `standby` too, which is how a page makes ready without taking the renderer. */
47
+ get loaded(): boolean;
48
+ /** The state now. */
49
+ get state(): SurfaceState;
50
+ /** The eyes' look now. Setting it turns the view (azimuth and pitch in degrees, `fov` the view's height in degrees); it is drawn at once. */
51
+ get look(): Look;
52
+ set look(value: Look);
53
+ /** Where the eyes are: metres east and north of the site, and metres over the ground under them. */
54
+ get position(): {
55
+ east: number;
56
+ north: number;
57
+ up: number;
58
+ };
59
+ /** The sky now: the Sun and the Earth in it. */
60
+ get sky(): MoonSky | undefined;
61
+ /** The moment shown, milliseconds since 1970. */
62
+ get time(): number;
63
+ set time(value: number);
64
+ /** The height model as loaded, or `undefined` before: for a status line and a test. */
65
+ get terrain(): {
66
+ manifest: TerrainManifest;
67
+ levels: readonly HeightLevel[];
68
+ bytes: number;
69
+ } | undefined;
70
+ /** Numbers for a test or a status line: the draws, the tiles, the renderer's own counts, the mesh, the quality of the last draw and the milliseconds of the last measured one. */
71
+ get stats(): {
72
+ state: SurfaceState;
73
+ draws: number;
74
+ tiles: TerrainProgress | undefined;
75
+ renderer: SharedRenderer<ThreeParts>["stats"] | undefined;
76
+ mesh: SurfaceScene["mesh"] | undefined;
77
+ quality: string;
78
+ scale: number;
79
+ scaled: number;
80
+ drawMs: number | undefined;
81
+ rocks: number;
82
+ };
83
+ connectedCallback(): void;
84
+ disconnectedCallback(): void;
85
+ attributeChangedCallback(name: string): void;
86
+ /**
87
+ * Walk: `ahead` metres along the heading (negative backs up) and `aside` to its right. The ground under the eyes is read from the heights, so the eyes rise and fall with it.
88
+ *
89
+ * @param ahead - Metres forward.
90
+ * @param aside - Metres to the right.
91
+ */
92
+ walk(ahead: number, aside?: number): void;
93
+ /** The things at the site, at their published places (none where the site has none or `objects="off"`). */
94
+ get objects(): readonly SiteObject[];
95
+ /**
96
+ * Choose a thing at the site: the eyes go to a few metres from it, looking at it, its button is pressed and a line says what it is and that it was placed by this package. `wakusei-surface-object` is sent
97
+ * with its id. Choosing the same one again, or `undefined`, puts the line away.
98
+ *
99
+ * @param id - A thing's id (`lm`, `rover`, `flag`, `alsep`, `sep`), or `undefined` for none.
100
+ * @returns Whether there is such a thing here.
101
+ */
102
+ choose(id: string | undefined): boolean;
103
+ }