Skip to content

Commit

Permalink
Optimize? rotation matrix calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
Ciubix8513 committed Jul 1, 2024
1 parent e5195e0 commit 6697039
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/math/mat4x4.rs
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,10 @@ impl Mat4x4 {
#[must_use]
///Creates a rotation matrix for the given euler angles
pub fn rotation_matrix_euler(rotation: &Vec3) -> Self {
if rotation.x == 0.0 && rotation.y == 0.0 && rotation.z == 0.0 {
return IDENTITY;
}

let sin_x = rotation.x.to_radians().sin();
let cos_x = rotation.x.to_radians().cos();

Expand Down

0 comments on commit 6697039

Please sign in to comment.