#pragma once #include #ifndef SEAD_MATH_MATRIX_H_ #include #endif namespace sead { template inline Matrix22::Matrix22(T a00, T a01, T a10, T a11) { this->m[0][0] = a00; this->m[0][1] = a01; this->m[1][0] = a10; this->m[1][1] = a11; } template inline T Matrix22::operator()(s32 i, s32 j) const { return this->m[i][j]; } template inline T& Matrix22::operator()(s32 i, s32 j) { return this->m[i][j]; } template inline Matrix22& Matrix22::operator=(const Self& n) { Matrix22CalcCommon::copy(*this, n); return *this; } template inline void Matrix22::makeIdentity() { Matrix22CalcCommon::makeIdentity(*this); } template inline void Matrix22::makeZero() { Matrix22CalcCommon::makeZero(*this); } template inline void Matrix22::setInverse(const Self& n) { Matrix22CalcCommon::inverse(*this, n); } template inline void Matrix22::setInverseTranspose(const Self& n) { Matrix22CalcCommon::inverseTranspose(*this, n); } template inline void Matrix22::setMul(const Self& a, const Self& b) { Matrix22CalcCommon::multiply(*this, a, b); } template inline void Matrix22::setTranspose(const Self& n) { Matrix22CalcCommon::transposeTo(*this, n); } template inline void Matrix22::transpose() { Matrix22CalcCommon::transpose(*this); } template inline Matrix33::Matrix33(T a00, T a01, T a02, T a10, T a11, T a12, T a20, T a21, T a22) { this->m[0][0] = a00; this->m[0][1] = a01; this->m[0][2] = a02; this->m[1][0] = a10; this->m[1][1] = a11; this->m[1][2] = a12; this->m[2][0] = a20; this->m[2][1] = a21; this->m[2][2] = a22; } template inline Matrix33::Matrix33(const Mtx34& mtx34) { Matrix33CalcCommon::copy(*this, mtx34); } template inline T Matrix33::operator()(s32 i, s32 j) const { return this->m[i][j]; } template inline T& Matrix33::operator()(s32 i, s32 j) { return this->m[i][j]; } template inline Matrix33& Matrix33::operator=(const Self& n) { Matrix33CalcCommon::copy(*this, n); return *this; } template inline void Matrix33::makeIdentity() { Matrix33CalcCommon::makeIdentity(*this); } template inline void Matrix33::makeZero() { Matrix33CalcCommon::makeZero(*this); } template inline void Matrix33::setInverse(const Self& n) { Matrix33CalcCommon::inverse(*this, n); } template inline void Matrix33::setInverseTranspose(const Self& n) { Matrix33CalcCommon::inverseTranspose(*this, n); } template inline void Matrix33::setMul(const Self& a, const Self& b) { Matrix33CalcCommon::multiply(*this, a, b); } template inline void Matrix33::setMul(const Mtx34& a, const Self& b) { Matrix33CalcCommon::multiply(*this, a, b); } template inline void Matrix33::setMul(const Self& a, const Mtx34& b) { Matrix33CalcCommon::multiply(*this, a, b); } template inline void Matrix33::setTranspose(const Self& n) { Matrix33CalcCommon::transposeTo(*this, n); } template inline void Matrix33::transpose() { Matrix33CalcCommon::transpose(*this); } template inline void Matrix33::fromQuat(const Quat& q) { Matrix33CalcCommon::makeQ(*this, q); } template inline void Matrix33::makeR(const Vec3& r) { Matrix33CalcCommon::makeR(*this, r); } template inline void Matrix33::makeRIdx(u32 xr, u32 yr, u32 zr) { Matrix33CalcCommon::makeRIdx(*this, xr, yr, zr); } template inline void Matrix33::makeRzxyIdx(u32 xr, u32 yr, u32 zr) { Matrix33CalcCommon::makeRzxyIdx(*this, xr, yr, zr); } template inline void Matrix33::makeS(const Vec3& s) { Matrix33CalcCommon::makeS(*this, s); } template inline void Matrix33::makeS(T x, T y, T z) { Vec3 s(x, y, z); Matrix33CalcCommon::makeS(*this, s); } template inline void Matrix33::makeSR(const Vec3& s, const Vec3& r) { Matrix33CalcCommon::makeSR(*this, s, r); } template inline void Matrix33::makeSRIdx(const Vec3& s, const Vector3& r) { Matrix33CalcCommon::makeSRIdx(*this, s, r); } template inline void Matrix33::makeSRzxyIdx(const Vec3& s, const Vector3& r) { Matrix33CalcCommon::makeSRzxyIdx(*this, s, r); } template inline void Matrix33::toQuat(Quat& q) const { Matrix33CalcCommon::toQuat(q, *this); } template inline Matrix34::Matrix34(T a00, T a01, T a02, T a03, T a10, T a11, T a12, T a13, T a20, T a21, T a22, T a23) { this->m[0][0] = a00; this->m[0][1] = a01; this->m[0][2] = a02; this->m[0][3] = a03; this->m[1][0] = a10; this->m[1][1] = a11; this->m[1][2] = a12; this->m[1][3] = a13; this->m[2][0] = a20; this->m[2][1] = a21; this->m[2][2] = a22; this->m[2][3] = a23; } template inline Matrix34::Matrix34(const Mtx33& mtx33, const Vec3& t) { Matrix34CalcCommon::copy(*this, mtx33, t); } template inline Matrix34::Matrix34(const Mtx44& mtx44) { Matrix34CalcCommon::copy(*this, mtx44); } template inline T Matrix34::operator()(s32 i, s32 j) const { return this->m[i][j]; } template inline T& Matrix34::operator()(s32 i, s32 j) { return this->m[i][j]; } template inline Matrix34& Matrix34::operator=(const Self& n) { Matrix34CalcCommon::copy(*this, n); return *this; } template inline void Matrix34::makeIdentity() { Matrix34CalcCommon::makeIdentity(*this); } template inline void Matrix34::makeZero() { Matrix34CalcCommon::makeZero(*this); } template inline void Matrix34::setInverse(const Self& n) { Matrix34CalcCommon::inverse(*this, n); } template inline void Matrix34::setInverse33(const Self& n) { Matrix34CalcCommon::inverse33(*this, n); } template inline void Matrix34::setInverseTranspose(const Self& n) { Matrix34CalcCommon::inverseTranspose(*this, n); } template inline void Matrix34::setMul(const Self& a, const Self& b) { Matrix34CalcCommon::multiply(*this, a, b); } template inline void Matrix34::setMul(const Mtx33& a, const Self& b) { Matrix34CalcCommon::multiply(*this, a, b); } template inline void Matrix34::setTranspose(const Self& n) { Matrix34CalcCommon::transposeTo(*this, n); } template inline void Matrix34::transpose() { Matrix34CalcCommon::transpose(*this); } template inline void Matrix34::fromQuat(const Quat& q) { Matrix34CalcCommon::makeQ(*this, q); } template inline void Matrix34::makeQT(const Quat& q, const Vec3& t) { Matrix34CalcCommon::makeQT(*this, q, t); } template inline void Matrix34::makeR(const Vec3& r) { Matrix34CalcCommon::makeR(*this, r); } template inline void Matrix34::makeRIdx(u32 xr, u32 yr, u32 zr) { Matrix34CalcCommon::makeRIdx(*this, xr, yr, zr); } template inline void Matrix34::makeRT(const Vec3& r, const Vec3& t) { Matrix34CalcCommon::makeRT(*this, r, t); } template inline void Matrix34::makeRTIdx(const Vector3& r, const Vec3& t) { Matrix34CalcCommon::makeRTIdx(*this, r, t); } template inline void Matrix34::makeRzxyIdx(u32 xr, u32 yr, u32 zr) { Matrix34CalcCommon::makeRzxyIdx(*this, xr, yr, zr); } template inline void Matrix34::makeRzxyTIdx(const Vector3& r, const Vec3& t) { Matrix34CalcCommon::makeRzxyTIdx(*this, r, t); } template inline void Matrix34::makeS(const Vec3& s) { Matrix34CalcCommon::makeS(*this, s); } template inline void Matrix34::makeS(T x, T y, T z) { Vec3 s(x, y, z); Matrix34CalcCommon::makeS(*this, s); } template inline void Matrix34::makeSR(const Vec3& s, const Vec3& r) { Matrix34CalcCommon::makeSR(*this, s, r); } template inline void Matrix34::makeSRIdx(const Vec3& s, const Vector3& r) { Matrix34CalcCommon::makeSRIdx(*this, s, r); } template inline void Matrix34::makeSRT(const Vec3& s, const Vec3& r, const Vec3& t) { Matrix34CalcCommon::makeSRT(*this, s, r, t); } template inline void Matrix34::makeSRTIdx(const Vec3& s, const Vector3& r, const Vec3& t) { Matrix34CalcCommon::makeSRTIdx(*this, s, r, t); } template inline void Matrix34::makeSRzxyIdx(const Vec3& s, const Vector3& r) { Matrix34CalcCommon::makeSRzxyIdx(*this, s, r); } template inline void Matrix34::makeSRzxyTIdx(const Vec3& s, const Vector3& r, const Vec3& t) { Matrix34CalcCommon::makeSRzxyTIdx(*this, s, r, t); } template inline void Matrix34::makeST(const Vec3& s, const Vec3& t) { Matrix34CalcCommon::makeST(*this, s, t); } template inline void Matrix34::makeT(const Vec3& t) { Matrix34CalcCommon::makeT(*this, t); } template inline void Matrix34::makeT(T x, T y, T z) { Vec3 t(x, y, z); Matrix34CalcCommon::makeT(*this, t); } template inline void Matrix34::toQuat(Quat& q) const { Matrix34CalcCommon::toQuat(q, *this); } template inline void Matrix34::getBase(Vec3& o, s32 axis) const { Matrix34CalcCommon::getBase(o, *this, axis); } template inline void Matrix34::getRow(Vec4& o, s32 row) const { Matrix34CalcCommon::getRow(o, *this, row); } template inline void Matrix34::getTranslation(Vec3& o) const { Matrix34CalcCommon::getTranslation(o, *this); } template inline void Matrix34::getRotation(Vec3& o) const { Matrix34CalcCommon::getRotation(o, *this); } template inline void Matrix34::scaleAllElements(T s) { Matrix34CalcCommon::scaleAllElements(*this, s); } template inline void Matrix34::scaleBases(T sx, T sy, T sz) { Matrix34CalcCommon::scaleBases(*this, sx, sy, sz); } template inline void Matrix34::setBase(s32 axis, const Vec3& v) { Matrix34CalcCommon::setBase(*this, axis, v); } template inline void Matrix34::setRow(s32 row, const Vec4& v) { Matrix34CalcCommon::setRow(*this, v, row); } template inline void Matrix34::setTranslation(const Vec3& t) { Matrix34CalcCommon::setTranslation(*this, t); } template inline void Matrix34::setTranslation(T x, T y, T z) { Vec3 t(x, y, z); Matrix34CalcCommon::setTranslation(*this, t); } template inline Matrix44::Matrix44(T a00, T a01, T a02, T a03, T a10, T a11, T a12, T a13, T a20, T a21, T a22, T a23, T a30, T a31, T a32, T a33) { this->m[0][0] = a00; this->m[0][1] = a01; this->m[0][2] = a02; this->m[0][3] = a03; this->m[1][0] = a10; this->m[1][1] = a11; this->m[1][2] = a12; this->m[1][3] = a13; this->m[2][0] = a20; this->m[2][1] = a21; this->m[2][2] = a22; this->m[2][3] = a23; this->m[3][0] = a30; this->m[3][1] = a31; this->m[3][2] = a32; this->m[3][3] = a33; } template inline Matrix44::Matrix44(const Mtx33& mtx33, const Vec3& t, const Vec4& vw) { Matrix44CalcCommon::copy(*this, mtx33, t, vw); } template inline Matrix44::Matrix44(const Mtx34& mtx34, const Vec4& vw) { Matrix44CalcCommon::copy(*this, mtx34, vw); } template inline T Matrix44::operator()(s32 i, s32 j) const { return this->m[i][j]; } template inline T& Matrix44::operator()(s32 i, s32 j) { return this->m[i][j]; } template inline Matrix44& Matrix44::operator=(const Self& n) { Matrix44CalcCommon::copy(*this, n); return *this; } template inline void Matrix44::makeIdentity() { Matrix44CalcCommon::makeIdentity(); } template inline void Matrix44::makeZero() { Matrix44CalcCommon::makeZero(); } template inline void Matrix44::setInverse(const Self& n) { Matrix44CalcCommon::inverse(*this, n); } template inline void Matrix44::setMul(const Self& a, const Self& b) { Matrix44CalcCommon::multiply(*this, a, b); } template inline void Matrix44::setMul(const Mtx34& a, const Self& b) { Matrix44CalcCommon::multiply(*this, a, b); } template inline void Matrix44::setMul(const Self& a, const Mtx34& b) { Matrix44CalcCommon::multiply(*this, a, b); } template inline void Matrix44::setTranspose(const Self& n) { Matrix44CalcCommon::transposeTo(*this, n); } template inline void Matrix44::transpose() { Matrix44CalcCommon::transpose(*this); } template inline void Matrix44::fromQuat(const Quat& q) { Matrix44CalcCommon::makeQ(*this, q); } template inline void Matrix44::makeR(const Vec3& r) { Matrix44CalcCommon::makeR(*this, r); } template inline void Matrix44::makeRIdx(u32 xr, u32 yr, u32 zr) { Matrix44CalcCommon::makeRIdx(*this, xr, yr, zr); } template inline void Matrix44::makeRzxyIdx(u32 xr, u32 yr, u32 zr) { Matrix44CalcCommon::makeRzxyIdx(*this, xr, yr, zr); } template inline void Matrix44::toQuat(Quat& q) const { Matrix44CalcCommon::toQuat(q, *this); } template inline void Matrix44::getCol(Vec4& o, s32 axis) const { Matrix44CalcCommon::getCol(o, *this, axis); } template inline void Matrix44::getRow(Vec4& o, s32 row) const { Matrix44CalcCommon::getRow(o, *this, row); } template inline void Matrix44::scaleAllElements(T s) { Matrix44CalcCommon::scaleAllElements(*this, s); } template inline void Matrix44::scaleBases(T sx, T sy, T sz, T sw) { Matrix44CalcCommon::scaleBases(*this, sx, sy, sz, sw); } template inline void Matrix44::setCol(s32 axis, const Vec4& v) { Matrix44CalcCommon::setCol(*this, axis, v); } template inline void Matrix44::setRow(s32 row, const Vec4& v) { Matrix44CalcCommon::setRow(*this, row, v); } } // namespace sead