From 55c1408a2bdc14e1ac52e7146e05902c27ea1e48 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Thu, 20 Jun 2024 15:36:53 +0900 Subject: [PATCH] Use f32::to_radians ``` 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 ``` --- src/collada/scene.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/collada/scene.rs b/src/collada/scene.rs index b105293..2cba10b 100644 --- a/src/collada/scene.rs +++ b/src/collada/scene.rs @@ -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 {