From 2d8f6775018487d5ce90fe61a49f97b48660c478 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 2 Aug 2024 10:12:43 -0700 Subject: [PATCH] bunch of stuff --- src/physics_worker.rs | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/src/physics_worker.rs b/src/physics_worker.rs index 3981e1e..2c2be72 100644 --- a/src/physics_worker.rs +++ b/src/physics_worker.rs @@ -60,25 +60,24 @@ impl MouseInterpolator{ /// may or may not mutate internal state XD! fn map_instruction(&mut self,physics:&crate::physics::PhysicsContext,ins:&TimedInstruction)->Option{ match &ins.instruction{ - Instruction::Input(input_instruction)=>match self.timer.is_paused(){ - true=>None, - false=>match input_instruction{ - &InputInstruction::MoveMouse(m)=>{ + Instruction::Input(input_instruction)=>match input_instruction{ + &InputInstruction::MoveMouse(m)=>{ + if !self.timer.is_paused(){ self.push_mouse_instruction(physics,ins,m); - None - }, - &InputInstruction::MoveForward(s)=>Some(PhysicsInputInstruction::SetMoveForward(s)), - &InputInstruction::MoveLeft(s)=>Some(PhysicsInputInstruction::SetMoveLeft(s)), - &InputInstruction::MoveBack(s)=>Some(PhysicsInputInstruction::SetMoveBack(s)), - &InputInstruction::MoveRight(s)=>Some(PhysicsInputInstruction::SetMoveRight(s)), - &InputInstruction::MoveUp(s)=>Some(PhysicsInputInstruction::SetMoveUp(s)), - &InputInstruction::MoveDown(s)=>Some(PhysicsInputInstruction::SetMoveDown(s)), - &InputInstruction::Jump(s)=>Some(PhysicsInputInstruction::SetJump(s)), - &InputInstruction::Zoom(s)=>Some(PhysicsInputInstruction::SetZoom(s)), - &InputInstruction::Spawn(mode_id,stage_id)=>Some(PhysicsInputInstruction::Spawn(mode_id,stage_id)), - InputInstruction::Restart=>Some(PhysicsInputInstruction::Restart), - InputInstruction::PracticeFly=>Some(PhysicsInputInstruction::PracticeFly), + } + None }, + &InputInstruction::MoveForward(s)=>Some(PhysicsInputInstruction::SetMoveForward(s)), + &InputInstruction::MoveLeft(s)=>Some(PhysicsInputInstruction::SetMoveLeft(s)), + &InputInstruction::MoveBack(s)=>Some(PhysicsInputInstruction::SetMoveBack(s)), + &InputInstruction::MoveRight(s)=>Some(PhysicsInputInstruction::SetMoveRight(s)), + &InputInstruction::MoveUp(s)=>Some(PhysicsInputInstruction::SetMoveUp(s)), + &InputInstruction::MoveDown(s)=>Some(PhysicsInputInstruction::SetMoveDown(s)), + &InputInstruction::Jump(s)=>Some(PhysicsInputInstruction::SetJump(s)), + &InputInstruction::Zoom(s)=>Some(PhysicsInputInstruction::SetZoom(s)), + &InputInstruction::Spawn(mode_id,stage_id)=>Some(PhysicsInputInstruction::Spawn(mode_id,stage_id)), + InputInstruction::Restart=>Some(PhysicsInputInstruction::Restart), + InputInstruction::PracticeFly=>Some(PhysicsInputInstruction::PracticeFly), }, //do these really need to idle the physics? //sending None dumps the instruction queue