From d6442dbd3b1f60e8a68132a9f1fe67c1d5a0a256 Mon Sep 17 00:00:00 2001 From: Avi Weinstock Date: Wed, 26 May 2021 11:51:29 -0400 Subject: [PATCH] Change the ChargedRanged zoom distance from 0.0 to 2.0, and add a delay after the mouse click before the zoom starts (i.e. hold to zoom, spam click will not zoom). --- voxygen/src/session/mod.rs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/voxygen/src/session/mod.rs b/voxygen/src/session/mod.rs index 3133a024f6..969e70287b 100644 --- a/voxygen/src/session/mod.rs +++ b/voxygen/src/session/mod.rs @@ -306,11 +306,17 @@ impl PlayState for SessionState { .read_storage::() .get(player_entity) { - fov_scaling -= 3.0 * cr.charge_frac() / 4.0; - if self.saved_zoom_dist.is_none() { - self.saved_zoom_dist = Some(camera.get_distance()); - camera.set_distance(0.0); + if cr.charge_frac() > 0.25 { + fov_scaling -= 3.0 * cr.charge_frac() / 4.0; } + let max_dist = if let Some(dist) = self.saved_zoom_dist { + dist + } else { + let dist = camera.get_distance(); + self.saved_zoom_dist = Some(dist); + dist + }; + camera.set_distance(Lerp::lerp(max_dist, 2.0, 1.0 - fov_scaling)); } else if let Some(dist) = self.saved_zoom_dist.take() { camera.set_distance(dist); }