mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Never fly to a mission while the cockpit holds the camera
Focusing a mission does nothing in the cockpit, so the layer row's arrows select the next mission without moving the camera, as its label and dot already do. Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
6c960eb3c9
commit
cdde80f3ad
4 files changed
+33
-6
No files matched your search
@@ -11,7 +11,11 @@ import {
|
||||
toRadians,
|
||||
vec,
|
||||
} from '../../geo/vector.js';
|
||||
import { MISSION_GLOBE_VIEW_RANGE_M, MISSION_FOCUS_RANGE_M } from './policy.js';
|
||||
import {
|
||||
MISSION_GLOBE_VIEW_RANGE_M,
|
||||
MISSION_FOCUS_RANGE_M,
|
||||
cockpitActive,
|
||||
} from './policy.js';
|
||||
import { cameraOf, canvasOf, findCamera } from '../../render/rendererOf.js';
|
||||
|
||||
export function createSelection({
|
||||
@@ -122,6 +126,9 @@ export function createSelection({
|
||||
|
||||
function focusMission(launch) {
|
||||
if (!layerState._viewer || !launch || !layerState._enabled) return;
|
||||
// The cockpit holds the camera: a mission chosen there, by its label,
|
||||
// its dot or the layer row's arrows, is selected without flying to it.
|
||||
if (cockpitActive()) return;
|
||||
stopMissionZoomAnchor();
|
||||
parts.rendering.selectLaunchEntity(launch.id);
|
||||
const camera = cameraOf(layerState._viewer);
|
||||
|
||||
Reference in new issue
Block a user