3#include <game/mLib/m_angle.hpp>
4#include <game/mLib/m_vec.hpp>
18 mMtx_c(
float _00,
float _01,
float _02,
float _03,
float _10,
float _11,
float _12,
float _13,
float _20,
float _21,
float _22,
float _23);
21 operator Mtx*() {
return &mtx; }
24 operator const Mtx*()
const {
return &mtx; }
27 for (
int i = 0; i < 3; i++) {
28 for (
int j = 0; j < 4; j++) {
29 m[i][j] = other.m[i][j];
35 void XrotS(mAng angle);
36 void XrotM(mAng angle);
37 void YrotS(mAng angle);
38 void YrotM(mAng angle);
39 void ZrotS(mAng angle);
40 void ZrotM(mAng angle);
42 void ZXYrotM(mAng xRot, mAng yRot, mAng zRot);
43 void XYZrotM(mAng xRot, mAng yRot, mAng zRot);
45 void toRot(mAng3_c &out)
const;
49 mVec3_c getTranslation()
const {
53 return mVec3_c(x, y, z);
56 static mMtx_c createTrans(
const mVec3_c &v) {
return createTrans(v.x, v.y, v.z); }
57 static mMtx_c createTrans(
float x,
float y,
float z) {
mMtx_c mtx; PSMTXTrans(mtx, x, y, z);
return mtx; }
58 static mMtx_c createScale(
const mVec3_c &v) {
mMtx_c mtx; PSMTXScale(mtx, v.x, v.y, v.z);
return mtx; }
59 static mMtx_c createScale(
float x,
float y,
float z) {
mMtx_c mtx; PSMTXScale(mtx, x, y, z);
return mtx; }
61 mMtx_c &concat(
const mMtx_c &other) { PSMTXConcat(*
this, other, *
this);
return *
this; }
62 mMtx_c &trans(
const mVec3_c &v) { PSMTXTrans(*
this, v.x, v.y, v.z);
return *
this; }
63 mMtx_c &trans(
float x,
float y,
float z) { PSMTXTrans(*
this, x, y, z);
return *
this; }
66 float transX()
const {
return getTranslation().x; }
67 float transY()
const {
return getTranslation().y; }
68 float transZ()
const {
return getTranslation().z; }
mAng y
The rotation on the Y axis.
mAng z
The rotation on the Z axis.
mAng x
The rotation on the X axis.
mMtx_c()
Constructs an empty matrix.
void ZrotS(mAng angle)
Generates a rotation matrix for the Z axis with the given angle.
void XYZrotM(mAng xRot, mAng yRot, mAng zRot)
Rotates the matrix on the Z, Y and X axes by the given angles.
void toRot(mAng3_c &out) const
Extracts the rotation vector from the matrix.
void multVecZero(nw4r::math::VEC3 &out) const
Extracts the translation vector from the matrix.
mMtx_c(const nw4r::math::MTX34 &mtx)
Constructs a matrix from an MTX34.
void ZrotM(mAng angle)
Rotates the matrix on the Z axis by the given angle.
void XrotS(mAng angle)
Generates a rotation matrix for the X axis with the given angle.
void YrotS(mAng angle)
Generates a rotation matrix for the Y axis with the given angle.
void ZXYrotM(mAng xRot, mAng yRot, mAng zRot)
Rotates the matrix on the Y, X and Z axes by the given angles.
static mMtx_c Identity
The identity matrix.
void XrotM(mAng angle)
Rotates the matrix on the X axis by the given angle.
void zero()
Zeroes out the matrix.
void YrotM(mAng angle)
Rotates the matrix on the Y axis by the given angle.