From ac2f1d3eac05fb0acbd881a26bc365c78bcf129a Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 13 Oct 2023 16:05:35 -0700 Subject: [PATCH] Planar64Mat3 div + Planar64Mat3::int_from_cols_array --- src/integer.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/integer.rs b/src/integer.rs index 85127eb..f155163 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -731,6 +731,13 @@ impl Planar64Mat3{ z_axis, } } + pub fn int_from_cols_array(array:[i32;9])->Self{ + Self{ + x_axis:Planar64Vec3::int(array[0],array[1],array[2]), + y_axis:Planar64Vec3::int(array[3],array[4],array[5]), + z_axis:Planar64Vec3::int(array[6],array[7],array[8]), + } + } #[inline] pub fn from_rotation_y(angle:Angle32)->Self{ let theta=angle.0 as f64*(std::f64::consts::PI/((1<<31) as f64)); @@ -766,6 +773,17 @@ impl TryFrom for Planar64Mat3{ }) } } +impl std::ops::Div for Planar64Mat3{ + type Output=Planar64Mat3; + #[inline] + fn div(self,rhs:i64)->Self::Output{ + Planar64Mat3{ + x_axis:self.x_axis/rhs, + y_axis:self.y_axis/rhs, + z_axis:self.z_axis/rhs, + } + } +} ///[-1.0,1.0] = [-2^32,2^32] #[derive(Clone,Copy,Default)]