From 3e405c5215396d97fc114902dbbe8f553549c88b Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 6 Nov 2022 08:48:53 +0100 Subject: [PATCH] - fixed quaternion multiply-assign operator. This must go through a temporary because otherwise it'd overwrite its own factors. --- src/common/utility/vectors.h | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/common/utility/vectors.h b/src/common/utility/vectors.h index 661acd742..019eb9db1 100644 --- a/src/common/utility/vectors.h +++ b/src/common/utility/vectors.h @@ -849,10 +849,7 @@ struct TVector4 // Multiply as Quaternion TVector4& operator*= (const TVector4& v) { - X = v.W * X + v.X * W + v.Y * Z - v.Z * Y; - Y = v.W * Y + v.Y * W + v.Z * X - v.X * Z; - Z = v.W * Z + v.Z * W + v.X * Y - v.Y * X; - W = v.W * W - v.X * X - v.Y * Y - v.Z * Z; + *this = *this * v; return *this; }