From b05d4769de549fcda950743eeb49b8ca91c1df86 Mon Sep 17 00:00:00 2001 From: Alex Bohm Date: Sun, 28 Jan 2024 16:31:54 -0600 Subject: [PATCH] Fix quaternion mapping. (#26) --- src/lib.rs | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 87aeb45..fc31e9e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -341,12 +341,15 @@ where let scale = 1.0 / ((1 << 14) as f32); - let quat = mint::Quaternion::from([ - w as f32 * scale, - x as f32 * scale, - y as f32 * scale, - z as f32 * scale, - ]); + let x = x as f32 * scale; + let y = y as f32 * scale; + let z = z as f32 * scale; + let w = w as f32 * scale; + + let quat = mint::Quaternion { + v: mint::Vector3 { x, y, z }, + s: w, + }; Ok(quat) } else {