- fixed quaternion multiply-assign operator.

This must go through a temporary because otherwise it'd overwrite its own factors.
This commit is contained in:
Christoph Oelckers 2022-11-06 08:48:53 +01:00
parent c55dfbcddd
commit 3e405c5215

View file

@ -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;
}