fix(cockpit): a new ride's TRACK ACQUIRED keeps its own time; an arrow during the ease back tilts on from the view; a site beyond the reach ends a focus; the horizon uses the WGS84 surface normal; a hop to the opposite side goes round the Earth; drop the unused in-frame listing

This commit is contained in:
Sameh Khamis committed 2026-11-08 17:12:04 -08:00
1 parent 7d6314b981
commit 6be8af17f1
10 files changed
+142 -170

No files matched your search

+23 -3
View File
@@ -22,8 +22,8 @@ function finiteVector(v) {
/**
* Where the camera is part-way through a hop: along the great circle
* between the two positions (never through the Earth), its distance from the
* centre interpolated linearly. Both ends may move during the hop; pass
* their positions now.
* centre interpolated linearly. Opposite ends turn about a fixed axis
* square to them, so even then the path stays off the Earth.
* @param {{x: number, y: number, z: number}} from
* @param {{x: number, y: number, z: number}} to
* @param {number} progress Eased, 0..1.
@@ -39,6 +39,27 @@ export function hopPosition(from, to, progress) {
const b = { x: to.x / rb, y: to.y / rb, z: to.z / rb };
const cosine = Math.min(1, Math.max(-1, a.x * b.x + a.y * b.y + a.z * b.z));
const omega = Math.acos(cosine);
const r = ra + (rb - ra) * p;
if (Math.PI - omega < 1e-6) {
// No single great circle joins opposite points: turn about the axis
// square to `a` that is least aligned with the Earth's.
const pole =
Math.abs(a.z) < 0.9 ? { x: 0, y: 0, z: 1 } : { x: 1, y: 0, z: 0 };
const along = pole.x * a.x + pole.y * a.y + pole.z * a.z;
const c = {
x: pole.x - along * a.x,
y: pole.y - along * a.y,
z: pole.z - along * a.z,
};
const rc = Math.hypot(c.x, c.y, c.z);
const cos = Math.cos(p * Math.PI);
const sin = Math.sin(p * Math.PI);
return {
x: (a.x * cos + (c.x / rc) * sin) * r,
y: (a.y * cos + (c.y / rc) * sin) * r,
z: (a.z * cos + (c.z / rc) * sin) * r,
};
}
let ka = 1 - p;
let kb = p;
if (omega > 1e-9) {
@@ -46,7 +67,6 @@ export function hopPosition(from, to, progress) {
ka = Math.sin((1 - p) * omega) / sine;
kb = Math.sin(p * omega) / sine;
}
const r = ra + (rb - ra) * p;
return {
x: (a.x * ka + b.x * kb) * r,
y: (a.y * ka + b.y * kb) * r,