diff --git a/src/body.rs b/src/body.rs index 6e4727c8..1ca27e9f 100644 --- a/src/body.rs +++ b/src/body.rs @@ -14,8 +14,6 @@ pub enum PhysicsInstruction { // ) //InputInstructions conditionally activate RefreshWalkTarget (by doing what SetWalkTargetVelocity used to do and then flagging it) Input(InputInstruction), - //temp - SetSpawnPosition(glam::Vec3), } #[derive(Debug)] pub enum InputInstruction { @@ -1014,16 +1012,12 @@ impl crate::instruction::InstructionConsumer for PhysicsStat match &ins.instruction { PhysicsInstruction::Input(InputInstruction::MoveMouse(_)) => (),//dodge time for mouse movement PhysicsInstruction::Input(_) - |PhysicsInstruction::SetSpawnPosition(_) |PhysicsInstruction::ReachWalkTargetVelocity |PhysicsInstruction::CollisionStart(_) |PhysicsInstruction::CollisionEnd(_) |PhysicsInstruction::StrafeTick => self.advance_time(ins.time), } match ins.instruction { - PhysicsInstruction::SetSpawnPosition(position)=>{ - self.spawn_point=position; - } PhysicsInstruction::CollisionStart(c) => { let model=c.model(&self.models).unwrap(); match &model.attributes{ diff --git a/src/main.rs b/src/main.rs index 053279d4..c69e46d2 100644 --- a/src/main.rs +++ b/src/main.rs @@ -914,14 +914,11 @@ impl framework::Example for GlobalState { self.physics.clear(); self.graphics.clear(); self.physics.game.stage_id=0; + self.physics.spawn_point=spawn_point; self.generate_model_physics(&indexed_model_instances); self.generate_model_graphics(device,queue,indexed_model_instances); //manual reset let time=self.physics.time; - instruction::InstructionConsumer::process_instruction(&mut self.physics, instruction::TimedInstruction{ - time, - instruction: body::PhysicsInstruction::SetSpawnPosition(spawn_point), - }); instruction::InstructionConsumer::process_instruction(&mut self.physics, instruction::TimedInstruction{ time, instruction: body::PhysicsInstruction::Input(body::InputInstruction::Reset),