mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-16 16:22:20 +00:00
Keep the tilt clearance through a zoom in
A zoom in during a pivoting tilt stops at the range that keeps the camera 150 m above the pivot at its current pitch. A zoom that moves the range by less than half a metre (at the clearance, the 80 m floor or the 5,000 km cap) now answers not zoomed instead of ok, and a tilt reports tiltRangeAdjusted rather than orbitRadiusAdjusted.
This commit is contained in:
1 parent
9d8db97a33
commit
fdecc8c581
4 files changed
+78
-15
No files matched your search
+15
-3
@@ -411,13 +411,25 @@ export function createGevActionRunner({
|
||||
const zoomOut = String(args.direction || '').toLowerCase() === 'out';
|
||||
const amt = String(args.amount || 'medium').toLowerCase();
|
||||
const factor = { little: 1.25, medium: 1.6, lot: 2.4 }[amt] || 1.6;
|
||||
if (adjustOrbitRange(zoomOut ? factor : 1 / factor)) {
|
||||
const held = adjustOrbitRange(zoomOut ? factor : 1 / factor);
|
||||
if (held) {
|
||||
const direction = zoomOut ? 'out' : 'in';
|
||||
if (!held.changed) {
|
||||
return {
|
||||
ok: false,
|
||||
action: 'adjust_camera_zoom',
|
||||
direction,
|
||||
amount: amt,
|
||||
error: `Not zoomed: the ${held.kind} is already at its ${zoomOut ? 'farthest' : 'closest'} range.`,
|
||||
};
|
||||
}
|
||||
return {
|
||||
ok: true,
|
||||
action: 'adjust_camera_zoom',
|
||||
direction: zoomOut ? 'out' : 'in',
|
||||
direction,
|
||||
amount: amt,
|
||||
orbitRadiusAdjusted: true,
|
||||
[held.kind === 'tilt' ? 'tiltRangeAdjusted' : 'orbitRadiusAdjusted']:
|
||||
true,
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user