Skip to content

Commit

Permalink
Fixes #16480: Prevent exponential denormalization on `Transform::rota…
Browse files Browse the repository at this point in the history
…te_axis`
  • Loading branch information
Novakasa committed Jan 29, 2025
1 parent f7c27b5 commit 0f2a51d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/bevy_transform/src/components/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ impl Transform {
/// If this [`Transform`] has a parent, the `axis` is relative to the rotation of the parent.
#[inline]
pub fn rotate_axis(&mut self, axis: Dir3, angle: f32) {
self.rotate(Quat::from_axis_angle(axis.into(), angle));
self.rotation = ((Quat::from_axis_angle(axis.into(), angle)) * self.rotation).normalize();
}

/// Rotates this [`Transform`] around the `X` axis by `angle` (in radians).
Expand Down

0 comments on commit 0f2a51d

Please sign in to comment.