diff --git a/common/src/comp/ori.rs b/common/src/comp/ori.rs index 4b4e90963e..7f3bb40198 100644 --- a/common/src/comp/ori.rs +++ b/common/src/comp/ori.rs @@ -208,7 +208,7 @@ impl Ori { if angle < PI { angle } else { TAU - angle } } - pub fn dot(self, other: Self) -> f32 { self.0.dot(other.0) } + pub fn dot(self, other: Self) -> f32 { self.look_vec().dot(other.look_vec()) } pub fn pitched_up(self, angle_radians: f32) -> Self { self.rotated(Quaternion::rotation_x(angle_radians)) diff --git a/common/src/states/utils.rs b/common/src/states/utils.rs index 65a51b9a91..a296d51d63 100644 --- a/common/src/states/utils.rs +++ b/common/src/states/utils.rs @@ -406,7 +406,7 @@ pub fn handle_orientation( let rate = { // Angle factor used to keep turning rate approximately constant by // counteracting slerp turning more with a larger angle - let angle_factor = 2.0 / (1.0 - update.ori.dot(target_ori)); + let angle_factor = 2.0 / (1.0 - update.ori.dot(target_ori)).sqrt(); data.body.base_ori_rate() * efficiency * angle_factor }; update.ori = update