mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-11 13:52:19 +00:00
fix(globe): keep the Navara camera above the ground
Navara 0.2.1's camera controller has no terrain or tile collision; its only zoom limit, minimumZoomDistance, is a distance from the Earth's centre, so a wheel zoom near the ground went through it (to -5.9 km). groundFloor.js runs on the engine's preRender after the camera model reads Navara's camera. While the camera is free (no flight, no lookAt target) and below 20 km it samples the ground under it (tiles, else terrain, else the ellipsoid; at most every 250 ms or 20 m), feeds Navara's clamp (minimumZoomDistance = geocentric radius of the ground point + 30 m, sent on changes over 10 m, reset to Navara's default during flights and above 20 km) so the wheel stops smoothly, and lifts a camera still below ground + 30 m straight up without camera.commanded. It only lifts, so it cannot oscillate with the shell's ground guard, whose lift is a flight the floor stands aside for.
This commit is contained in:
1 parent
4ded3fbf15
commit
64d3297301
6 files changed
+347
No files matched your search
@@ -1764,6 +1764,7 @@
|
||||
"src/globe/navara/cameraModel.js",
|
||||
"src/globe/navara/createNavaraEngine.js",
|
||||
"src/globe/navara/credits.js",
|
||||
"src/globe/navara/groundFloor.js",
|
||||
"src/globe/navara/index.js",
|
||||
"src/globe/navara/input.js",
|
||||
"src/globe/navara/internals.js",
|
||||
|
||||
Reference in new issue
Block a user