Skip to content

Commit

Permalink
Use f32::to_radians
Browse files Browse the repository at this point in the history
```
warning: conversion to radians can be done more accurately
   --> src/collada/scene.rs:137:33
    |
137 |                     let angle = f[3] * std::f32::consts::PI / 180.;
    |                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: consider using: `f[3].to_radians()`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#suboptimal_flops
```
  • Loading branch information
taiki-e committed Jun 20, 2024
1 parent 737bd53 commit 55c1408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/collada/scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl Transform {
}
}
Self::Rotate(f) => {
let angle = f[3] * std::f32::consts::PI / 180.;
let angle = f[3].to_radians();
let axis = [f[0], f[1], f[2]];
let m = Matrix4x4::rotation(angle, axis);
match &mut out {
Expand Down

0 comments on commit 55c1408

Please sign in to comment.