23#ifndef INCLUDED_MATRIX3D
24#define INCLUDED_MATRIX3D
61 float a11,
float a12,
float a13,
float a14,
62 float a21,
float a22,
float a23,
float a24,
63 float a31,
float a32,
float a33,
float a34,
64 float a41,
float a42,
float a43,
float a44) :
75 _13(data[8]),
_23(data[9]),
_33(data[10]),
_43(data[11]),
76 _14(data[12]),
_24(data[13]),
_34(data[14]),
_44(data[15])
83 _13(data[8]),
_23(data[9]),
_33(data[10]),
_43(data[11]),
84 _14(data[12]),
_24(data[13]),
_34(data[14]),
_44(data[15])
94 return _data[row*4+col];
98 return _data[row*4+col];
139 *
this = *
this * matrix;
187 return !(*
this == m);
195 void SetOrtho(
float left,
float right,
float bottom,
float top,
float near,
float far);
197 void SetPerspective(
float fov,
float aspect,
float near,
float far);
198 void SetPerspectiveTile(
float fov,
float aspect,
float near,
float far,
int tiles,
int tile_x,
int tile_y);
203 (*this) = m * (*this);
249 void Translate(
float x,
float y,
float z);
256 void SetScaling(
float x_scale,
float y_scale,
float z_scale);
259 void Scale(
float x_scale,
float y_scale,
float z_scale);
340 sizeof(
CMatrix3D) ==
sizeof(
float) * 16u &&
344 "CMatrix3D should be properly layouted to use AsFloatArray");
Definition: Matrix3D.h:34
void RotateY(float angle)
Definition: Matrix3D.cpp:143
CVector3D GetIn() const
Definition: Matrix3D.cpp:279
float _43
Definition: Matrix3D.h:46
PS::span< const float > AsFloatArray() const
Definition: Matrix3D.h:335
CMatrix3D & operator+=(const CMatrix3D &m)
Definition: Matrix3D.h:166
void Transform(const CVector4D &vector, CVector4D &result) const
Definition: Matrix3D.h:307
float _34
Definition: Matrix3D.h:47
float _21
Definition: Matrix3D.h:44
void Concatenate(const CMatrix3D &m)
Definition: Matrix3D.h:201
void Scale(float x_scale, float y_scale, float z_scale)
Definition: Matrix3D.cpp:236
float _31
Definition: Matrix3D.h:44
CMatrix3D()
Definition: Matrix3D.h:56
float _11
Definition: Matrix3D.h:44
float _24
Definition: Matrix3D.h:47
float _42
Definition: Matrix3D.h:45
void RotateTransposed(const CVector3D &vector, CVector3D &result) const
Definition: Matrix3D.cpp:295
void SetTranslation(float x, float y, float z)
Definition: Matrix3D.cpp:184
void Blend(const CMatrix3D &m, float f)
Definition: Matrix3D.h:207
CQuaternion GetRotation() const
Definition: Matrix3D.cpp:386
CMatrix3D & operator*=(const CMatrix3D &matrix)
Definition: Matrix3D.h:137
const float & operator[](int idx) const
Definition: Matrix3D.h:105
CMatrix3D GetTranspose() const
Definition: Matrix3D.cpp:256
CMatrix3D(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34, float a41, float a42, float a43, float a44)
Definition: Matrix3D.h:60
float _13
Definition: Matrix3D.h:46
CMatrix3D operator+(const CMatrix3D &m) const
Definition: Matrix3D.h:155
void PostTranslate(float x, float y, float z)
Definition: Matrix3D.cpp:212
void AddBlend(const CMatrix3D &m, float f)
Definition: Matrix3D.h:216
void SetRotation(const CQuaternion &quat)
Definition: Matrix3D.cpp:424
float & operator[](int idx)
Definition: Matrix3D.h:101
float _33
Definition: Matrix3D.h:46
void SetYRotation(float angle)
Definition: Matrix3D.cpp:98
CMatrix3D operator*(float f) const
Definition: Matrix3D.h:144
float _32
Definition: Matrix3D.h:45
void SetXRotation(float angle)
Definition: Matrix3D.cpp:87
CVector3D Rotate(const CVector3D &vector) const
Definition: Matrix3D.h:316
float _14
Definition: Matrix3D.h:47
float _data2d[4][4]
Definition: Matrix3D.h:50
void Rotate(const CQuaternion &quat)
Definition: Matrix3D.cpp:380
void SetScaling(float x_scale, float y_scale, float z_scale)
Definition: Matrix3D.cpp:227
float _data[16]
Definition: Matrix3D.h:49
CMatrix3D(const float data[])
Definition: Matrix3D.h:80
float GetYRotation() const
Definition: Matrix3D.cpp:429
void SetZero()
Definition: Matrix3D.cpp:39
CMatrix3D operator*(const CMatrix3D &matrix) const
Definition: Matrix3D.h:111
void SetPerspective(float fov, float aspect, float near, float far)
Definition: Matrix3D.cpp:61
void Rotate(const CVector3D &vector, CVector3D &result) const
Definition: Matrix3D.h:323
const float & operator()(int col, int row) const
Definition: Matrix3D.h:96
float & operator()(int col, int row)
Definition: Matrix3D.h:92
CVector3D GetUp() const
Definition: Matrix3D.cpp:273
CVector3D GetTranslation() const
Definition: Matrix3D.cpp:221
void SetPerspectiveTile(float fov, float aspect, float near, float far, int tiles, int tile_x, int tile_y)
Definition: Matrix3D.cpp:73
void RotateZ(float angle)
Definition: Matrix3D.cpp:163
float _23
Definition: Matrix3D.h:46
bool operator==(const CMatrix3D &m) const
Definition: Matrix3D.h:176
void Translate(float x, float y, float z)
Definition: Matrix3D.cpp:198
CVector3D GetLeft() const
Definition: Matrix3D.cpp:267
void SetIdentity()
Definition: Matrix3D.cpp:30
float _12
Definition: Matrix3D.h:45
void RotateX(float angle)
Definition: Matrix3D.cpp:123
void Transform(const CVector3D &vector, CVector3D &result) const
Definition: Matrix3D.h:292
float _41
Definition: Matrix3D.h:44
float _44
Definition: Matrix3D.h:47
void SetZRotation(float angle)
Definition: Matrix3D.cpp:109
CVector4D Transform(const CVector4D &vector) const
Definition: Matrix3D.h:300
CMatrix3D(float data[])
Definition: Matrix3D.h:72
void SetOrtho(float left, float right, float bottom, float top, float near, float far)
Definition: Matrix3D.cpp:47
CMatrix3D GetInverse() const
Definition: Matrix3D.cpp:373
float _22
Definition: Matrix3D.h:45
bool operator!=(const CMatrix3D &m) const
Definition: Matrix3D.h:185
CVector3D Transform(const CVector3D &vector) const
Definition: Matrix3D.h:285
Definition: Quaternion.h:26
Definition: Vector3D.h:31
float Z
Definition: Vector3D.h:33
float Y
Definition: Vector3D.h:33
float X
Definition: Vector3D.h:33
Definition: Vector4D.h:31
float Z
Definition: Vector4D.h:142
float X
Definition: Vector4D.h:142
float W
Definition: Vector4D.h:142
float Y
Definition: Vector4D.h:142
Simplifed version of std::span (C++20) as we don't support the original one yet.
Definition: Span.h:37