summaryrefslogtreecommitdiffstats
path: root/src/core/Quat.cpp
diff options
context:
space:
mode:
authorshaderbeast <jd16581556@gmail.com>2019-05-06 11:01:31 +0200
committershaderbeast <jd16581556@gmail.com>2019-05-06 11:01:31 +0200
commit041b97e5b29f62c3176e0d1179ddaf8c91489fd4 (patch)
treec00b55160a396dfdf55f3c0aa492f25469ecb262 /src/core/Quat.cpp
parent04548011e38a74fda5640ba7ec02ff74caae43f8 (diff)
downloadredot-cpp-041b97e5b29f62c3176e0d1179ddaf8c91489fd4.tar.gz
Fixed wrong implementation of Quat multiplication
Obeyed Clang format rules
Diffstat (limited to 'src/core/Quat.cpp')
-rw-r--r--src/core/Quat.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/Quat.cpp b/src/core/Quat.cpp
index abfe056..d9ca0ff 100644
--- a/src/core/Quat.cpp
+++ b/src/core/Quat.cpp
@@ -247,10 +247,10 @@ void Quat::operator-=(const Quat &q) {
}
void Quat::operator*=(const Quat &q) {
- x *= q.x;
- y *= q.y;
- z *= q.z;
- w *= q.w;
+ set(w * q.x + x * q.w + y * q.z - z * q.y,
+ w * q.y + y * q.w + z * q.x - x * q.z,
+ w * q.z + z * q.w + x * q.y - y * q.x,
+ w * q.w - x * q.x - y * q.y - z * q.z);
}
void Quat::operator*=(const real_t &s) {