From b897d4a662c6f256e5b12097090b2665197753f6 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 1 Nov 2023 16:57:49 -0700 Subject: [PATCH] I need to rethink Collision vs Attributes --- src/physics.rs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/physics.rs b/src/physics.rs index 6cd68bd..caff5ec 100644 --- a/src/physics.rs +++ b/src/physics.rs @@ -1085,15 +1085,15 @@ fn run_teleport_behaviour(teleport_behaviour:&Option for PhysicsState { fn process_instruction(&mut self, ins:TimedInstruction) { - match &ins.instruction { + match &ins.instruction{ PhysicsInstruction::Input(PhysicsInputInstruction::Idle) |PhysicsInstruction::Input(PhysicsInputInstruction::SetNextMouse(_)) |PhysicsInstruction::Input(PhysicsInputInstruction::ReplaceMouse(_,_)) - |PhysicsInstruction::StrafeTick => (), + |PhysicsInstruction::StrafeTick=>(), _=>println!("{}|{:?}",ins.time,ins.instruction), } //selectively update body - match &ins.instruction { + match &ins.instruction{ PhysicsInstruction::Input(PhysicsInputInstruction::Idle)=>self.time=ins.time,//idle simply updates time PhysicsInstruction::Input(_) |PhysicsInstruction::ReachWalkTargetVelocity @@ -1101,10 +1101,9 @@ impl crate::instruction::InstructionConsumer for PhysicsStat |PhysicsInstruction::CollisionEnd(_) |PhysicsInstruction::StrafeTick=>self.advance_time(ins.time), } - match ins.instruction { - PhysicsInstruction::CollisionStart(c) => { - let model=c.model(&self.models).unwrap(); - match &model.attributes{ + match ins.instruction{ + PhysicsInstruction::CollisionStart(c)=>{ + match self.models.attr(c.model_id()){ PhysicsCollisionAttributes::Contact{contacting,general}=>{ let mut v=self.body.velocity; match &contacting.contact_behaviour{