summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2020-10-22 22:48:22 -0500
committeriwubcode <iwubcode@users.noreply.github.com>2021-01-27 18:22:10 -0600
commit544692f96a09c1a76ff259bc1b5e91e9fef57bc4 (patch)
tree581c7259f972499f6bb0fd2620bf8a6115e97def /Source/Core
parent4740c2a882fc13fe93adae74139caadc0917c100 (diff)
Common: add convenience function to convert a Quaternion to a Matrix44
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/Matrix.cpp5
-rw-r--r--Source/Core/Common/Matrix.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/Matrix.cpp b/Source/Core/Common/Matrix.cpp
index 48adcba274..421dda28f5 100644
--- a/Source/Core/Common/Matrix.cpp
+++ b/Source/Core/Common/Matrix.cpp
@@ -269,6 +269,11 @@ Matrix44 Matrix44::FromMatrix33(const Matrix33& m33)
return mtx;
}
+Matrix44 Matrix44::FromQuaternion(const Quaternion& q)
+{
+ return FromMatrix33(Matrix33::FromQuaternion(q));
+}
+
Matrix44 Matrix44::FromArray(const std::array<float, 16>& arr)
{
Matrix44 mtx;
diff --git a/Source/Core/Common/Matrix.h b/Source/Core/Common/Matrix.h
index 56840acab1..7c679a6229 100644
--- a/Source/Core/Common/Matrix.h
+++ b/Source/Core/Common/Matrix.h
@@ -402,6 +402,7 @@ class Matrix44
public:
static Matrix44 Identity();
static Matrix44 FromMatrix33(const Matrix33& m33);
+ static Matrix44 FromQuaternion(const Quaternion& q);
static Matrix44 FromArray(const std::array<float, 16>& arr);
static Matrix44 Translate(const Vec3& vec);