4#include <game/mLib/m_mtx.hpp>
6mMtx_c mMtx_c::Identity =
mMtx_c(1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, 0.0f);
8mMtx_c::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) {
24 float cos = angle.
cos();
25 float sin = angle.
sin();
42 if ((s16) angle.
mAngle != 0) {
44 rotatedMtx.
XrotS(angle);
45 PSMTXConcat(*
this, rotatedMtx, *
this);
50 float cos = angle.
cos();
51 float sin = angle.
sin();
68 if ((s16) angle.
mAngle != 0) {
70 rotatedMtx.
YrotS(angle);
71 PSMTXConcat(*
this, rotatedMtx, *
this);
76 float cos = angle.
cos();
77 float sin = angle.
sin();
94 if ((s16) angle.
mAngle != 0) {
96 rotatedMtx.
ZrotS(angle);
97 PSMTXConcat(*
this, rotatedMtx, *
this);
114inline float calcLengthSq(
float x,
float y) {
122 float cos = nw4r::math::FSqrt(calcLengthSq(m[0][2], m[2][2]));
126 if (xRot == 0x4000 || xRot == -0x4000) {
A three-dimensional short angle vector.
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.
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.
s16 atan2s(float sin, float cos)
Converts a sine and a cosine to an angle in units.
A one-dimensional short angle vector.
float cos() const
Computes the cosine of the angle.
float sin() const
Computes the sine of the angle.