@johnmorrisdotca/chikyu-earth 0.35.0 → 0.37.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 +21 -0
- package/NOTICE.md +27 -1
- package/README.md +20 -2
- package/dist/borders/layer.d.ts +75 -0
- package/dist/borders/layer.js +136 -0
- package/dist/borders/lines.d.ts +138 -0
- package/dist/borders/lines.js +227 -0
- package/dist/catalogue/index.d.ts +1 -0
- package/dist/catalogue/index.js +3 -2
- package/dist/catalogue/pack.js +3 -0
- package/dist/cities/host.d.ts +9 -0
- package/dist/cities/host.js +51 -9
- package/dist/country-names/geometry.d.ts +264 -0
- package/dist/country-names/geometry.js +372 -0
- package/dist/country-names/host.d.ts +82 -0
- package/dist/country-names/host.js +212 -0
- package/dist/grid/layer.d.ts +45 -0
- package/dist/grid/layer.js +66 -0
- package/dist/grid/lines.d.ts +85 -0
- package/dist/grid/lines.js +113 -0
- package/dist/markers/go-to-place.d.ts +27 -0
- package/dist/markers/go-to-place.js +35 -0
- package/dist/markers/index.d.ts +2 -1
- package/dist/markers/index.js +2 -1
- package/dist/markers/layer.d.ts +7 -0
- package/dist/markers/layer.js +7 -0
- package/dist/markers/place-layer.d.ts +58 -7
- package/dist/markers/place-layer.js +326 -64
- package/dist/markers/place-sprites.d.ts +33 -0
- package/dist/markers/place-sprites.js +161 -0
- package/dist/markers/places.d.ts +91 -6
- package/dist/markers/places.js +135 -6
- package/dist/realistic/earth.d.ts +11 -0
- package/dist/realistic/earth.js +55 -1
- package/dist/realistic/element.d.ts +75 -6
- package/dist/realistic/element.js +221 -33
- package/dist/realistic/immersive.d.ts +7 -0
- package/dist/realistic/immersive.js +17 -0
- package/dist/realistic/index.d.ts +6 -0
- package/dist/realistic/index.js +3 -0
- package/dist/realistic/textures.d.ts +5 -0
- package/dist/satellites/index.d.ts +1 -0
- package/dist/satellites/index.js +1 -0
- package/dist/satellites/limits.d.ts +1 -1
- package/dist/satellites/limits.js +1 -1
- package/dist/satellites/owners.d.ts +26 -0
- package/dist/satellites/owners.js +164 -0
- package/dist/satellites/source.js +3 -0
- package/dist/satellites/track.d.ts +5 -0
- package/dist/satellites/track.js +128 -0
- package/dist/satellites/types.d.ts +19 -1
- package/dist/space/element.d.ts +111 -12
- package/dist/space/element.js +360 -26
- package/dist/space/index.d.ts +2 -2
- package/dist/space/index.js +1 -1
- package/dist/space/ride.d.ts +42 -0
- package/dist/space/ride.js +45 -3
- package/dist/space/satellite-layer.d.ts +8 -2
- package/dist/space/satellite-layer.js +138 -19
- package/dist/space/scene.d.ts +56 -6
- package/dist/space/scene.js +97 -15
- package/package.json +3 -3
package/dist/space/scene.js
CHANGED
|
@@ -4,12 +4,15 @@ import { BODY_FRAG, CLOUD_FRAG, GLOW_FRAG, GLOW_VERT, SURFACE_FRAG, SURFACE_VERT
|
|
|
4
4
|
import { createTextureSet } from "../realistic/textures.js";
|
|
5
5
|
import { createTrack, orbitPath, PLANETS } from "./ephemeris.js";
|
|
6
6
|
import { placeAround, placeMoon, placeSun, RADIUS } from "./scale.js";
|
|
7
|
-
import { ridePose } from "./ride.js";
|
|
7
|
+
import { faceOffset, ridePose } from "./ride.js";
|
|
8
8
|
import { coverBody, covers } from "../sky/cover.js";
|
|
9
|
+
import { createPlaceSprites } from "../markers/place-sprites.js";
|
|
9
10
|
import { aboveAxes, MODEL_RADIUS_SHARE, modelMatrix, modelRadius, satelliteAxes } from "./satellite-model.js";
|
|
10
11
|
import { createSatelliteLayer, newSatelliteState } from "./satellite-layer.js";
|
|
11
12
|
import { createBodyLabelLayer, newBodyLabelState } from "../realistic/body-label.js";
|
|
12
13
|
import { createMeteorLayer, newMeteorState } from "../meteors/layer.js";
|
|
14
|
+
import { createBorderLayer, newBorderState } from "../borders/layer.js";
|
|
15
|
+
import { createGridLayer, newGridState } from "../grid/layer.js";
|
|
13
16
|
import { subsolarPoint, unitVector } from "../realistic/sun.js";
|
|
14
17
|
/** The most satellites ringed and named at once, over all the labelled groups. */
|
|
15
18
|
const MAX_MARKED = 80;
|
|
@@ -74,13 +77,14 @@ export const newSpaceModel = () => ({
|
|
|
74
77
|
bodies: "",
|
|
75
78
|
light: "sun",
|
|
76
79
|
drawn: null,
|
|
77
|
-
painted: { bodies: 0, moons: 0 },
|
|
80
|
+
painted: { bodies: 0, moons: 0, held: 0, moon: false, tiles: 0 },
|
|
78
81
|
lookups: 0,
|
|
79
82
|
speed: 1,
|
|
80
83
|
ride: null,
|
|
81
84
|
rideLost: false,
|
|
82
85
|
transition: null,
|
|
83
86
|
drawnView: null,
|
|
87
|
+
lookBase: null,
|
|
84
88
|
heightPx: 420,
|
|
85
89
|
pose: { p: [0, 0, 0], q: [0, 0, 0, 1], fov: FOV, valid: false },
|
|
86
90
|
rideMotion: 0,
|
|
@@ -89,6 +93,8 @@ export const newSpaceModel = () => ({
|
|
|
89
93
|
satellites: newSatelliteState(),
|
|
90
94
|
meteors: newMeteorState(),
|
|
91
95
|
bodyLabel: newBodyLabelState(),
|
|
96
|
+
borders: newBorderState(),
|
|
97
|
+
grid: newGridState(),
|
|
92
98
|
pick: null,
|
|
93
99
|
placeSatellite: null,
|
|
94
100
|
followModel: null,
|
|
@@ -248,7 +254,7 @@ export function createSpaceItem(model, deps) {
|
|
|
248
254
|
}
|
|
249
255
|
};
|
|
250
256
|
try {
|
|
251
|
-
const made = (slot.plain || look === "plain" ? plainPainter : painter).make(three, slot.name, { look, invalidate: () => deps.invalidate(), ratio: model.ratio(), maxTexture: deps.cap() });
|
|
257
|
+
const made = (slot.plain || look === "plain" ? plainPainter : painter).make(three, slot.name, { look, invalidate: () => deps.invalidate(), ratio: model.ratio(), maxTexture: deps.cap(), mapped: true });
|
|
252
258
|
if (typeof made.then === "function")
|
|
253
259
|
made.then(arrive, fail);
|
|
254
260
|
else
|
|
@@ -259,6 +265,8 @@ export function createSpaceItem(model, deps) {
|
|
|
259
265
|
}
|
|
260
266
|
};
|
|
261
267
|
const sunSlot = newSlot("Sun");
|
|
268
|
+
// the Moon from the painter when there is one (its picture, and finer tiles where it has them); the view's own Moon until it arrives, and if it cannot be made
|
|
269
|
+
const moonSlot = newSlot("Moon");
|
|
262
270
|
const planets = new Map();
|
|
263
271
|
for (const name of PLANETS) {
|
|
264
272
|
const positions = new Float32Array(96 * 3);
|
|
@@ -274,6 +282,10 @@ export function createSpaceItem(model, deps) {
|
|
|
274
282
|
let meteors = null;
|
|
275
283
|
let meteorTimer;
|
|
276
284
|
let nameOn = null;
|
|
285
|
+
let borders = null;
|
|
286
|
+
let placeSprites = null;
|
|
287
|
+
let placeSpritesTried = false;
|
|
288
|
+
let gridLayer = null;
|
|
277
289
|
let marksTold = false;
|
|
278
290
|
// the followed satellite's model: which satellite it is for, the drawing once it is made, and a count so that a model made for a satellite no longer followed is let go
|
|
279
291
|
const modelSlot = { key: "", drawing: null, turn: 0, parts: 0 };
|
|
@@ -348,6 +360,18 @@ export function createSpaceItem(model, deps) {
|
|
|
348
360
|
for (const name of PLANETS)
|
|
349
361
|
pos[name] = placeAround(mode, sunPos, helioOf(frame.planets[name]));
|
|
350
362
|
const radiusOf = (name) => (name === "Earth" ? 1 : RADIUS[name][mode]);
|
|
363
|
+
if (deps.painter && lookNow() !== "plain")
|
|
364
|
+
fill(moonSlot, true);
|
|
365
|
+
else if (moonSlot.look !== null) {
|
|
366
|
+
empty(moonSlot);
|
|
367
|
+
moonSlot.look = null;
|
|
368
|
+
}
|
|
369
|
+
const paintedMoon = moonSlot.drawing;
|
|
370
|
+
if (paintedMoon) {
|
|
371
|
+
paintedMoon.object.position.set(moonPos[0], moonPos[1], moonPos[2]);
|
|
372
|
+
paintedMoon.object.scale.setScalar(RADIUS["Moon"][mode]);
|
|
373
|
+
paintedMoon.light?.(moonToSun);
|
|
374
|
+
}
|
|
351
375
|
// the Sun and the planets, drawn by the painter, and the planets' orbits round the Sun
|
|
352
376
|
fill(sunSlot);
|
|
353
377
|
const sunDrawing = sunSlot.drawing;
|
|
@@ -390,7 +414,7 @@ export function createSpaceItem(model, deps) {
|
|
|
390
414
|
deps.onSatellitesError?.(error);
|
|
391
415
|
}
|
|
392
416
|
}
|
|
393
|
-
layer?.update(model.time, model.speed);
|
|
417
|
+
layer?.update(model.time, model.speed, model.drawn?.radiusPx ?? 0);
|
|
394
418
|
model.pick = layer ? (x, y, radius) => layer.pick(x, y, camera, size, radius) : null;
|
|
395
419
|
// the camera: looks at the focus body from the direction the sky was in when it was last moved, turned by yaw and tilt, as far as the zoom says; or, riding along, sits at the
|
|
396
420
|
// body and looks at the Earth
|
|
@@ -400,6 +424,7 @@ export function createSpaceItem(model, deps) {
|
|
|
400
424
|
let rideFrom = null;
|
|
401
425
|
let followed = null;
|
|
402
426
|
model.rideLost = false;
|
|
427
|
+
model.lookBase = null;
|
|
403
428
|
model.rideMotion = 0;
|
|
404
429
|
model.rideDistance = null;
|
|
405
430
|
const ride = model.ride;
|
|
@@ -432,7 +457,9 @@ export function createSpaceItem(model, deps) {
|
|
|
432
457
|
model.rideLost = true;
|
|
433
458
|
}
|
|
434
459
|
const hidden = rideFrom?.hidden ?? null;
|
|
435
|
-
moon.visible = hidden !== "Moon";
|
|
460
|
+
moon.visible = hidden !== "Moon" && !paintedMoon;
|
|
461
|
+
if (paintedMoon)
|
|
462
|
+
paintedMoon.object.visible = hidden !== "Moon";
|
|
436
463
|
if (sunDrawing)
|
|
437
464
|
sunDrawing.object.visible = hidden !== "Sun";
|
|
438
465
|
for (const [name, p] of planets)
|
|
@@ -441,7 +468,7 @@ export function createSpaceItem(model, deps) {
|
|
|
441
468
|
let fovNow = FOV;
|
|
442
469
|
let distance = 0;
|
|
443
470
|
if (rideFrom) {
|
|
444
|
-
const pose = ridePose({ position: rideFrom.position, velocity: rideFrom.velocity, look: ride.look, yaw: model.view.yaw, tilt: model.view.tilt, zoom: model.view.zoom, turn: model.rideTurn });
|
|
471
|
+
const pose = ridePose({ position: rideFrom.position, velocity: rideFrom.velocity, look: ride.look, yaw: model.view.yaw, tilt: model.view.tilt, zoom: model.view.zoom, turn: model.rideTurn, ...(ride.face ? { face: ride.face } : {}) });
|
|
445
472
|
model.rideDistance = Math.hypot(...rideFrom.position);
|
|
446
473
|
camera.position.set(pose.position[0], pose.position[1], pose.position[2]);
|
|
447
474
|
camera.up.set(pose.up[0], pose.up[1], pose.up[2]);
|
|
@@ -473,11 +500,12 @@ export function createSpaceItem(model, deps) {
|
|
|
473
500
|
const lon = model.centre.lon - way * model.view.yaw;
|
|
474
501
|
const lat = Math.max(-90, Math.min(90, baseLat - way * model.view.tilt));
|
|
475
502
|
const aim = direction(spin + lon, lat);
|
|
476
|
-
if (followed && ride && ride.view === "above") {
|
|
477
|
-
// above the satellite: on
|
|
478
|
-
// A
|
|
503
|
+
if (followed && ride && (ride.view === "above" || (ride.view === "follow" && ride.face))) {
|
|
504
|
+
// above the satellite, or a follow that was asked to face a way: on a line from the satellite, looking at it. With no facing, straight above, the way it is going at the top of the picture.
|
|
505
|
+
// A facing puts the camera ahead, behind, left, right, down or up; a drag turns and tips from there.
|
|
479
506
|
distance = Math.max(1e-4, ride.distanceKm / 6371 / Math.max(1e-9, model.view.zoom));
|
|
480
|
-
const
|
|
507
|
+
const base = ride.face ? faceOffset(ride.face) : { yaw: 0, tilt: 0 };
|
|
508
|
+
const up = aboveAxes(followed.place, followed.velocity, base.yaw + model.view.yaw * RAD, base.tilt + Math.max(-80, Math.min(80, model.view.tilt)) * RAD);
|
|
481
509
|
target.set(focusPos[0], focusPos[1], focusPos[2]);
|
|
482
510
|
camera.position.set(target.x + up.offset[0] * distance, target.y + up.offset[1] * distance, target.z + up.offset[2] * distance);
|
|
483
511
|
camera.up.set(up.up[0], up.up[1], up.up[2]);
|
|
@@ -486,6 +514,8 @@ export function createSpaceItem(model, deps) {
|
|
|
486
514
|
camera.far = Math.max(2000, distance * 4 + (mode === "true" ? 40 * 23_481 : 400));
|
|
487
515
|
}
|
|
488
516
|
else {
|
|
517
|
+
if (way === 1 && focus === "Earth")
|
|
518
|
+
model.lookBase = { lon: model.centre.lon + spin - frame.spin, lat: baseLat };
|
|
489
519
|
distance = Math.max(1.05 * focusRadius, (fit * focusRadius) / Math.max(1e-9, model.view.zoom));
|
|
490
520
|
target.set(focusPos[0], focusPos[1], focusPos[2]);
|
|
491
521
|
camera.position.set(target.x + aim[0] * distance, target.y + aim[1] * distance, target.z + aim[2] * distance);
|
|
@@ -550,6 +580,7 @@ export function createSpaceItem(model, deps) {
|
|
|
550
580
|
for (const name of BODY_NAMES)
|
|
551
581
|
px[name] = radiusPxOf(name);
|
|
552
582
|
model.drawn = { frame, distance, radiusPx: px.Earth };
|
|
583
|
+
layer?.resize(px.Earth);
|
|
553
584
|
let paintedBodies = sunSlot.drawing ? 1 : 0;
|
|
554
585
|
for (const p of planets.values())
|
|
555
586
|
if (p.slot.drawing)
|
|
@@ -558,7 +589,11 @@ export function createSpaceItem(model, deps) {
|
|
|
558
589
|
for (const held of moonSlots.values())
|
|
559
590
|
if (held.slot.drawing?.object.visible)
|
|
560
591
|
paintedMoons += 1;
|
|
561
|
-
|
|
592
|
+
let tiled = 0;
|
|
593
|
+
for (const drawing of [sunSlot.drawing, moonSlot.drawing, ...[...planets.values()].map((p) => p.slot.drawing), ...[...moonSlots.values()].map((held) => held.slot.drawing)])
|
|
594
|
+
if (drawing?.tiles?.shown != null)
|
|
595
|
+
tiled += 1;
|
|
596
|
+
model.painted = { bodies: paintedBodies, moons: paintedMoons, held: 0, moon: paintedMoon !== undefined, tiles: tiled };
|
|
562
597
|
// the followed satellite as a model, when the page has one for it: made once, placed where the satellite is, pointed the way it flies, sized to read and lit by the Sun
|
|
563
598
|
const satellitePainter = deps.satellitePainter?.();
|
|
564
599
|
const group = followed ? model.satellites.groups.get(followed.ref.group) : undefined;
|
|
@@ -611,10 +646,12 @@ export function createSpaceItem(model, deps) {
|
|
|
611
646
|
model.followModel = null;
|
|
612
647
|
}
|
|
613
648
|
const sunToSun = unit([-frame.sun[0], -frame.sun[1], -frame.sun[2]]);
|
|
614
|
-
|
|
649
|
+
const bodyView = { camera, width: size.width, height: size.height };
|
|
650
|
+
sunDrawing?.update?.({ toSun: sunToSun, ms: model.time, radiusPx: px.Sun, view: bodyView });
|
|
651
|
+
paintedMoon?.update?.({ toSun: moonToSun, ms: model.time, radiusPx: px.Moon, view: bodyView });
|
|
615
652
|
for (const name of PLANETS) {
|
|
616
653
|
const p = planets.get(name);
|
|
617
|
-
p.slot.drawing?.update?.({ toSun: p.toSun, ms: model.time, radiusPx: px[name] });
|
|
654
|
+
p.slot.drawing?.update?.({ toSun: p.toSun, ms: model.time, radiusPx: px[name], view: bodyView });
|
|
618
655
|
}
|
|
619
656
|
if (painter.moons && lookNow() !== "plain") {
|
|
620
657
|
const now = performance.now();
|
|
@@ -646,7 +683,7 @@ export function createSpaceItem(model, deps) {
|
|
|
646
683
|
drawing.object.scale.setScalar(drawn);
|
|
647
684
|
const moonPx = away <= drawn * 1.001 ? 1e5 : ((size.height / 2) * (drawn / Math.sqrt(away * away - drawn * drawn))) / half;
|
|
648
685
|
drawing.light?.(p.toSun);
|
|
649
|
-
drawing.update?.({ toSun: p.toSun, ms: model.time, radiusPx: moonPx });
|
|
686
|
+
drawing.update?.({ toSun: p.toSun, ms: model.time, radiusPx: moonPx, view: bodyView });
|
|
650
687
|
}
|
|
651
688
|
}
|
|
652
689
|
let soonest = Number.POSITIVE_INFINITY;
|
|
@@ -667,9 +704,10 @@ export function createSpaceItem(model, deps) {
|
|
|
667
704
|
clearTimeout(releaseTimer);
|
|
668
705
|
releaseTimer = soonest < Number.POSITIVE_INFINITY ? setTimeout(() => deps.invalidate(), soonest + 50) : undefined;
|
|
669
706
|
}
|
|
707
|
+
model.painted.held = moonSlots.size;
|
|
670
708
|
const ratio = model.ratio();
|
|
671
709
|
const earthPx = Math.min(px.Earth, 1e5) * ratio;
|
|
672
|
-
textures.sync({ day: earthPx, night: earthPx, clouds: earthPx, water: earthPx, moon: Math.min(px.Moon, 1e5) * ratio });
|
|
710
|
+
textures.sync({ day: earthPx, night: earthPx, clouds: earthPx, water: earthPx, moon: paintedMoon ? 0 : Math.min(px.Moon, 1e5) * ratio });
|
|
673
711
|
if (deps.onLabels && model.labels) {
|
|
674
712
|
const places = {};
|
|
675
713
|
for (const name of BODY_NAMES) {
|
|
@@ -711,6 +749,7 @@ export function createSpaceItem(model, deps) {
|
|
|
711
749
|
deps.onPlaces({
|
|
712
750
|
width: size.width,
|
|
713
751
|
height: size.height,
|
|
752
|
+
radius: hidden === "Earth" || rideFrom ? 0 : Math.min(px.Earth, 1e5),
|
|
714
753
|
at(lon, lat, out) {
|
|
715
754
|
const la = lat * RAD;
|
|
716
755
|
const lo = lon * RAD;
|
|
@@ -737,6 +776,14 @@ export function createSpaceItem(model, deps) {
|
|
|
737
776
|
},
|
|
738
777
|
});
|
|
739
778
|
}
|
|
779
|
+
const spriteData = deps.placeSprites?.() ?? null;
|
|
780
|
+
if (spriteData && !placeSprites && !placeSpritesTried) {
|
|
781
|
+
placeSprites = createPlaceSprites(three, earth, sunEarth);
|
|
782
|
+
placeSpritesTried = true;
|
|
783
|
+
// told once: without `Points` the page's layer draws these rings itself
|
|
784
|
+
deps.onPlaceRings?.(placeSprites !== null);
|
|
785
|
+
}
|
|
786
|
+
placeSprites?.sync(spriteData, model.ratio(), size.width, size.height, model.light === "lit");
|
|
740
787
|
// the name written on the Earth: made the first time the settings ask for it; none while a ride along a body hides the Earth
|
|
741
788
|
if (model.bodyLabel.settings && !nameOn)
|
|
742
789
|
nameOn = createBodyLabelLayer(three, earth, model.bodyLabel, { invalidate: () => deps.invalidate(), ...(deps.onLabelError ? { onError: deps.onLabelError } : {}) });
|
|
@@ -786,10 +833,13 @@ export function createSpaceItem(model, deps) {
|
|
|
786
833
|
const ground = new three.Vector3();
|
|
787
834
|
const eye = camera.position;
|
|
788
835
|
const turned = earth.quaternion;
|
|
836
|
+
ground.set(0, 0, 0).project(camera);
|
|
837
|
+
const disc = { x: ((ground.x + 1) / 2) * size.width, y: ((1 - ground.y) / 2) * size.height, radius: Math.min(px.Earth, 1e5) };
|
|
789
838
|
deps.onCities({
|
|
790
839
|
width: size.width,
|
|
791
840
|
height: size.height,
|
|
792
841
|
radius: Math.min(px.Earth, 1e5),
|
|
842
|
+
...(ground.z > -1 && ground.z < 1 ? { disc } : {}),
|
|
793
843
|
project(lon, lat, out) {
|
|
794
844
|
const phi = lat * RAD;
|
|
795
845
|
const lambda = lon * RAD;
|
|
@@ -826,6 +876,34 @@ export function createSpaceItem(model, deps) {
|
|
|
826
876
|
clearTimeout(meteorTimer);
|
|
827
877
|
meteorTimer = Number.isFinite(wait) ? setTimeout(() => deps.invalidate(), wait) : undefined;
|
|
828
878
|
}
|
|
879
|
+
// the borders, on the Earth: made the first time a set is switched on, above the clouds and under the air; the view's middle is the point under the camera, as far round as its horizon
|
|
880
|
+
if ((model.borders.countries || model.borders.regions) && !borders && !model.borders.stats.failed) {
|
|
881
|
+
try {
|
|
882
|
+
borders = createBorderLayer(three, earth, model.borders, () => deps.invalidate(), 3.5);
|
|
883
|
+
}
|
|
884
|
+
catch (error) {
|
|
885
|
+
model.borders.stats.failed = true;
|
|
886
|
+
model.borders.onError?.(error);
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
if (borders) {
|
|
890
|
+
const turn = earth.rotation.y;
|
|
891
|
+
const fx = camera.position.x * Math.cos(turn) - camera.position.z * Math.sin(turn);
|
|
892
|
+
const fz = camera.position.x * Math.sin(turn) + camera.position.z * Math.cos(turn);
|
|
893
|
+
const far = Math.hypot(fx, camera.position.y, fz) || 1;
|
|
894
|
+
borders.sync({ points: [{ lon: Math.atan2(fx, fz) / RAD, lat: Math.asin(Math.max(-1, Math.min(1, camera.position.y / far))) / RAD }], angle: Math.acos(Math.min(1, 1 / far)) / RAD, radius: Math.min(px.Earth, 1e5) });
|
|
895
|
+
}
|
|
896
|
+
// the grid, on the Earth: made the first time it is switched on, over the ground and under the clouds
|
|
897
|
+
if (model.grid.on && !gridLayer && !model.grid.stats.failed) {
|
|
898
|
+
try {
|
|
899
|
+
gridLayer = createGridLayer(three, earth, model.grid, sunEarth, 2.5);
|
|
900
|
+
}
|
|
901
|
+
catch (error) {
|
|
902
|
+
model.grid.stats.failed = true;
|
|
903
|
+
model.grid.onError?.(error);
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
gridLayer?.sync(Math.min(px.Earth, 1e5));
|
|
829
907
|
if (model.rideLost)
|
|
830
908
|
deps.onRideLost?.();
|
|
831
909
|
if (model.transition)
|
|
@@ -842,6 +920,9 @@ export function createSpaceItem(model, deps) {
|
|
|
842
920
|
clearTimeout(meteorTimer);
|
|
843
921
|
meteors?.dispose();
|
|
844
922
|
nameOn?.dispose();
|
|
923
|
+
borders?.dispose();
|
|
924
|
+
placeSprites?.dispose();
|
|
925
|
+
gridLayer?.dispose();
|
|
845
926
|
modelSlot.turn += 1;
|
|
846
927
|
dropModel();
|
|
847
928
|
layer?.dispose();
|
|
@@ -850,6 +931,7 @@ export function createSpaceItem(model, deps) {
|
|
|
850
931
|
textures.dispose();
|
|
851
932
|
ended = true;
|
|
852
933
|
empty(sunSlot);
|
|
934
|
+
empty(moonSlot);
|
|
853
935
|
for (const held of moonSlots.values())
|
|
854
936
|
empty(held.slot);
|
|
855
937
|
moonSlots.clear();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/chikyu-earth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "Chikyu Earth 地球 — A line-drawn globe for the web: country outlines that turn at the Earth's own rate, centred on the place you give it, with an optional realistic Earth from space (three.js), the Sun, Moon and planets, satellites on their orbits, and markers for any place. A web component and an SVG string.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"earth",
|
|
@@ -195,7 +195,7 @@
|
|
|
195
195
|
},
|
|
196
196
|
"dependencies": {
|
|
197
197
|
"@johnmorrisdotca/chizu": "^1.6.0",
|
|
198
|
-
"@johnmorrisdotca/kazoku-ui": "^0.
|
|
198
|
+
"@johnmorrisdotca/kazoku-ui": "^0.41.0",
|
|
199
199
|
"d3-geo": "^3.1.1"
|
|
200
200
|
},
|
|
201
201
|
"peerDependencies": {
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
"@johnmorrisdotca/hata": "^1.8.0",
|
|
236
236
|
"@johnmorrisdotca/hoshi-stars": "^0.30.0",
|
|
237
237
|
"@johnmorrisdotca/kuni": "^1.6.1",
|
|
238
|
-
"@johnmorrisdotca/wakusei-planets": "^0.
|
|
238
|
+
"@johnmorrisdotca/wakusei-planets": "^0.37.1",
|
|
239
239
|
"@playwright/test": "1.64.0",
|
|
240
240
|
"@sveltejs/vite-plugin-svelte": "^7.3.1",
|
|
241
241
|
"@types/d3-geo": "^3.1.0",
|