diff --git a/src/body.rs b/src/body.rs index 964eeba7..f20a602b 100644 --- a/src/body.rs +++ b/src/body.rs @@ -640,14 +640,6 @@ impl crate::instruction::InstructionEmitter for PhysicsState fn next_instruction(&self,time_limit:TIME) -> Option> { //JUST POLLING!!! NO MUTATION let mut collector = crate::instruction::InstructionCollector::new(time_limit); - //autohop (already pressing spacebar; the signal to begin trying to jump is different) - if self.grounded&&self.jump_trying { - //scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true - collector.collect(Some(TimedInstruction{ - time:self.time, - instruction:PhysicsInstruction::Jump - })); - } //check for collision stop instructions with curent contacts for collision_data in self.contacts.iter() { collector.collect(self.predict_collision_end(self.time,time_limit,collision_data)); diff --git a/src/main.rs b/src/main.rs index b733d87e..1d757922 100644 --- a/src/main.rs +++ b/src/main.rs @@ -641,6 +641,16 @@ impl strafe_client::framework::Example for Skybox { self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0; self.physics.run(time); + //TOTALLY WRONG!!! + //autohop (already pressing spacebar; the signal to begin trying to jump is different) + if self.physics.grounded&&self.physics.jump_trying { + //scroll will be implemented with InputInstruction::Jump(true) but it blocks setting self.jump_trying=true + strafe_client::instruction::InstructionConsumer::process_instruction(&mut self.physics, strafe_client::instruction::TimedInstruction{ + time:time,//this is in the past when there is no instructions! + instruction:strafe_client::body::PhysicsInstruction::Jump + }); + } + let mut encoder = device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });