From 8c32e3674db43ea5a8b985295713fe57c3a51c2b Mon Sep 17 00:00:00 2001 From: _ <> Date: Mon, 9 Mar 2020 02:00:43 +0000 Subject: [PATCH] Flying the plane around without proper physics --- src/bin/pumpkin.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/bin/pumpkin.rs b/src/bin/pumpkin.rs index 1fade6d..f6877af 100644 --- a/src/bin/pumpkin.rs +++ b/src/bin/pumpkin.rs @@ -136,7 +136,7 @@ impl ControllerState { delta = delta.mul_quat (Quat::from_rotation_y (spin_f)); } if self.is_pressed (KEY_UP) { - delta = delta.mul_quat (Quat::from_rotation_x (-spin_f)); + delta = delta.mul_quat (Quat::from_rotation_x (-0.5 * spin_f)); } if self.is_pressed (KEY_DOWN) { delta = delta.mul_quat (Quat::from_rotation_x (spin_f)); @@ -194,6 +194,8 @@ impl FlightState { pub fn step (&mut self, controller: &ControllerState) { self.spin_speed = controller.control_quat (&mut self.airplane.ori, self.spin_speed); + + self.airplane.pos += self.airplane.ori.mul_vec3 ((0.0, 1.0 / 30.0, 0.0).into ()); } } @@ -254,7 +256,7 @@ impl WorldState { }, flight: FlightState { airplane: Airplane { - pos: (0.0, 0.0, 1.35).into (), + pos: (0.0, -0.5, 0.125).into (), ori: Default::default (), }, spin_speed: 0,