actually need ReplaceMouse because of OS level issue
The operating system does not report the timestamp at which it checks that the mouse was not moving, so the mouse interpolation will necessarily be incorrect for up to 1 polling period. The alternative is to guess / make up a timestamp, but I don't want to do this.
This commit is contained in:
parent
ceb2499ad2
commit
719c702b95
@ -4,6 +4,7 @@ pub type Time=crate::integer::Time<TimeInner>;
|
||||
|
||||
#[derive(Clone,Debug)]
|
||||
pub enum Instruction{
|
||||
ReplaceMouse(crate::mouse::MouseState<TimeInner>,crate::mouse::MouseState<TimeInner>),
|
||||
SetNextMouse(crate::mouse::MouseState<TimeInner>),
|
||||
SetMoveRight(bool),
|
||||
SetMoveUp(bool),
|
||||
|
@ -1759,6 +1759,7 @@ fn atomic_input_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedI
|
||||
|PhysicsInputInstruction::Idle=>false,
|
||||
//these controls only update the body if you are on the ground
|
||||
PhysicsInputInstruction::SetNextMouse(..)
|
||||
|PhysicsInputInstruction::ReplaceMouse(..)
|
||||
|PhysicsInputInstruction::SetMoveForward(..)
|
||||
|PhysicsInputInstruction::SetMoveLeft(..)
|
||||
|PhysicsInputInstruction::SetMoveBack(..)
|
||||
@ -1788,6 +1789,10 @@ fn atomic_input_instruction(state:&mut PhysicsState,data:&PhysicsData,ins:TimedI
|
||||
state.camera.move_mouse(state.input_state.mouse_delta());
|
||||
state.input_state.set_next_mouse(m);
|
||||
},
|
||||
PhysicsInputInstruction::ReplaceMouse(m0,m1)=>{
|
||||
state.camera.move_mouse(m0.pos-state.input_state.mouse.pos);
|
||||
state.input_state.replace_mouse(m0,m1);
|
||||
},
|
||||
PhysicsInputInstruction::SetMoveForward(s)=>state.input_state.set_control(Controls::MoveForward,s),
|
||||
PhysicsInputInstruction::SetMoveLeft(s)=>state.input_state.set_control(Controls::MoveLeft,s),
|
||||
PhysicsInputInstruction::SetMoveBack(s)=>state.input_state.set_control(Controls::MoveBackward,s),
|
||||
|
Loading…
Reference in New Issue
Block a user