mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Keep the camera still in the cockpit when a mission's dot is clicked or its orbit arrives
The cockpit holds the camera: the mission dot, like its label, selects the mission there without flying to it, and a mission picked in the cockpit is not flown to when the active satellite lookup returns. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
813c6b23ea
commit
6c960eb3c9
6 files changed
+46
-20
No files matched your search
@@ -1,8 +1,9 @@
|
||||
- Space Missions going off no longer acts on a launch hovered, selected or
|
||||
replayed meanwhile, and Satellites keeps the state it was saved with when
|
||||
it is still busy (unless it was switched on or off by hand meanwhile); a Satellites setting changed during a mission, such as
|
||||
a place search ending tracking, is kept when the mission ends. A click on
|
||||
a mission label is a click on the card on top, so no layer selects, turns
|
||||
on, flies to or opens the link of what lies under it; in the cockpit the
|
||||
label selects its mission without moving the camera (manjunath22466,
|
||||
samehkhamis, #1829).
|
||||
it is still busy (unless it was switched on or off by hand meanwhile); a
|
||||
Satellites setting changed during a mission, such as a place search ending
|
||||
tracking, is kept when the mission ends. A click on a mission label is a
|
||||
click on the card on top, so no layer selects, turns on, flies to or opens
|
||||
the link of what lies under it; in the cockpit the label and the dot select
|
||||
their mission without moving the camera (manjunath22466, samehkhamis,
|
||||
#1829).
|
||||
@@ -7571,7 +7571,7 @@ silently demoting every later lookup for the session.
|
||||
protected-card path. Disable tears the tier down completely.
|
||||
Coverage/viewshed semantics unchanged.
|
||||
- **Satellites**: every point moves every frame. Each satellite's SGP4 sample (position, velocity, gravity and its rate of change; `src/layers/satellites/motion.js`) is reckoned forward or back to the world time and turned into the Earth-fixed frame, so points glide at any play speed instead of stepping once a second. Core satellites take a fresh sample every second, or as soon as the world time is 30 s from their sample (fast play, a seek), which keeps every point within about 10 m of SGP4; Starlink extras are sampled round-robin, more per frame the faster time plays, and a point more than two minutes from its sample waits for the next one. Hidden points are not moved until shown. Orbit rings rotate about Earth's Z by ΔGMST every ~1s (exact inertial→ECEF compensation; no SGP4 re-runs); the tracked satellite propagates per frame with one shared epoch for dot/label/camera. Verified: ISS holds <1km perpendicular to its ring while tracked. Pass prediction (`src/data/satellitePass.js`; `getNextSatellitePass`, `getNextIssPass`) scans at 20s, bisects rise/set to ~0.2s, fits the peak with a parabola, and marks a pass visible when the satellite is outside a cylindrical Earth shadow while the observer's Sun is at or below −6°. `next_iss_pass` preserves its geometric-pass ordering and appends visibility metadata. General `next_satellite_pass` accepts a loaded NORAD ID or unambiguous name, searches 24 hours and optionally requires estimated visibility. These estimates do not account for weather or satellite brightness.
|
||||
- **Space Missions (30d)**: recent launches render as bounded shared-host, horizon-occluded mission markers using Launch Library 2 v2.3 detailed records. Enabling the layer reveals its own right-rail button and roster and enables the required satellite layer; it does not touch Context. Before applying its temporary dense/hidden Satellite mode, Space Missions snapshots the complete standalone Satellite parameter set and exact enabled-layer set. Disabling Space Missions from Data Layers hides its rail button and panel and restores those parameters and the exact prior enabled state, so a Satellite layer that was already on stays on while a mode-owned dependency returns off; enabling Satellites by itself remains independent. An explicit user or voice Satellites OFF requested after Space Missions ON exits Space Missions, including after returning from Stories; scene, story, preset and other programmatic Satellites changes do not. The controls under the Space Missions row cycle through available launches. Selecting a mission isolates its launch-to-orbit transfer and dashed satellite orbit, fills the Space Missions panel with details, navigation, and replay controls, and animates a small phase-colored marker along the exact displayed Cartesian samples. Marker hit testing drill-picks through photorealistic tiles so the depth-test-free tactical dot remains reliably selectable. Clicking the launch name on the globe selects and focuses the same mission as its dot (in the cockpit, which holds the camera, it selects without moving); what is drawn beneath the name is not picked, and the other layers still hear the click as one on the name. The name is an interactive world-overlay label, so it is the card on top for every click handler (`clickCard`, `isUnderOtherCard` in `src/data/pickRegistry.js`): no other layer selects, turns on, focuses or opens the link of a contact, card or camera that lies under the name, and their selections stay. The selected pad is the camera's zoom pivot: the overview remains centered on its launch site, wheel zoom approaches that site instead of drifting elsewhere, and camera pitch progressively changes from global nadir to an oblique close 3D view. Its protected shared-host callout remains visible and expands to include both mission and launch-site names. `FOCUS` flies directly to a 12 km oblique frame around the selected launch site and retains the same anchored zoom/orbit behavior. `REPLAY ASCENT` resets the selected marker at the pad, frames it from an oblique third-person angle, and follows it through the mission-specific compressed ascent directly into one orbital lap at the default `1×` rate. A live `0.25×`–`4×` slider changes ascent and orbit playback speed; adjusting it mid-replay preserves the current path position and historical mission timestamp. Re-entry/recovery cannot be inserted into replay. At orbit insertion the camera smoothly pulls back over the first fifth of the orbital replay and pitches to a globe-scale nadir view while continuing to target the moving replay point. Replay Cancel, mission navigation, deselection, layer disable, and data refresh all release camera ownership. Reconstructed paths are one continuous 128-sample geodetic curve: horizontal departure begins near zero while altitude rises quickly, then the climb progressively bends toward insertion without the former hard 120 km corner. Unmatched orbit fallbacks are smooth planar inclined rings rather than longitude/latitude ground-track curves. The panel lists disclosed payload names, types, operators/manufacturers, mass, multiplicity, and destination when supplied; an empty LL2 payload collection is shown as `CLASSIFIED / MULTI-PAYLOAD`. Launcher, spacecraft, and recoverable payload stages appear in a compact stage table with serial/flight/reuse details, recovery outcome/type, destination, and final coordinates when those records exist; an empty recovery collection omits the section. Stage recoveries with confirmed coordinates use those coordinates; return-to-launch-site records use the pad; downrange-only records receive an explicitly labeled estimated endpoint along the ascent azimuth. Available endpoints render as static 2 px dashed descent/recovery paths with a fixed final-position dot and an estimated atmospheric-interface segment when applicable. The ascent is geodetically densified above the ellipsoid toward the orbit's nearest insertion point, then rendered with `ArcType.NONE`, so it neither cuts through Earth nor separates from the marker. Because LL2 does not normally supply continuous ascent telemetry, pad-to-insertion paths without upstream trajectory samples are labeled `RECONSTRUCTED ESTIMATE` / `ASCENT ESTIMATE`; only supplied trajectory samples receive the replay wording. Selected-orbit framing fits the complete ring, rear-side linework uses normal scene depth occlusion, and current distance, speed, and callout data come only from a launch-year-validated satellite match. Both the loaded-caLine truncated
|
||||
- **Space Missions (30d)**: recent launches render as bounded shared-host, horizon-occluded mission markers using Launch Library 2 v2.3 detailed records. Enabling the layer reveals its own right-rail button and roster and enables the required satellite layer; it does not touch Context. Before applying its temporary dense/hidden Satellite mode, Space Missions snapshots the complete standalone Satellite parameter set and exact enabled-layer set. Disabling Space Missions from Data Layers hides its rail button and panel and restores those parameters and the exact prior enabled state, so a Satellite layer that was already on stays on while a mode-owned dependency returns off; enabling Satellites by itself remains independent. An explicit user or voice Satellites OFF requested after Space Missions ON exits Space Missions, including after returning from Stories; scene, story, preset and other programmatic Satellites changes do not. The controls under the Space Missions row cycle through available launches. Selecting a mission isolates its launch-to-orbit transfer and dashed satellite orbit, fills the Space Missions panel with details, navigation, and replay controls, and animates a small phase-colored marker along the exact displayed Cartesian samples. Marker hit testing drill-picks through photorealistic tiles so the depth-test-free tactical dot remains reliably selectable. Clicking the launch name on the globe selects and focuses the same mission as its dot (in the cockpit, which holds the camera, the name and the dot select without moving, also once the mission's orbit arrives); what is drawn beneath the name is not picked, and the other layers still hear the click as one on the name. The name is an interactive world-overlay label, so it is the card on top for every click handler (`clickCard`, `isUnderOtherCard` in `src/data/pickRegistry.js`): no other layer selects, turns on, focuses or opens the link of a contact, card or camera that lies under the name, and their selections stay. The selected pad is the camera's zoom pivot: the overview remains centered on its launch site, wheel zoom approaches that site instead of drifting elsewhere, and camera pitch progressively changes from global nadir to an oblique close 3D view. Its protected shared-host callout remains visible and expands to include both mission and launch-site names. `FOCUS` flies directly to a 12 km oblique frame around the selected launch site and retains the same anchored zoom/orbit behavior. `REPLAY ASCENT` resets the selected marker at the pad, frames it from an oblique third-person angle, and follows it through the mission-specific compressed ascent directly into one orbital lap at the default `1×` rate. A live `0.25×`–`4×` slider changes ascent and orbit playback speed; adjusting it mid-replay preserves the current path position and historical mission timestamp. Re-entry/recovery cannot be inserted into replay. At orbit insertion the camera smoothly pulls back over the first fifth of the orbital replay and pitches to a globe-scale nadir view while continuing to target the moving replay point. Replay Cancel, mission navigation, deselection, layer disable, and data refresh all release camera ownership. Reconstructed paths are one continuous 128-sample geodetic curve: horizontal departure begins near zero while altitude rises quickly, then the climb progressively bends toward insertion without the former hard 120 km corner. Unmatched orbit fallbacks are smooth planar inclined rings rather than longitude/latitude ground-track curves. The panel lists disclosed payload names, types, operators/manufacturers, mass, multiplicity, and destination when supplied; an empty LL2 payload collection is shown as `CLASSIFIED / MULTI-PAYLOAD`. Launcher, spacecraft, and recoverable payload stages appear in a compact stage table with serial/flight/reuse details, recovery outcome/type, destination, and final coordinates when those records exist; an empty recovery collection omits the section. Stage recoveries with confirmed coordinates use those coordinates; return-to-launch-site records use the pad; downrange-only records receive an explicitly labeled estimated endpoint along the ascent azimuth. Available endpoints render as static 2 px dashed descent/recovery paths with a fixed final-position dot and an estimated atmospheric-interface segment when applicable. The ascent is geodetically densified above the ellipsoid toward the orbit's nearest insertion point, then rendered with `ArcType.NONE`, so it neither cuts through Earth nor separates from the marker. Because LL2 does not normally supply continuous ascent telemetry, pad-to-insertion paths without upstream trajectory samples are labeled `RECONSTRUCTED ESTIMATE` / `ASCENT ESTIMATE`; only supplied trajectory samples receive the replay wording. Selected-orbit framing fits the complete ring, rear-side linework uses normal scene depth occlusion, and current distance, speed, and callout data come only from a lLine truncated
|
||||
When no mission is selected, the Space Missions panel presents a scrollable newest-first roster of every launch in the rolling window, including the smaller 5 px operator-colored marker, provider, and launch date. Hovering or keyboard-focusing a row shows four compact cyan corner brackets on both that roster row and its corresponding globe dot, rotates the globe at the current zoom to center it, and gives its label declutter priority without selecting it; the globe label remains unbracketed. Selecting a roster row invokes the same mission isolation and full-orbit framing as clicking its globe marker. The replay vehicle is one screen-space SVG/CSS HUD overlay rather than separate Cesium billboard, label, and reticle graphics. It is hidden during ordinary Focus and manual close views, where the standard selected launch-site label remains visible, and exists only while ascent replay is active. Its fixed pixel scale is shared by ascent and insertion, so camera range never resizes the rocket on screen before the phase boundary. Generic Launch Library pad names are reduced to their identifying suffix, and replay timestamps use a cyan state title over unprefixed white UTC date/time values. `REPLAY ASCENT` holds the unframed cyan/white rocket at the pad for a real-time `T−10` countdown, transitions through `LIFTOFF`, and attaches six tapered cyan/white ellipse waves directly below it from liftoff through insertion to convey thrust without adding scene geometry. While replay is active, the single start button is replaced by compact Play, Pause, and Cancel icon controls. Pause freezes countdown or mission time, vehicle/stage positions, camera target, labels, and thrust-wave animation; Play resumes from that exact frame, and Cancel releases replay camera ownership. The rocket and thrust group rotates from the path's live screen-space tangent, so its nose follows the visible ascent curve while the adjacent text remains upright. The camera begins as a close oblique launch chase, then smoothly widens between roughly 120 and 420 km vehicle altitude into a higher oblique context view that keeps the moving rocket targeted while exposing the ascent bend and orbit connection. At insertion the rocket/thrust glyph is replaced by the fixed-size cyan orbit dot, which the camera follows through the existing globe-scale orbit pullback. The chase camera limits per-frame yaw changes across heading wraps so it cannot abruptly cross in front of the vehicle and make ascent read in reverse; the replay-speed slider affects mission playback but not countdown duration.
|
||||
Mission world text has no native `LabelGraphics`: overview launch markers publish at most 48 ambient candidates for a 24-winner budget, while selecting a mission clears that overview source and publishes its launch-site callout, stage re-entry annotations, live/estimated payload-position readout, and orbit annotation as protected selected-lane entries. The source retains the exact former strings and colors. Static anchors reuse the Cartesian values used to build their mission geometry; the moving payload entry reads the layer's per-frame live-position cache; catalog-backed orbit annotation positions are cached in the same one-second matrix update that realigns the orbit primitive. Keyhole edge fade, horizon culling, final collision placement, and UI exclusion are owned by the shared host. Deselect restores the bounded overview, and refresh, disable, and destroy replace or clear both mission sources.
|
||||
A selected mission renders its orbit as four repeating tactical sectors, each containing one prominent cyan dot followed by one hundred thin translucent dashes. The bright dots act as orbit anchors while the subdued dash field remains depth-tested against the globe and is shown only for the selected mission.
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
import { MAX_POST_TLE_RETRIES, POST_TLE_RETRY_DELAY_MS } from './policy.js';
|
||||
import {
|
||||
MAX_POST_TLE_RETRIES,
|
||||
POST_TLE_RETRY_DELAY_MS,
|
||||
cockpitActive,
|
||||
} from './policy.js';
|
||||
|
||||
/**
|
||||
* Let pending Satellites work finish, including requests that join it while
|
||||
@@ -264,7 +268,9 @@ export function createIngestion({
|
||||
parts.selection.setSelectedMission(null, false);
|
||||
} else {
|
||||
parts.selection.setSelectedMission(layerState._selectedLaunchId, true);
|
||||
if (layerState._focusAfterActiveLookup) {
|
||||
// The cockpit holds the camera: a mission picked there is not flown
|
||||
// to when its orbit arrives.
|
||||
if (layerState._focusAfterActiveLookup && !cockpitActive()) {
|
||||
parts.selection.focusMission(
|
||||
launches.find(
|
||||
(launch) => launch.id === layerState._selectedLaunchId,
|
||||
|
||||
@@ -196,8 +196,8 @@ test("another layer's label keeps the click above mission geometry", (t) => {
|
||||
assert.deepEqual(r.focused, ['L1']);
|
||||
});
|
||||
|
||||
test('in the cockpit a mission label selects its mission without moving the camera', (t) => {
|
||||
const r = rig(t, { overlayHit: label('launch:L2') });
|
||||
test('in the cockpit a mission label or dot selects its mission without moving the camera', (t) => {
|
||||
const r = rig(t, { overlayHit: label('launch:L2'), geometryLaunchId: 'L1' });
|
||||
const previous = Object.getOwnPropertyDescriptor(globalThis, 'document');
|
||||
Object.defineProperty(globalThis, 'document', {
|
||||
configurable: true,
|
||||
@@ -213,6 +213,23 @@ test('in the cockpit a mission label selects its mission without moving the came
|
||||
}
|
||||
assert.deepEqual(r.focused, ['L2'], 'the mission is selected');
|
||||
assert.deepEqual(r.moved, [], 'the cockpit keeps the camera');
|
||||
// The dot, with no label over it, does the same.
|
||||
r.setHit(null);
|
||||
Object.defineProperty(globalThis, 'document', {
|
||||
configurable: true,
|
||||
value: {
|
||||
body: { classList: { contains: (name) => name === 'cockpit-mode' } },
|
||||
},
|
||||
});
|
||||
try {
|
||||
r.click();
|
||||
} finally {
|
||||
if (previous) Object.defineProperty(globalThis, 'document', previous);
|
||||
else delete globalThis.document;
|
||||
}
|
||||
assert.deepEqual(r.focused, ['L2', 'L1']);
|
||||
assert.deepEqual(r.moved, []);
|
||||
r.setHit(label('launch:L2'));
|
||||
// Out of the cockpit the same click moves there too.
|
||||
r.click();
|
||||
assert.deepEqual(r.moved, ['L2']);
|
||||
|
||||
@@ -5,6 +5,7 @@ import { worldClock } from '../../time/worldClock.js';
|
||||
import {
|
||||
ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID,
|
||||
ROCKET_MISSION_SELECTED_OVERLAY_SOURCE_ID,
|
||||
cockpitActive,
|
||||
} from './policy.js';
|
||||
|
||||
const HOVER_PICK_INTERVAL_MS = 120;
|
||||
@@ -154,13 +155,6 @@ function restoreCameraView(viewer, view, landedView) {
|
||||
/** The longest name a timeline mark carries, as in the mission index. */
|
||||
const MARK_LABEL_LENGTH = 27;
|
||||
|
||||
/** Whether the cockpit view is on. */
|
||||
function cockpitActive() {
|
||||
return Boolean(
|
||||
globalThis.document?.body?.classList?.contains?.('cockpit-mode'),
|
||||
);
|
||||
}
|
||||
|
||||
function markerLaunchId(hit) {
|
||||
if (
|
||||
hit?.sourceId !== ROCKET_MISSION_AMBIENT_OVERLAY_SOURCE_ID &&
|
||||
@@ -252,8 +246,8 @@ export function createLifecycle({
|
||||
// overlay. An unrelated label keeps the click above mission geometry.
|
||||
overlayClicks.add(event);
|
||||
// The label is the card on top, so every other layer and the cockpit
|
||||
// leave its click alone. In the cockpit, which holds the camera, it
|
||||
// selects the mission without moving there.
|
||||
// leave its click alone. In the cockpit, which holds the camera, the
|
||||
// label and the dot select the mission without moving there.
|
||||
return focusLaunch(markerLaunchId(hit), { move: !cockpitActive() });
|
||||
});
|
||||
const unsubscribeClick = input.onClick((event) => {
|
||||
@@ -269,6 +263,7 @@ export function createLifecycle({
|
||||
parts.rendering.launchIdFromPicks(
|
||||
parts.rendering.missionHitsAt(event.position, 12),
|
||||
),
|
||||
{ move: !cockpitActive() },
|
||||
);
|
||||
});
|
||||
hover = createLaunchHover({
|
||||
|
||||
@@ -103,3 +103,10 @@ export const TRAJECTORY_STAGE_COLORS = [
|
||||
'#ffd166',
|
||||
'#60a5fa',
|
||||
];
|
||||
|
||||
/** Whether the cockpit view is on; it holds the camera while it is. */
|
||||
export function cockpitActive() {
|
||||
return Boolean(
|
||||
globalThis.document?.body?.classList?.contains?.('cockpit-mode'),
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user