From c28b5177f83b8abd66ccc7eb1dcd8344ade04697 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 19 Sep 2023 21:33:08 -0700 Subject: [PATCH] accumulate deltas --- src/body.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/body.rs b/src/body.rs index a728fc3..85133e6 100644 --- a/src/body.rs +++ b/src/body.rs @@ -109,11 +109,11 @@ impl MouseInterpolationState { mouse1:glam::IVec2::ZERO, } } - pub fn move_mouse(&mut self,time:TIME,pos:glam::IVec2){ + pub fn move_mouse(&mut self,time:TIME,delta:glam::IVec2){ self.time0=self.time1; self.mouse0=self.mouse1; self.time1=time; - self.mouse1=pos; + self.mouse1=self.mouse1+delta; } pub fn interpolated_position(&self,time:TIME) -> glam::IVec2 { match self.interpolation {