From 9cc16746246efa2058fd27b9c0c7c9ece0a54892 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 13 Oct 2023 15:37:36 -0700 Subject: [PATCH] improve Planar64 into f32 --- src/integer.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/integer.rs b/src/integer.rs index c931568..aca6524 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -378,7 +378,7 @@ impl Planar64{ impl Into for Planar64{ #[inline] fn into(self)->f32{ - self.0 as f32/(1<<32) as f32 + self.0 as f32*(1.0/(1<<32) as f32) } } impl From for Planar64{ @@ -567,10 +567,10 @@ impl Planar64Vec3{ impl Into for Planar64Vec3{ fn into(self)->glam::Vec3{ glam::vec3( - self.0.x as f32/(1<<32) as f32, - self.0.y as f32/(1<<32) as f32, - self.0.z as f32/(1<<32) as f32, - ) + self.0.x as f32, + self.0.y as f32, + self.0.z as f32, + )*(1.0/(1<<32) as f32) } } impl TryFrom<[f32;3]> for Planar64Vec3{