From 708b518047bb0326bacf6eb43cd27e382625cd2e Mon Sep 17 00:00:00 2001 From: Joe Ardent Date: Thu, 23 Feb 2023 14:28:30 -0800 Subject: [PATCH] normalize pt->quat --- src/action/systems.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;