mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 09:42:21 +00:00
feat(firms): a marker stand-in can set how far the camera stands from a fire it draws (#1832)
setMarkerStandIn takes an optional focusRangeM(record): when a click on a fire the stand-in draws moves the camera there, it stands off that many metres instead of the usual fire framing. A world focus request may carry its own rangeM; past the framed radius it replaces the kind's range.
This commit is contained in:
1 parent
0a9235cc69
commit
cd144ecad5
6 files changed
+63
-3
No files matched your search
+6
-2
@@ -85,7 +85,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);
|
||||
@@ -118,7 +119,10 @@ export function flyToWorldTarget(viewer, target = {}) {
|
||||
offset: {
|
||||
heading,
|
||||
pitch: toRadians(framing.pitchDeg),
|
||||
range: framing.rangeM,
|
||||
range:
|
||||
Number.isFinite(target.rangeM) && target.rangeM > framing.radiusM
|
||||
? target.rangeM
|
||||
: framing.rangeM,
|
||||
},
|
||||
durationS: duration,
|
||||
easing: 'cubicInOut',
|
||||
|
||||
Reference in new issue
Block a user