From c3362f5f94498fbc43ed7f0c28b222fcc554e3b2 Mon Sep 17 00:00:00 2001 From: Robert Swain Date: Thu, 17 Sep 2020 21:52:32 +0200 Subject: [PATCH 1/5] Port to bevy post-0.1.3 --- src/lib.rs | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 005d85a..c51cfb0 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -90,19 +90,19 @@ impl Default for FlyCamera { } } -fn forward_vector(rotation: &Rotation) -> Vec3 { +fn forward_vector(rotation: &Quat) -> Vec3 { rotation.mul_vec3(Vec3::unit_z()).normalize() } -fn forward_walk_vector(rotation: &Rotation) -> Vec3 { +fn forward_walk_vector(rotation: &Quat) -> Vec3 { let f = forward_vector(rotation); let f_flattened = Vec3::new(f.x(), 0.0, f.z()).normalize(); f_flattened } -fn strafe_vector(rotation: &Rotation) -> Vec3 { +fn strafe_vector(rotation: &Quat) -> Vec3 { // Rotate it 90 degrees to get the strafe direction - Rotation::from_rotation_y(90.0f32.to_radians()) + Quat::from_rotation_y(90.0f32.to_radians()) .mul_vec3(forward_walk_vector(rotation)) .normalize() } @@ -125,9 +125,9 @@ fn movement_axis( fn camera_movement_system( time: Res