TEMP: move jump out

This commit is contained in:
Quaternions 2023-09-18 18:06:51 -07:00
parent ad7abbdf1c
commit e67479a9bd
2 changed files with 10 additions and 8 deletions

View File

@ -640,14 +640,6 @@ impl crate::instruction::InstructionEmitter<PhysicsInstruction> for PhysicsState
fn next_instruction(&self,time_limit:TIME) -> Option<TimedInstruction<PhysicsInstruction>> { fn next_instruction(&self,time_limit:TIME) -> Option<TimedInstruction<PhysicsInstruction>> {
//JUST POLLING!!! NO MUTATION //JUST POLLING!!! NO MUTATION
let mut collector = crate::instruction::InstructionCollector::new(time_limit); 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 //check for collision stop instructions with curent contacts
for collision_data in self.contacts.iter() { for collision_data in self.contacts.iter() {
collector.collect(self.predict_collision_end(self.time,time_limit,collision_data)); collector.collect(self.predict_collision_end(self.time,time_limit,collision_data));

View File

@ -641,6 +641,16 @@ impl strafe_client::framework::Example for Skybox {
self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0; self.physics.jump_trying=self.camera.controls&CONTROL_JUMP!=0;
self.physics.run(time); 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 = let mut encoder =
device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None }); device.create_command_encoder(&wgpu::CommandEncoderDescriptor { label: None });