Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions include/math/seadMatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ class Matrix33 : public Policies<T>::Mtx33Base
void setMul(const Self& a, const Mtx34& b);
void setTranspose(const Self& n);
void transpose();
void slerpTo(const Self& m1, const Self& m2, f32 t);

void fromQuat(const Quat<T>& q);
void makeR(const Vec3& r);
Expand Down Expand Up @@ -169,6 +170,7 @@ class Matrix34 : public Policies<T>::Mtx34Base

void setTranspose(const Self& n);
void transpose();
void slerpTo(const Self& m1, const Self& m2, f32 t);

void fromQuat(const QuatT& q);
void makeQT(const QuatT& q, const Vec3& t);
Expand Down Expand Up @@ -249,6 +251,7 @@ class Matrix44 : public Policies<T>::Mtx44Base
void setMul(const Self& a, const Mtx34& b);
void setTranspose(const Self& n);
void transpose();
void slerpTo(const Self& m1, const Self& m2, f32 t);

void fromQuat(const Quat<T>& q);
void makeR(const Vec3& r);
Expand Down
18 changes: 18 additions & 0 deletions include/math/seadMatrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,12 @@ inline void Matrix33<T>::transpose()
Matrix33CalcCommon<T>::transpose(*this);
}

template <typename T>
inline void Matrix33<T>::slerpTo(const Self& m1, const Self& m2, f32 t)
{
Matrix33CalcCommon<T>::slerpTo(*this, m1, m2, t);
}

template <typename T>
inline void Matrix33<T>::fromQuat(const Quat<T>& q)
{
Expand Down Expand Up @@ -397,6 +403,12 @@ inline void Matrix34<T>::transpose()
Matrix34CalcCommon<T>::transpose(*this);
}

template <typename T>
inline void Matrix34<T>::slerpTo(const Self& m1, const Self& m2, f32 t)
{
Matrix34CalcCommon<T>::slerpTo(*this, m1, m2, t);
}

template <typename T>
inline void Matrix34<T>::fromQuat(const QuatT& q)
{
Expand Down Expand Up @@ -722,6 +734,12 @@ inline void Matrix44<T>::transpose()
Matrix44CalcCommon<T>::transpose(*this);
}

template <typename T>
inline void Matrix44<T>::slerpTo(const Self& m1, const Self& m2, f32 t)
{
Matrix44CalcCommon<T>::slerpTo(*this, m1, m2, t);
}

template <typename T>
inline void Matrix44<T>::fromQuat(const Quat<T>& q)
{
Expand Down
3 changes: 3 additions & 0 deletions include/math/seadMatrixCalcCommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class Matrix33CalcCommon
static void multiply(Base& o, const Base& a, const Mtx34& b);
static void transpose(Base& o);
static void transposeTo(Base& o, const Base& n);
static void slerpTo(Base& o, const Base& m1, const Base& m2, f32 t);

static void makeQ(Base& o, const Quat& q);
static void makeR(Base& o, const Vec3& r);
Expand Down Expand Up @@ -91,6 +92,7 @@ class Matrix34CalcCommon
static void multiply(Base& o, const Base& a, const Mtx33& b);
static void transpose(Base& o);
static void transposeTo(Base& o, const Base& n);
static void slerpTo(Base& o, const Base& m1, const Base& m2, f32 t);

static void makeQ(Base& o, const Quat& q);
static void makeQT(Base& o, const Quat& q, const Vec3& t);
Expand Down Expand Up @@ -150,6 +152,7 @@ class Matrix44CalcCommon
static void multiply(Base& o, const Base& a, const Mtx34& b);
static void transpose(Base& o);
static void transposeTo(Base& o, const Base& n);
static void slerpTo(Base& o, const Base& m1, const Base& m2, f32 t);

static void makeQ(Base& o, const Quat& q);
static void makeR(Base& o, const Vec3& r);
Expand Down
40 changes: 40 additions & 0 deletions include/math/seadMatrixCalcCommon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include <cmath>

#include <math/seadMathCalcCommon.h>
#include <math/seadQuatCalcCommon.h>
#ifndef SEAD_MATH_MATRIX_CALC_COMMON_H_
#include <math/seadMatrixCalcCommon.h>
#endif
Expand Down Expand Up @@ -431,6 +432,19 @@ void Matrix33CalcCommon<T>::transposeTo(Base& o, const Base& n)
o.m[2][2] = n.m[2][2];
}

template <typename T>
void Matrix33CalcCommon<T>::slerpTo(Base& o, const Base& m1, const Base& m2, f32 t)
{
Quat q1, q2;
toQuat(q1, m1);
toQuat(q2, m2);

Quat qT;
QuatCalcCommon<T>::slerpTo(qT, q1, q2, t);

makeQ(o, qT);
}

template <typename T>
void Matrix33CalcCommon<T>::makeQ(Base& o, const Quat& q)
{
Expand Down Expand Up @@ -1224,6 +1238,19 @@ void Matrix34CalcCommon<T>::transposeTo(Base& o, const Base& n)

#endif // cafe

template <typename T>
void Matrix34CalcCommon<T>::slerpTo(Base& o, const Base& m1, const Base& m2, f32 t)
{
Quat q1, q2;
toQuat(q1, m1);
toQuat(q2, m2);

Quat qT;
QuatCalcCommon<T>::slerpTo(qT, q1, q2, t);

makeQ(o, qT);
}

template <typename T>
void Matrix34CalcCommon<T>::makeQ(Base& o, const Quat& q)
{
Expand Down Expand Up @@ -2475,6 +2502,19 @@ void Matrix44CalcCommon<T>::transposeTo(Base& o, const Base& n)
o.m[3][3] = n.m[3][3];
}

template <typename T>
void Matrix44CalcCommon<T>::slerpTo(Base& o, const Base& m1, const Base& m2, f32 t)
{
Quat q1, q2;
toQuat(q1, m1);
toQuat(q2, m2);

Quat qT;
QuatCalcCommon<T>::slerpTo(qT, q1, q2, t);

makeQ(o, qT);
}

template <typename T>
void Matrix44CalcCommon<T>::makeQ(Base& o, const Quat& q)
{
Expand Down
Loading