From 6a6e171f62df2598ea42a45c93cf3cc08c2d81b0 Mon Sep 17 00:00:00 2001 From: Andre Henriques Date: Mon, 26 Jun 2023 19:11:03 +0100 Subject: [PATCH] lerp anyway --- src/render.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/render.rs b/src/render.rs index a0a375c..e8c9497 100644 --- a/src/render.rs +++ b/src/render.rs @@ -343,7 +343,14 @@ impl Render { self.last = data.clone(); } + let lerp_data: Vec> = data + .iter() + .zip(&self.last) + .map(|(d, l)| l.lerp(d, delta as f64)) + .collect(); + if (time - self.last_update) < 33 { + self.last = lerp_data; return; } @@ -351,11 +358,6 @@ impl Render { self.last_update = time; - let lerp_data: Vec> = data - .iter() - .zip(&self.last) - .map(|(d, l)| l.lerp(d, delta as f64)) - .collect(); //println!("d:{:?}\n l:{:?}", data[25], lerp_data[25]);