mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
fix(selection): a click that follows a contact from straight down keeps the camera's heading
A click keeps the camera's view of the contact it follows (keptViewFrom), but a follow frames the eye from its offset alone, its heading the way the offset leans. Seen from straight down, the eye's view at a contact off the centre leans only as far as the Earth curves between them, towards the eye, so the follow turned the camera to face the contact's bearing (from north to 298 degrees on a click 40 km out from 60 km up). followViewFrom keeps the range and the tilt to the contact's horizon and turns them to the pose's heading, a view straight down kept a hair off vertical so its heading holds. Flights, Military Flights and trains follow from it; a world-focus fly-to, which sets its orientation itself, keeps the view as it was.
This commit is contained in:
1 parent
d3cc95e9a6
commit
b277b55547
7 files changed
+107
-10
No files matched your search
@@ -84,7 +84,7 @@ export function createTracking({
|
||||
const { clearFocusTarget } = services.focus;
|
||||
const { isMilitaryLayerActive, isMilitaryIcao } = services.militaryRegistry;
|
||||
const { trackedLabelModelFromText, refreshTrackedReadout } = services.readout;
|
||||
const { FOLLOW_MIN_RANGE_M, SELECTION_FOLLOW_TRANSITION_S, keptViewFrom } =
|
||||
const { FOLLOW_MIN_RANGE_M, SELECTION_FOLLOW_TRANSITION_S, followViewFrom } =
|
||||
services.camera;
|
||||
const { resolvePickId, isOwnedByOtherLayer } = services.picking;
|
||||
const flightsLayer = layer;
|
||||
@@ -1145,7 +1145,7 @@ export function createTracking({
|
||||
const camera = cameraOf(flightState._viewer);
|
||||
camera.cancelFlight();
|
||||
const kept = keepView
|
||||
? keptViewFrom(camera.pose(), getTrackedPosition())
|
||||
? followViewFrom(camera.pose(), getTrackedPosition())
|
||||
: null;
|
||||
flightState._followTarget = entityFollowTarget(flightState._trackedEntity, {
|
||||
position: getTrackedPosition,
|
||||
|
||||
Reference in new issue
Block a user