From 9229b743ebd31d46d02fb099ec531970832171a9 Mon Sep 17 00:00:00 2001 From: Oleg Kalachev Date: Tue, 1 Jul 2025 02:47:01 +0300 Subject: [PATCH] Add missing equals and non-equals operators for quaternion lib --- flix/quaternion.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/flix/quaternion.h b/flix/quaternion.h index b61eeb8..252212e 100644 --- a/flix/quaternion.h +++ b/flix/quaternion.h @@ -148,6 +148,14 @@ public: w * q.z + z * q.w + x * q.y - y * q.x); } + bool operator == (const Quaternion& q) const { + return w == q.w && x == q.x && y == q.y && z == q.z; + } + + bool operator != (const Quaternion& q) const { + return !(*this == q); + } + Quaternion inversed() const { float normSqInv = 1 / (w * w + x * x + y * y + z * z); return Quaternion(