mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 10:12:18 +00:00
Follow, credits, embed views and FPS through the engine on Navara
Five places still read the Cesium viewer and so did nothing, or the wrong thing, on Navara. Each now goes through the globe contract, and Cesium behaves as before. - The Navara ground floor stands aside while the camera inputs are suspended, not only while they are switched off. The cockpit suspends them, so its eye 12 m up no longer jumps to the floor's 30 m between updates. A follow's own suspension keeps the floor on, as before. - Follow state comes from engine.camera.following() and followChanged instead of viewer.trackedEntity. Enabling CCTV during a follow no longer flies away and ends it, a new follow stamps navigation, Director cards wait while a subject is followed, and an explicit navigation stops the follow on both engines. - Navara registers every data credit, as Cesium does. The allowlist left out the layers that moved to Navara later (CCTV agencies, street-level imagery, GIBS, routing, bike feeds and others). - Annotation links and embed mode attach on every engine; their camera flights use engine.camera.flyTo. Only Cesium adds the timer that keeps an inline panel drawing. - The FPS readout counts engine.frames.postRender, so it shows on Navara. Each fix has a test that fails without it.
This commit is contained in:
1 parent
e1095ee553
commit
18f69c2699
23 files changed
+144
-158
No files matched your search
@@ -259,12 +259,15 @@ export function createNavaraEngine(
|
||||
}) ?? null;
|
||||
const { surface } = createNavaraSurface(view, hooks);
|
||||
// Navara's controller zooms through the ground; keep the camera above it.
|
||||
// With the camera inputs off nothing zooms, and the app places the camera
|
||||
// itself (the cockpit eye, 12 m up): the floor's 30 m would fight it.
|
||||
// With the camera inputs off or suspended nothing zooms, and the app places
|
||||
// the camera itself (the cockpit eye, 12 m up): the floor's 30 m would
|
||||
// fight it. A follow suspends them only to take drag and wheel itself.
|
||||
groundFloor = createGroundFloor({
|
||||
surface,
|
||||
position: () => model.camera.livePosition,
|
||||
isFree: () => model.isFree() && input.cameraInputs(),
|
||||
isFree: () =>
|
||||
model.isFree() &&
|
||||
(input.input.cameraInputsEnabled() || Boolean(follow.following())),
|
||||
lift: (position) => model.lift(position),
|
||||
setMinimumZoomDistance: (distance) =>
|
||||
input.input.setCameraOptions({ minimumZoomDistance: distance }),
|
||||
|
||||
@@ -577,6 +577,21 @@ test('the floor stands aside while the camera inputs are off (the cockpit drives
|
||||
engine.destroy();
|
||||
});
|
||||
|
||||
test('the floor stands aside while the camera inputs are suspended (the cockpit holds them)', () => {
|
||||
const { engine, view } = setup();
|
||||
view.sampleTerrainHeight = () => 100;
|
||||
const resume = engine.input.suspendCameraInputs();
|
||||
engine.camera.setView({
|
||||
destination: cartesian3.fromDegrees(2.35, 48.85, 112),
|
||||
});
|
||||
view.emit('preRender', 1);
|
||||
near(heightOf(engine), 112, 1e-6, 'the cockpit eye 12 m up is kept');
|
||||
resume();
|
||||
view.emit('preRender', 2);
|
||||
near(heightOf(engine), 130, 1e-6, 'lifted once the inputs are back');
|
||||
engine.destroy();
|
||||
});
|
||||
|
||||
test('the ground floor reports its own ground and margin (diagnostics, not contract)', () => {
|
||||
const { engine } = setup();
|
||||
assert.equal(typeof engine.groundFloor.ground, 'function');
|
||||
|
||||
Reference in new issue
Block a user