diff --git a/src/action/systems.rs b/src/action/systems.rs index 5581cf8..74c1163 100644 --- a/src/action/systems.rs +++ b/src/action/systems.rs @@ -27,7 +27,7 @@ fn yaw_to_angle(yaw: f32) -> f32 { fn rotate_point(pt: &Vec3, rot: &Quat) -> Vec3 { // thanks to https://danceswithcode.net/engineeringnotes/quaternions/quaternions.html - let [x, y, z] = pt.to_array(); + let [x, y, z] = pt.normalize().to_array(); let qpt = Quat::from_xyzw(x, y, z, 0.0); // p' = rot^-1 * qpt * rot let rot_qpt = rot.inverse() * qpt * *rot;