@johnmorrisdotca/chikyu-earth 0.53.0 → 0.55.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 +16 -0
- package/NOTICE.md +4 -0
- package/README.md +2 -2
- package/dist/flat/colours.d.ts +22 -0
- package/dist/flat/colours.js +22 -0
- package/dist/flat/element.d.ts +18 -1
- package/dist/flat/element.js +111 -22
- package/dist/flat/index.d.ts +2 -1
- package/dist/flat/index.js +2 -1
- package/dist/flat/track-state.d.ts +174 -0
- package/dist/flat/track-state.js +223 -0
- package/dist/flat/words.js +10 -0
- package/dist/passes/index.d.ts +2 -1
- package/dist/passes/index.js +1 -1
- package/dist/passes/passes.d.ts +34 -0
- package/dist/passes/passes.js +43 -2
- package/dist/photos/index.d.ts +232 -0
- package/dist/photos/index.js +284 -0
- package/dist/realistic/element-base.d.ts +6 -0
- package/dist/realistic/element-base.js +15 -2
- package/dist/space/compass.d.ts +36 -0
- package/dist/space/compass.js +72 -0
- package/dist/space/element-base.d.ts +48 -1
- package/dist/space/element-base.js +95 -6
- package/dist/space/index.d.ts +2 -1
- package/dist/space/index.js +1 -0
- package/dist/space/north-up.d.ts +86 -0
- package/dist/space/north-up.js +104 -0
- package/dist/space/path-controls.d.ts +1 -1
- package/dist/space/path-controls.js +13 -2
- package/dist/space/path-ribbons.d.ts +4 -0
- package/dist/space/path-ribbons.js +8 -4
- package/dist/space/satellite-layer.d.ts +5 -0
- package/dist/space/satellite-layer.js +16 -4
- package/dist/space/scene.d.ts +23 -0
- package/dist/space/scene.js +18 -1
- package/package.json +6 -1
package/dist/space/scene.js
CHANGED
|
@@ -13,6 +13,8 @@ import { genericSatellite, satelliteKind } from "./generic-satellite.js";
|
|
|
13
13
|
import { followSpin } from "./follow.js";
|
|
14
14
|
import { coverBody, covers } from "../sky/cover.js";
|
|
15
15
|
import { beginPlaceSprites, createPlaceSprites } from "../markers/place-sprites.js";
|
|
16
|
+
import { localNorth, northUpYaw, screenAngle } from "./north-up.js";
|
|
17
|
+
import { trackStateOfScene } from "../flat/track-state.js";
|
|
16
18
|
import { ABOVE_MODEL_SHARE, aboveAxes, aboveModelShare, MODEL_HANDOVER_PX, MODEL_RADIUS_SHARE, modelMatrix, modelRadius, satelliteAxes } from "./satellite-model.js";
|
|
17
19
|
import { createSatelliteLayer, newSatelliteState } from "./satellite-layer.js";
|
|
18
20
|
import { paintMinute } from "../paint/buffer.js";
|
|
@@ -133,6 +135,7 @@ export const newSpaceModel = () => ({
|
|
|
133
135
|
pose: { p: [0, 0, 0], q: [0, 0, 0, 1], fov: FOV, valid: false },
|
|
134
136
|
rideMotion: 0,
|
|
135
137
|
rideTurn: 0,
|
|
138
|
+
rideTrack: null,
|
|
136
139
|
rideDistance: null,
|
|
137
140
|
satellites: newSatelliteState(),
|
|
138
141
|
meteors: newMeteorState(),
|
|
@@ -698,7 +701,9 @@ export function createSpaceItem(model, deps) {
|
|
|
698
701
|
// A facing puts the camera ahead, behind, left, right, down or up; a drag turns and tips from there.
|
|
699
702
|
distance = Math.max(1e-4, ride.distanceKm / 6371 / Math.max(1e-9, model.view.zoom));
|
|
700
703
|
const base = ride.face ? faceOffset(ride.face) : { yaw: 0, tilt: 0 };
|
|
701
|
-
|
|
704
|
+
// north up (the view above a satellite only): the picture is turned so north is at the top, less near a pole; a drag turns it from there
|
|
705
|
+
const north = ride.view === "above" && ride.up === "north" ? northUpYaw(followed.place, followed.velocity) : null;
|
|
706
|
+
const up = aboveAxes(followed.place, followed.velocity, base.yaw + (north ? north.yaw * north.weight : 0) + model.view.yaw * RAD, base.tilt + Math.max(-80, Math.min(80, model.view.tilt)) * RAD);
|
|
702
707
|
target.set(focusPos[0], focusPos[1], focusPos[2]);
|
|
703
708
|
camera.position.set(target.x + up.offset[0] * distance, target.y + up.offset[1] * distance, target.z + up.offset[2] * distance);
|
|
704
709
|
camera.up.set(up.up[0], up.up[1], up.up[2]);
|
|
@@ -755,6 +760,18 @@ export function createSpaceItem(model, deps) {
|
|
|
755
760
|
camera.clearViewOffset();
|
|
756
761
|
camera.updateProjectionMatrix();
|
|
757
762
|
camera.updateMatrixWorld();
|
|
763
|
+
// the ridden satellite's heading and where north is in the picture, worked out with the draw that is being made, never on a timer
|
|
764
|
+
{
|
|
765
|
+
const sat = followed ?? ridden;
|
|
766
|
+
if (sat && ride) {
|
|
767
|
+
const state = trackStateOfScene(sat.place, sat.velocity, model.time);
|
|
768
|
+
const north = localNorth(sat.place);
|
|
769
|
+
const northDeg = north ? screenAngle([camera.quaternion.x, camera.quaternion.y, camera.quaternion.z, camera.quaternion.w], north) : null;
|
|
770
|
+
model.rideTrack = { ...state, northDeg, travelDeg: northDeg === null ? null : (northDeg + state.bearingDeg) % 360 };
|
|
771
|
+
}
|
|
772
|
+
else
|
|
773
|
+
model.rideTrack = null;
|
|
774
|
+
}
|
|
758
775
|
// always lit: the light comes from the camera's side of the Earth (the Sun, Moon and planets stay where they are)
|
|
759
776
|
if (model.light === "lit")
|
|
760
777
|
sunEarth.value.set(camera.position.x, camera.position.y, camera.position.z).normalize();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@johnmorrisdotca/chikyu-earth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.55.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",
|
|
@@ -191,6 +191,11 @@
|
|
|
191
191
|
"import": "./dist/place/index.js",
|
|
192
192
|
"default": "./dist/place/index.js"
|
|
193
193
|
},
|
|
194
|
+
"./photos": {
|
|
195
|
+
"types": "./dist/photos/index.d.ts",
|
|
196
|
+
"import": "./dist/photos/index.js",
|
|
197
|
+
"default": "./dist/photos/index.js"
|
|
198
|
+
},
|
|
194
199
|
"./package.json": "./package.json"
|
|
195
200
|
},
|
|
196
201
|
"files": [
|