From 48c7135efb8b698887023bc2e107b35e624491a9 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 1 Jul 2025 02:48:49 +0300 Subject: [PATCH] Return zero rotation vector when converting neutral quaternion Previously it would return nans --- flix/quaternion.h | 1 + 1 file changed, 1 insertion(+) diff --git a/flix/quaternion.h b/flix/quaternion.h index 252212e..ab56945 100644 --- a/flix/quaternion.h +++ b/flix/quaternion.h @@ -84,6 +84,7 @@ public: } Vector toRotationVector() const { + if (w == 1 && x == 0 && y == 0 && z == 0) return Vector(0, 0, 0); // neutral quaternion float angle; Vector axis; toAxisAngle(axis, angle);