diff --git a/src/physics.rs b/src/physics.rs index c5d78bb..1da6608 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -103,7 +103,7 @@ impl InputState{ &self.next_mouse } fn set_next_mouse(&mut self,next_mouse:MouseState){ - (self.next_mouse,self.mouse)=(next_mouse,self.next_mouse); + (self.next_mouse,self.mouse)=(next_mouse,self.next_mouse.clone()); } fn replace_mouse(&mut self,mouse:MouseState,next_mouse:MouseState){ (self.next_mouse,self.mouse)=(next_mouse,mouse); @@ -111,13 +111,13 @@ impl InputState{ fn set_control(&mut self,control:Controls,state:bool){ self.controls.set(control,state) } - const fn time_delta(&self)->Time{ + fn time_delta(&self)->Time{ self.next_mouse.time-self.mouse.time } - const fn mouse_delta(&self)->glam::IVec2{ + fn mouse_delta(&self)->glam::IVec2{ self.next_mouse.pos-self.mouse.pos } - const fn lerp_delta(&self,time:Time)->glam::IVec2{ + fn lerp_delta(&self,time:Time)->glam::IVec2{ //these are deltas let dm=self.mouse_delta().as_i64vec2(); let t=(time-self.mouse.time).nanos();