mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
Remove always-true layer availability and leftover viewer paths
Every layer draws on both engines, so the per-engine availability machinery always answered yes. The renderer manifest is now the id to display map plus the wind flow backend; the catalog filter, the voice and QA-probe refusals and the engine-kind checks go with it. The Navara notice lists the same layers in the same words. Paths that read the Cesium viewer behind an engine that is always there are gone: the Recent Imagery viewer fallbacks, the shell's imagery-host service (one shared host module remains), the engineless map controller, viewer gates in voice actions, world packets and camera verbs, the orientation controls' tracked-entity fallback, and the Bhote Koshi and FIRMS Cesium-shaped paths. setCameraInputs, which nothing called, leaves the contract; suspensions remain. Smaller duplicates go too: one tracker-release helper for navigation and location, the no-op frame latch, missing-engine guards, one name for the injected display, flat bikeshare and installations displays, one overlay host and binder, one name per world-overlay method, and stub-viewer guards in the Cesium engine. Layers that still read the viewer keep the shared init(viewer, context) entry. Behaviour is unchanged on both engines. Viewer lines fall from 849 to 750 and engine-name literals from 32 to 27.
This commit is contained in:
1 parent
371d848eec
commit
7f478e3815
279 files changed
+1570
-3104
No files matched your search
@@ -5,8 +5,7 @@ import { t } from '../i18n/index.js';
|
||||
// The camera is the globe engine's, and so is the follow: the followed
|
||||
// entity is engine.camera.following().native (on Cesium also an entity the
|
||||
// app put on viewer.trackedEntity). The viewer, when callers pass one, is
|
||||
// read only for its clock, and for its tracked entity when the engine
|
||||
// reports no follow.
|
||||
// read only for its clock.
|
||||
|
||||
// Cesium's EasingFunction.CUBIC_IN_OUT (tween.js Cubic.InOut).
|
||||
function cubicInOut(amount) {
|
||||
@@ -14,9 +13,9 @@ function cubicInOut(amount) {
|
||||
return 0.5 * ((amount -= 2) * amount * amount + 2);
|
||||
}
|
||||
|
||||
function followedEntity(engine, viewer) {
|
||||
function followedEntity(engine) {
|
||||
const handle = engine?.camera.following?.();
|
||||
return handle ? (handle.native ?? null) : (viewer?.trackedEntity ?? null);
|
||||
return handle?.native ?? null;
|
||||
}
|
||||
|
||||
// An engine's own follow (no tracked entity: Navara): its handle, which
|
||||
@@ -24,7 +23,7 @@ function followedEntity(engine, viewer) {
|
||||
function engineFollow(engine, viewer) {
|
||||
const handle = engine?.camera.following?.();
|
||||
return handle &&
|
||||
!followedEntity(engine, viewer) &&
|
||||
!followedEntity(engine) &&
|
||||
typeof handle.target === 'function' &&
|
||||
typeof handle.retarget === 'function'
|
||||
? handle
|
||||
@@ -90,7 +89,7 @@ export function pickViewTarget(engine) {
|
||||
*/
|
||||
export function readCameraTargetFrame(engine, viewer = null) {
|
||||
if (!engine) return null;
|
||||
const entity = followedEntity(engine, viewer);
|
||||
const entity = followedEntity(engine);
|
||||
const follow = engineFollow(engine, viewer);
|
||||
const center = entity
|
||||
? trackedTarget(entity, viewer)
|
||||
@@ -151,9 +150,7 @@ function setCameraTargetFrame(engine, frame, viewer = null) {
|
||||
return true;
|
||||
}
|
||||
try {
|
||||
const trackedTransform = followedEntity(engine, viewer)
|
||||
? camera.transform()
|
||||
: null;
|
||||
const trackedTransform = followedEntity(engine) ? camera.transform() : null;
|
||||
camera.lookAt(frame.target, {
|
||||
heading: normalizedHeading(frame.heading),
|
||||
pitch: frame.pitch,
|
||||
@@ -241,14 +238,14 @@ export function createCameraOrientationAnimator(
|
||||
if (!engine) return false;
|
||||
if (duration <= 0)
|
||||
return setCameraTargetFrame(engine, { ...frame, ...destination }, viewer);
|
||||
const entity = followedEntity(engine, viewer);
|
||||
const entity = followedEntity(engine);
|
||||
pending = destination;
|
||||
const start = now();
|
||||
const headingDelta = geo.math.negativePiToPi(
|
||||
destination.heading - frame.heading,
|
||||
);
|
||||
remove = engine.frames.preUpdate.addEventListener(() => {
|
||||
if (engine.isDestroyed() || followedEntity(engine, viewer) !== entity) {
|
||||
if (engine.isDestroyed() || followedEntity(engine) !== entity) {
|
||||
cancel();
|
||||
return;
|
||||
}
|
||||
@@ -395,7 +392,6 @@ export function bindCameraOrientationControls({
|
||||
// moveEnd fires when the camera stops, which is where the pick is affordable.
|
||||
subscribe(engine?.camera.moveEnd, refreshTilt);
|
||||
subscribe(engine?.camera.followChanged, animator.cancel);
|
||||
subscribe(viewer?.trackedEntityChanged, animator.cancel);
|
||||
for (const type of ['pointerdown', 'wheel']) {
|
||||
const canvas = engine?.host.canvas;
|
||||
canvas?.addEventListener?.(type, animator.cancel, { passive: true });
|
||||
|
||||
Reference in new issue
Block a user