From ea9c2efc7f7611d75a4301a6e997eae3cdae279b Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 15 Nov 2023 22:45:49 -0800 Subject: [PATCH] implement Planar64Mat3::from_diagonal --- src/integer.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/integer.rs b/src/integer.rs index 6c416ee..9ac3a14 100644 --- a/src/integer.rs +++ b/src/integer.rs @@ -851,6 +851,14 @@ impl Planar64Mat3{ } } #[inline] + pub const fn from_diagonal(diagonal:Planar64Vec3)->Self{ + Self{ + x_axis:Planar64Vec3::raw(diagonal.0.x,0,0), + y_axis:Planar64Vec3::raw(0,diagonal.0.y,0), + z_axis:Planar64Vec3::raw(0,0,diagonal.0.z), + } + } + #[inline] pub fn from_rotation_yx(yaw:Angle32,pitch:Angle32)->Self{ let xtheta=yaw.0 as f64*ANGLE32_TO_FLOAT64_RADIANS; let (xs,xc)=xtheta.sin_cos();