mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-20 02:02:21 +00:00
fix(render): wheel zoom no longer stalls with an icon under the canvas centre
Below 150 km Cesium sizes a zoom step from the depth it picks at the canvas centre. Since #1835 an icon drawn over depth wrote a depth just past the near plane, which that pick took for a surface a near plane's distance from the camera: zooming in returned early and zooming out moved by centimetres. Over-depth rows now write a depth of exactly 0 in the fragment shader. It is never discarded (the flicker #1835 fixed stays fixed) and the depth pick reads it as nothing drawn, keeping the ground under the icon. Adds scripts/qa-zoom-under-icon.mjs (real browser) and a source-level unit test.
This commit is contained in:
1 parent
2796c2547b
commit
8b122dc259
5 files changed
+268
-9
No files matched your search
@@ -93,6 +93,16 @@ settling. Oblique views below 300 km are left alone.
|
||||
`QA_BASE_URL=http://localhost:4173 node scripts/qa-zoom-out-guard.mjs` exercises
|
||||
the real browser controller at desktop and phone widths with keyless fixtures.
|
||||
|
||||
Below 150 km Cesium sizes a wheel or pinch zoom step from the depth it picks at
|
||||
the canvas centre. Icons drawn over depth (aircraft, vessels and most markers:
|
||||
`disableDepthTest: Infinity`) sit on the near plane and write a depth of
|
||||
exactly 0 there (`src/render/cesium/iconSetPrimitive.js`), which that pick
|
||||
reads as nothing drawn, so it keeps the ground under the icon. Any depth past
|
||||
the near plane would be taken for a surface a near plane's distance from the
|
||||
camera, and the zoom would stop while an icon is under the centre.
|
||||
`QA_BASE_URL=http://localhost:5173 node scripts/qa-zoom-under-icon.mjs` checks
|
||||
this against a dev server (`npm run dev`).
|
||||
|
||||
Cesium's free look (Shift+drag, which turns the camera in place) works only
|
||||
below 1,000 km. Above that height a few drags could turn the whole planet out of
|
||||
frame and leave only stars, so Shift+drag does nothing there. Cesium also turns
|
||||
|
||||
Reference in new issue
Block a user