mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-17 16:52:20 +00:00
fix(globe): the Navara follow orbits on drag and zooms to the floor
Review of Task 5: while following on Navara a left drag panned the globe about the ground point under the cursor (range 2,154 m → 54,136 m) and the wheel zoomed toward that point (462 m after 40 notches, Cesium stops at the 150 m floor). While a follow runs, Navara's spin, zoom and tilt are now suspended (input.suspendCameraInputs, which gives the app's own setCameraInputs choice back after the release) and followGestures.js turns a drag into heading and pitch of the ENU offset (a canvas width is one turn, its height half a turn; elevation kept within 2°-89°) and a wheel notch into 20 % of its range, never inside the minimum range, as Cesium's EntityView orbits the target. The offset is no longer read back from a camera the follow alone moves. Also (review item 7): a follow requests a render only when the target, the offset or a gesture changed, so a still target lets Navara idle. The contract follow check drags (range within ±5 %, target within 3 px) and turns the wheel 40 notches (never below 149 m, ends within 5 % of 150 m) on both engines with real input (qa-globe-contract's pointer gains drag and wheel); after stop it waits for Cesium's gesture inertia to end before checking that the camera is free. Contract: Cesium 73/73, Navara 79/79.
This commit is contained in:
1 parent
68ff4e1c25
commit
4e195dac6b
9 files changed
+362
-15
No files matched your search
@@ -19,6 +19,7 @@ import { createNavaraCredits } from './credits.js';
|
||||
import { createNavaraInput } from './input.js';
|
||||
import { createNavaraPicking } from './picking.js';
|
||||
import { createFollowController } from '../follow.js';
|
||||
import { navaraFollowGestures } from './followGestures.js';
|
||||
import { createNavaraMaps } from './maps.js';
|
||||
import { createNavaraSurface } from './surface.js';
|
||||
import { createGroundFloor, GROUND_FLOOR } from './groundFloor.js';
|
||||
@@ -153,6 +154,11 @@ export function createNavaraEngine(
|
||||
aim: (pose) => model.aim(pose),
|
||||
frame: followStep,
|
||||
requestRender: () => view.forceUpdate(),
|
||||
// Drag orbits and wheel scales the follow's offset (followGestures.js).
|
||||
gestures: (handlers) =>
|
||||
navaraFollowGestures(view.canvas, () =>
|
||||
input.input.suspendCameraInputs(),
|
||||
)(handlers),
|
||||
});
|
||||
Object.assign(model.camera, {
|
||||
follow: (options) => follow.follow(options),
|
||||
|
||||
Reference in new issue
Block a user