From 50fcd6c6a39ba9df8be6508494c9ca71bca828a1 Mon Sep 17 00:00:00 2001 From: jshipsey Date: Sun, 5 Jul 2020 10:00:44 -0400 Subject: [PATCH] remove slowmo test mode --- common/src/path.rs | 29 ++++++++++++-------- voxygen/src/anim/src/quadruped_low/run.rs | 1 + voxygen/src/anim/src/quadruped_medium/run.rs | 3 +- 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/common/src/path.rs b/common/src/path.rs index cace57e210..8388edb36c 100644 --- a/common/src/path.rs +++ b/common/src/path.rs @@ -75,7 +75,9 @@ impl Route { where V: BaseVol + ReadVol, { - let next0 = self.next(0).unwrap_or_else(|| pos.map(|e| e.floor() as i32)); + let next0 = self + .next(0) + .unwrap_or_else(|| pos.map(|e| e.floor() as i32)); let next1 = self.next(1).unwrap_or(next0); if vol.get(next0).map(|b| b.is_solid()).unwrap_or(false) { None @@ -129,7 +131,10 @@ impl Route { let tgt2d = cb.evaluate(0.5); let tgt = Vec3::from(tgt2d) + Vec3::unit_z() * next_tgt.z; - let tgt_dir = (tgt - pos).xy().try_normalized().unwrap_or_else(Vec2::unit_y); + let tgt_dir = (tgt - pos) + .xy() + .try_normalized() + .unwrap_or_else(Vec2::unit_y); let next_dir = cb .evaluate_derivative(0.5) .try_normalized() @@ -187,16 +192,16 @@ impl Chaser { let bearing = if let Some(end) = self.route.as_ref().and_then(|r| r.path().end().copied()) { let end_to_tgt = end.map(|e| e as f32).distance(tgt); - if end_to_tgt > pos_to_tgt * 0.3 + 5.0 || thread_rng().gen::() < 0.005 { - None - } else { - self.route - .as_mut() - .and_then(|r| r.traverse(vol, pos, vel, traversal_tolerance)) - } -} else { - None -}; + if end_to_tgt > pos_to_tgt * 0.3 + 5.0 || thread_rng().gen::() < 0.005 { + None + } else { + self.route + .as_mut() + .and_then(|r| r.traverse(vol, pos, vel, traversal_tolerance)) + } + } else { + None + }; // TODO: What happens when we get stuck? if let Some(bearing) = bearing { diff --git a/voxygen/src/anim/src/quadruped_low/run.rs b/voxygen/src/anim/src/quadruped_low/run.rs index eaea7229e6..1f384c1ce4 100644 --- a/voxygen/src/anim/src/quadruped_low/run.rs +++ b/voxygen/src/anim/src/quadruped_low/run.rs @@ -10,6 +10,7 @@ impl Animation for RunAnimation { #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_low_run\0"; + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_low_run")] fn update_skeleton_inner( diff --git a/voxygen/src/anim/src/quadruped_medium/run.rs b/voxygen/src/anim/src/quadruped_medium/run.rs index 99a4bea5bd..5feef6b718 100644 --- a/voxygen/src/anim/src/quadruped_medium/run.rs +++ b/voxygen/src/anim/src/quadruped_medium/run.rs @@ -10,6 +10,7 @@ impl Animation for RunAnimation { #[cfg(feature = "use-dyn-lib")] const UPDATE_FN: &'static [u8] = b"quadruped_medium_run\0"; + #[allow(clippy::useless_conversion)] // TODO: Pending review in #587 #[cfg_attr(feature = "be-dyn-lib", export_name = "quadruped_medium_run")] fn update_skeleton_inner( @@ -22,7 +23,7 @@ impl Animation for RunAnimation { let mut next = (*skeleton).clone(); let speed = Vec2::::from(velocity).magnitude(); *rate = 1.0; - let lab = 0.1; //6 + let lab = 0.6; //6 let speedmult = if speed > 8.0 { 1.2 * (1.0 * skeleton_attr.tempo)