forked from StrafesNET/strafe-client
spawn_point is part of building
This commit is contained in:
parent
bd6cd5eacc
commit
f2e4286a08
@ -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<PhysicsInstruction> 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{
|
||||
|
@ -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),
|
||||
|
Loading…
Reference in New Issue
Block a user