mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
Merge main into fix/earthquake-click-details
Resolves conflicts with main: a world focus target's own range past its framed radius replaces the kind's range (#1832), so a quake asks for its own range only past M6 and the earthquake framing stays its floor; FIRMS keeps main's marker stand-in under the card-on-top rule; launches keep main's label click and also read the card on top through the pick registry.
This commit is contained in:
commit
e87aa5190d
1337 files changed
+38638
-9950
No files matched your search
+10
-4
@@ -89,7 +89,8 @@ export function routeWorldFocusRequest(event, runExplicitFocus, fly) {
|
||||
* `keepView` (a click on it) keeps the camera's distance and angle: the eye
|
||||
* moves, on a straight path, to where it sees the target in the centre with
|
||||
* the view it has now (`keptViewFrom`). Any other is framed by its kind
|
||||
* (`WORLD_FOCUS_FRAMING`).
|
||||
* (`WORLD_FOCUS_FRAMING`); a target's own `rangeM`, past the framed radius,
|
||||
* stands the camera off that far instead (a target larger than its kind).
|
||||
*/
|
||||
export function flyToWorldTarget(viewer, target = {}) {
|
||||
const camera = findCamera(viewer);
|
||||
@@ -116,8 +117,8 @@ export function flyToWorldTarget(viewer, target = {}) {
|
||||
target.durationSec > 0
|
||||
? target.durationSec
|
||||
: WORLD_CLICK_FOCUS_DURATION_SEC;
|
||||
// A target may ask for more room than its kind's framing (a large quake's
|
||||
// disc), never less.
|
||||
// A target may ask for a wider sphere than its kind's framing (a large
|
||||
// quake's disc), never a narrower one.
|
||||
const atLeast = (value, floor) =>
|
||||
Number.isFinite(value) && value > floor ? value : floor;
|
||||
camera.flyToBounds(
|
||||
@@ -129,7 +130,12 @@ export function flyToWorldTarget(viewer, target = {}) {
|
||||
offset: {
|
||||
heading,
|
||||
pitch: toRadians(framing.pitchDeg),
|
||||
range: atLeast(target.rangeM, framing.rangeM),
|
||||
// A target's own range past the framed radius replaces the kind's.
|
||||
range:
|
||||
Number.isFinite(target.rangeM) &&
|
||||
target.rangeM > atLeast(target.radiusM, framing.radiusM)
|
||||
? target.rangeM
|
||||
: framing.rangeM,
|
||||
},
|
||||
durationS: duration,
|
||||
easing: 'cubicInOut',
|
||||
|
||||
Reference in new issue
Block a user