From 3f62b9b353622316bab39b94a7df758f50a46101 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 20 Feb 2024 22:28:51 -0800 Subject: [PATCH] integer edits --- src/integer.rs | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/src/integer.rs b/src/integer.rs index 9bf91c6..f04dcf0 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -606,15 +606,15 @@ impl Planar64Vec3{ Self(glam::i64vec3(x,y,z)) } #[inline] - pub fn x(&self)->Planar64{ + pub const fn x(&self)->Planar64{ Planar64(self.0.x) } #[inline] - pub fn y(&self)->Planar64{ + pub const fn y(&self)->Planar64{ Planar64(self.0.y) } #[inline] - pub fn z(&self)->Planar64{ + pub const fn z(&self)->Planar64{ Planar64(self.0.z) } #[inline] @@ -642,7 +642,7 @@ impl Planar64Vec3{ self.0.cmplt(rhs.0) } #[inline] - pub fn dot(&self,rhs:Self)->Planar64{ + pub const fn dot(&self,rhs:Self)->Planar64{ Planar64((( (self.0.x as i128)*(rhs.0.x as i128)+ (self.0.y as i128)*(rhs.0.y as i128)+ @@ -650,13 +650,13 @@ impl Planar64Vec3{ )>>32) as i64) } #[inline] - pub fn dot128(&self,rhs:Self)->i128{ + pub const fn dot128(&self,rhs:Self)->i128{ (self.0.x as i128)*(rhs.0.x as i128)+ (self.0.y as i128)*(rhs.0.y as i128)+ (self.0.z as i128)*(rhs.0.z as i128) } #[inline] - pub fn cross(&self,rhs:Self)->Planar64Vec3{ + pub const fn cross(&self,rhs:Self)->Planar64Vec3{ Planar64Vec3(glam::i64vec3( (((self.0.y as i128)*(rhs.0.z as i128)-(self.0.z as i128)*(rhs.0.y as i128))>>32) as i64, (((self.0.z as i128)*(rhs.0.x as i128)-(self.0.x as i128)*(rhs.0.z as i128))>>32) as i64, @@ -664,12 +664,6 @@ impl Planar64Vec3{ )) } #[inline] - pub fn walkable(&self,slope:Planar64,up:Self)->bool{ - let y=self.dot(up); - let x=self.cross(up).length(); - x*slopePlanar64{ let radicand=(self.0.x as i128)*(self.0.x as i128)+(self.0.y as i128)*(self.0.y as i128)+(self.0.z as i128)*(self.0.z as i128); Planar64(unsafe{(radicand as f64).sqrt().to_int_unchecked()})