Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5bdcecf

Browse files
authored
Merge pull request godotengine#289 from 2shady4u/master
Fixed wrong implementation of Quat multiplication
2 parents 0220045 + 041b97e commit 5bdcecf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core/Quat.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -247,10 +247,10 @@ void Quat::operator-=(const Quat &q) {
247247
}
248248

249249
void Quat::operator*=(const Quat &q) {
250-
x *= q.x;
251-
y *= q.y;
252-
z *= q.z;
253-
w *= q.w;
250+
set(w * q.x + x * q.w + y * q.z - z * q.y,
251+
w * q.y + y * q.w + z * q.x - x * q.z,
252+
w * q.z + z * q.w + x * q.y - y * q.x,
253+
w * q.w - x * q.x - y * q.y - z * q.z);
254254
}
255255

256256
void Quat::operator*=(const real_t &s) {

0 commit comments

Comments
 (0)