wishful thinking

This commit is contained in:
Quaternions 2024-02-21 02:31:50 -08:00
parent 05e2f67e36
commit 8ffbca204b

View File

@ -103,7 +103,7 @@ impl InputState{
&self.next_mouse &self.next_mouse
} }
fn set_next_mouse(&mut self,next_mouse:MouseState){ 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){ fn replace_mouse(&mut self,mouse:MouseState,next_mouse:MouseState){
(self.next_mouse,self.mouse)=(next_mouse,mouse); (self.next_mouse,self.mouse)=(next_mouse,mouse);
@ -111,13 +111,13 @@ impl InputState{
fn set_control(&mut self,control:Controls,state:bool){ fn set_control(&mut self,control:Controls,state:bool){
self.controls.set(control,state) self.controls.set(control,state)
} }
const fn time_delta(&self)->Time{ fn time_delta(&self)->Time{
self.next_mouse.time-self.mouse.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 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 //these are deltas
let dm=self.mouse_delta().as_i64vec2(); let dm=self.mouse_delta().as_i64vec2();
let t=(time-self.mouse.time).nanos(); let t=(time-self.mouse.time).nanos();