Velocity-corrected bezier pathfinding control, swimming control

This commit is contained in:
Joshua Barretto
2020-07-04 20:22:55 +01:00
committed by jshipsey
parent ca9ae13527
commit 8508b5177b
8 changed files with 112 additions and 33 deletions

View File

@ -157,6 +157,7 @@ pub struct ControllerInputs {
pub wall_leap: Input,
pub charge: Input,
pub climb: Option<Climb>,
pub swim: Input,
pub move_dir: Vec2<f32>,
pub look_dir: Dir,
}
@ -180,6 +181,7 @@ impl ControllerInputs {
self.glide.tick(dt);
self.wall_leap.tick(dt);
self.charge.tick(dt);
self.swim.tick(dt);
}
pub fn tick_freshness(&mut self) {
@ -191,6 +193,7 @@ impl ControllerInputs {
self.glide.tick_freshness();
self.wall_leap.tick_freshness();
self.charge.tick_freshness();
self.swim.tick_freshness();
}
/// Updates Controller inputs with new version received from the client
@ -204,6 +207,7 @@ impl ControllerInputs {
self.wall_leap.update_with_new(new.wall_leap);
self.charge.update_with_new(new.charge);
self.climb = new.climb;
self.swim.update_with_new(new.swim);
self.move_dir = new.move_dir;
self.look_dir = new.look_dir;
}