Ult3D
Implementation of "Ultimate 3D Game Engine Design & Architecture" by Allan Sherrod
Loading...
Searching...
No Matches
Matrix4x4.h
Go to the documentation of this file.
1#ifndef ULT_MATH_MATRIX4X4_H_INCLUDED
2#define ULT_MATH_MATRIX4X4_H_INCLUDED
3
4namespace Ult
5{
6
7class Vector3D;
8
14{
15public:
19 Matrix4x4();
25 const float r11, const float r12, const float r13, const float r14,
26 const float r21, const float r22, const float r23, const float r24,
27 const float r31, const float r32, const float r33, const float r34,
28 const float r41, const float r42, const float r43, const float r44
29 );
30
34 void Add(const Matrix4x4& m1, const Matrix4x4& m2);
38 void Subtract(const Matrix4x4& m1, const Matrix4x4& m2);
42 void Multiple(const Matrix4x4& m1, const Matrix4x4& m2);
43
47 void operator=(const Matrix4x4& m);
51 Matrix4x4 operator-(const Matrix4x4& m) const;
55 Matrix4x4 operator+(const Matrix4x4& m) const;
59 Matrix4x4 operator*(const Matrix4x4& m) const;
60
64 void Identity();
68 void Zero();
69
71 void Translate(const Vector3D& v);
73 void Translate(const float x, const float y, const float z);
74
77
83 bool InverseMatrix(const Matrix4x4& m);
88 void InvertMatrix(const Matrix4x4& m);
89
105
109 void Transpose(const Matrix4x4& m);
113 void Scale(const Vector3D& scale);
114
118 void SetRotationRadians(const float x, const float y, const float z);
122 void Rotate(const float angleDegrees, const int x, const int y, const int z);
126 void RotateAxis(const float angleDegrees, const Vector3D& axis);
130 void RotateX(const float angleDegrees);
134 void RotateY(const float angleDegrees);
138 void RotateZ(const float angleDegrees);
139
143 void CreateViewMatrix(const Vector3D& pos, const Vector3D& dir, const Vector3D& up, const Vector3D& right);
144
146 float matrix[16];
147};
148
149} // namespace Ult
150
151#endif // ULT_MATH_MATRIX4X4_H_INCLUDED
152
void Scale(const Vector3D &scale)
Definition Matrix4x4.cpp:377
void operator=(const Matrix4x4 &m)
Definition Matrix4x4.cpp:114
void Identity()
Definition Matrix4x4.cpp:210
void Rotate(const float angleDegrees, const int x, const int y, const int z)
Definition Matrix4x4.cpp:401
void RotateZ(const float angleDegrees)
Definition Matrix4x4.cpp:463
Vector3D InverseTranslateVector(const Vector3D &v) const
Definition Matrix4x4.cpp:241
Matrix4x4 operator-(const Matrix4x4 &m) const
Definition Matrix4x4.cpp:133
void Translate(const Vector3D &v)
Definition Matrix4x4.cpp:226
Vector3D VectorMatrixMultiply3x3(const Vector3D &v) const
Definition Matrix4x4.cpp:338
void Zero()
Definition Matrix4x4.cpp:218
bool InverseMatrix(const Matrix4x4 &m)
Definition Matrix4x4.cpp:246
void RotateY(const float angleDegrees)
Definition Matrix4x4.cpp:456
void RotateAxis(const float angleDegrees, const Vector3D &axis)
Definition Matrix4x4.cpp:428
void SetRotationRadians(const float x, const float y, const float z)
Definition Matrix4x4.cpp:384
void InvertMatrix(const Matrix4x4 &m)
Definition Matrix4x4.cpp:316
Vector3D VectorMatrixMultiply3x3Inv(const Vector3D &v) const
Definition Matrix4x4.cpp:346
float matrix[16]
Definition Matrix4x4.h:146
void Multiple(const Matrix4x4 &m1, const Matrix4x4 &m2)
Definition Matrix4x4.cpp:88
void Subtract(const Matrix4x4 &m1, const Matrix4x4 &m2)
Definition Matrix4x4.cpp:66
void RotateX(const float angleDegrees)
Definition Matrix4x4.cpp:449
Vector3D VectorMatrixMultiply(const Vector3D &v) const
Definition Matrix4x4.cpp:330
void Transpose(const Matrix4x4 &m)
Definition Matrix4x4.cpp:355
Matrix4x4 operator+(const Matrix4x4 &m) const
Definition Matrix4x4.cpp:157
Matrix4x4 operator*(const Matrix4x4 &m) const
Definition Matrix4x4.cpp:181
void Add(const Matrix4x4 &m1, const Matrix4x4 &m2)
Definition Matrix4x4.cpp:44
void CreateViewMatrix(const Vector3D &pos, const Vector3D &dir, const Vector3D &up, const Vector3D &right)
Definition Matrix4x4.cpp:471
Matrix4x4()
Definition Matrix4x4.cpp:12
Definition Vector3D.h:12
Definition Archive.h:13