diff --git a/math/quat.cpp b/math/quat.cpp index 9225059c4a1..6ded209aea0 100644 --- a/math/quat.cpp +++ b/math/quat.cpp @@ -238,6 +238,15 @@ void Quaternion::getEuler(Angle *first, Angle *second, Angle *third, EulerOrder *third = t; } +Quaternion& Quaternion::operator=(const Quaternion& quat) { + x() = quat.x(); + y() = quat.y(); + z() = quat.z(); + w() = quat.w(); + + return *this; +} + Quaternion Quaternion::operator*(const Quaternion &o) const { return Quaternion( w() * o.x() + x() * o.w() + y() * o.z() - z() * o.y(), diff --git a/math/quat.h b/math/quat.h index 4b490bdfec6..b7f287e0b18 100644 --- a/math/quat.h +++ b/math/quat.h @@ -197,11 +197,11 @@ public: Angle getAngleBetween(const Quaternion &to); /** - * Assignment operator for assigning a vector of values (X,Y,Z,W) to a Quaternion - * @param vec The source vector + * Assignment operator + * @param vec The source quaternion * @return A reference to this Quaternion */ - Quaternion& operator=(Vector4d &vec); + Quaternion& operator=(const Quaternion& quat); /** * Multiply two Quaternions