mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 00:32:21 +00:00
Fly layer focus flights through the camera port
flyToBounds takes an easing, as flyTo does: in the contract, the Cesium port and the reference recorder, pinned by a new conformance trace. The flights of radio, awareness, CCTV, submarine cables, cyclones, the launch preview, installations, ALPR, street-level framing, recent imagery, weather and world focus now go through the renderer's camera port. Street-level framing cancels its own flight handle rather than whatever flight is current. worldFocus.js no longer reaches Cesium and leaves the allow-list. Layer pose reads stay for each layer's own slice. The local GeoJSON flight stays on Cesium: gods-eye-view/infrastructure is used with plain Cesium viewers that have no renderer bound.
This commit is contained in:
1 parent
46a53bb49c
commit
c5b716b107
31 files changed
+2349
-871
No files matched your search
@@ -4,6 +4,7 @@ import {
|
||||
GLOBAL_RADIO_ALTITUDE_M,
|
||||
RADIO_GLOBE_RECENTER_MAX_HEIGHT_M,
|
||||
} from './policy.js';
|
||||
import { cameraOf } from '../../render/rendererOf.js';
|
||||
|
||||
export function createNavigation({
|
||||
state: layerState,
|
||||
@@ -229,7 +230,7 @@ export function createNavigation({
|
||||
)
|
||||
return;
|
||||
layerState._activeRadioCameraFlight = null;
|
||||
layerState._viewer.camera.cancelFlight();
|
||||
cameraOf(layerState._viewer).cancelFlight();
|
||||
}
|
||||
|
||||
function invalidateRadioCameraNavigation() {
|
||||
@@ -247,7 +248,7 @@ export function createNavigation({
|
||||
);
|
||||
}
|
||||
|
||||
function startRadioCameraFlight(navigation, options, onComplete) {
|
||||
function startRadioCameraFlight(navigation, flight, onComplete) {
|
||||
if (!radioCameraNavigationIsCurrent(navigation)) return false;
|
||||
const token = ++layerState._radioCameraFlightSequence;
|
||||
layerState._activeRadioCameraFlight = {
|
||||
@@ -260,10 +261,10 @@ export function createNavigation({
|
||||
if (completed && radioCameraNavigationIsCurrent(navigation))
|
||||
onComplete?.();
|
||||
};
|
||||
layerState._viewer.camera.flyTo({
|
||||
...options,
|
||||
complete: () => finish(true),
|
||||
cancel: () => finish(false),
|
||||
cameraOf(layerState._viewer).flyTo(flight.destination, {
|
||||
...flight.options,
|
||||
onComplete: () => finish(true),
|
||||
onCancel: () => finish(false),
|
||||
});
|
||||
return true;
|
||||
}
|
||||
@@ -280,17 +281,15 @@ export function createNavigation({
|
||||
return startRadioCameraFlight(
|
||||
navigation,
|
||||
{
|
||||
destination: Cesium.Cartesian3.fromDegrees(
|
||||
plan.lon,
|
||||
plan.lat,
|
||||
plan.height,
|
||||
),
|
||||
orientation: {
|
||||
heading: plan.heading,
|
||||
pitch: plan.pitch,
|
||||
roll: plan.roll,
|
||||
destination: { lon: plan.lon, lat: plan.lat, height: plan.height },
|
||||
options: {
|
||||
orientation: {
|
||||
heading: plan.heading,
|
||||
pitch: plan.pitch,
|
||||
roll: plan.roll,
|
||||
},
|
||||
durationS: navigation.duration,
|
||||
},
|
||||
duration: navigation.duration,
|
||||
},
|
||||
() => {
|
||||
navigation.phase = 'settled';
|
||||
@@ -340,13 +339,15 @@ export function createNavigation({
|
||||
activeNavigation,
|
||||
{
|
||||
destination: activeNavigation.recenterPlan.destination,
|
||||
orientation: {
|
||||
heading: activeNavigation.cameraState.heading,
|
||||
pitch: activeNavigation.cameraState.pitch,
|
||||
roll: activeNavigation.cameraState.roll,
|
||||
options: {
|
||||
orientation: {
|
||||
heading: activeNavigation.cameraState.heading,
|
||||
pitch: activeNavigation.cameraState.pitch,
|
||||
roll: activeNavigation.cameraState.roll,
|
||||
},
|
||||
durationS: recenterDuration,
|
||||
easing: 'cubicInOut',
|
||||
},
|
||||
duration: recenterDuration,
|
||||
easingFunction: Cesium.EasingFunction.CUBIC_IN_OUT,
|
||||
},
|
||||
() => {
|
||||
activeNavigation.recentered = true;
|
||||
@@ -363,14 +364,10 @@ export function createNavigation({
|
||||
if (!station || !radioCameraNavigationAllowed(layerState._viewer))
|
||||
return false;
|
||||
cancelActiveRadioCameraFlight();
|
||||
layerState._viewer.camera.flyTo({
|
||||
destination: Cesium.Cartesian3.fromDegrees(
|
||||
station.lon,
|
||||
station.lat,
|
||||
85_000,
|
||||
),
|
||||
duration: 1.1,
|
||||
});
|
||||
cameraOf(layerState._viewer).flyTo(
|
||||
{ lon: station.lon, lat: station.lat, height: 85_000 },
|
||||
{ durationS: 1.1 },
|
||||
);
|
||||
return true;
|
||||
}
|
||||
return {
|
||||
|
||||
Reference in new issue
Block a user