summaryrefslogtreecommitdiff
path: root/Source/Core/Common/Matrix.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Source/Core/Common/Matrix.cpp')
-rw-r--r--Source/Core/Common/Matrix.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/Source/Core/Common/Matrix.cpp b/Source/Core/Common/Matrix.cpp
index 421dda28f5..9f5ff40cb3 100644
--- a/Source/Core/Common/Matrix.cpp
+++ b/Source/Core/Common/Matrix.cpp
@@ -56,6 +56,13 @@ Quaternion Quaternion::RotateZ(float rad)
return Rotate(rad, Vec3(0, 0, 1));
}
+Quaternion Quaternion::RotateXYZ(const Vec3& rads)
+{
+ const auto length = rads.Length();
+ return length ? Common::Quaternion::Rotate(length, rads / length) :
+ Common::Quaternion::Identity();
+}
+
Quaternion Quaternion::Rotate(float rad, const Vec3& axis)
{
const auto sin_angle_2 = std::sin(rad / 2);