Fix Quaternion multiplication operator

This commit is contained in:
Aaron Franke 2021-11-04 11:24:39 -05:00
parent 518ec9ca75
commit 744b43b527
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
2 changed files with 12 additions and 23 deletions

View file

@ -86,13 +86,6 @@ public:
void operator*=(const Quaternion &p_q);
Quaternion operator*(const Quaternion &p_q) const;
Quaternion operator*(const Vector3 &v) const {
return Quaternion(w * v.x + y * v.z - z * v.y,
w * v.y + z * v.x - x * v.z,
w * v.z + x * v.y - y * v.x,
-x * v.x - y * v.y - z * v.z);
}
_FORCE_INLINE_ Vector3 xform(const Vector3 &v) const {
#ifdef MATH_CHECKS
ERR_FAIL_COND_V_MSG(!is_normalized(), v, "The quaternion must be normalized.");