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 e23fe5f
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/bevy_transform/src/components/transform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,8 @@ impl Transform {
#[inline]
pub fn rotate_axis(&mut self, axis: Dir3, angle: f32) {
self.rotate(Quat::from_axis_angle(axis.into(), angle));
// Normalize rotation due to potential for exponential denormalization (#16480)
self.rotation = self.rotation.normalize();
}

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

0 comments on commit e23fe5f

Please sign in to comment.