 |
raylib-cpp
C++ object-oriented wrapper library for raylib.
|
25 #ifndef RAYLIB_CPP_INCLUDE_MATRIX_HPP_
26 #define RAYLIB_CPP_INCLUDE_MATRIX_HPP_
32 #ifndef RAYLIB_CPP_NO_MATH
39 #ifndef RAYLIB_CPP_NO_MATH
43 #include "./raylib-cpp-utils.hpp"
52 Matrix(
float M0 = 0,
float M1 = 0,
float M2 = 0,
float M3 = 0,
float M4 = 0,
float M5 = 0,
53 float M6 = 0,
float M7 = 0,
float M8 = 0,
float M9 = 0,
float M10 = 0,
float M11 = 0,
54 float M12 = 0,
float M13 = 0,
float M14 = 0,
float M15 = 0) {
73 GETTERSETTER(
float, M0, m0)
74 GETTERSETTER(
float, M1, m1)
75 GETTERSETTER(
float, M2, m2)
76 GETTERSETTER(
float, M3, m3)
77 GETTERSETTER(
float, M4, m4)
78 GETTERSETTER(
float, M5, m5)
79 GETTERSETTER(
float, M6, m6)
80 GETTERSETTER(
float, M7, m7)
81 GETTERSETTER(
float, M8, m8)
82 GETTERSETTER(
float, M9, m9)
83 GETTERSETTER(
float, M10, m10)
84 GETTERSETTER(
float, M11, m11)
85 GETTERSETTER(
float, M12, m12)
86 GETTERSETTER(
float, M13, m13)
87 GETTERSETTER(
float, M14, m14)
88 GETTERSETTER(
float, M15, m15)
101 return m0 == other.m0
120 return m0 == other.m0
142 ::SetMatrixProjection(*
this);
150 ::SetMatrixModelview(*
this);
158 return ::GetMatrixModelview();
165 return ::GetMatrixProjection();
168 #ifndef RAYLIB_CPP_NO_MATH
173 return ::MatrixTrace(*
this);
180 return ::MatrixTranspose(*
this);
184 return ::MatrixInvert(*
this);
188 return ::MatrixNormalize(*
this);
192 return ::MatrixIdentity();
196 return ::MatrixAdd(*
this, right);
200 return ::MatrixAdd(*
this, matrix);
204 return ::MatrixSubtract(*
this, right);
208 return ::MatrixSubtract(*
this, matrix);
212 return ::MatrixTranslate(x, y, z);
216 return ::MatrixRotate(axis, angle);
220 return ::MatrixRotateXYZ(angle);
224 return ::MatrixRotateX(angle);
228 return ::MatrixRotateY(angle);
232 return ::MatrixRotateZ(angle);
236 return ::MatrixScale(x, y, z);
240 return ::MatrixMultiply(*
this, right);
244 return ::MatrixMultiply(*
this, matrix);
248 double near,
double far) {
249 return ::MatrixFrustum(left, right, bottom, top, near, far);
253 return ::MatrixPerspective(fovy, aspect, near, far);
256 static Matrix Ortho(
double left,
double right,
double bottom,
double top,
257 double near,
double far) {
258 return ::MatrixOrtho(left, right, bottom, top, near, far);
262 return ::MatrixLookAt(eye, target, up);
266 return ::MatrixToFloatV(*
this);
277 ::SetShaderValueMatrix(shader, uniformLoc, *
this);
284 inline void set(const ::Matrix& mat) {
306 #endif // RAYLIB_CPP_INCLUDE_MATRIX_HPP_
Provides all the classes associated with raylib-cpp.
Matrix Transpose() const
Transposes provided matrix.
Matrix operator-(const ::Matrix &matrix)
bool operator==(::Matrix &other)
static Matrix Frustum(double left, double right, double bottom, double top, double near, double far)
Matrix(const ::Matrix &mat)
Matrix & SetShaderValue(::Shader shader, int uniformLoc)
Set shader uniform value (matrix 4x4)
static Matrix RotateXYZ(Vector3 angle)
static Matrix Scale(float x, float y, float z)
static Matrix Translate(float x, float y, float z)
static Matrix Rotate(Vector3 axis, float angle)
Matrix operator+(const ::Matrix &matrix)
Matrix operator*(const ::Matrix &matrix)
static Matrix RotateZ(float angle)
Matrix & SetProjection()
Set a custom projection matrix (replaces internal projection matrix)
Matrix & SetModelview()
Set a custom modelview matrix (replaces internal modelview matrix)
Matrix & operator=(const Matrix &matrix)
static Matrix RotateX(float angle)
static Matrix Perspective(double fovy, double aspect, double near, double far)
void set(const ::Matrix &mat)
Matrix Add(const ::Matrix &right)
static Matrix GetModelview()
Get internal modelview matrix.
Matrix(float M0=0, float M1=0, float M2=0, float M3=0, float M4=0, float M5=0, float M6=0, float M7=0, float M8=0, float M9=0, float M10=0, float M11=0, float M12=0, float M13=0, float M14=0, float M15=0)
static Matrix LookAt(Vector3 eye, Vector3 target, Vector3 up)
Matrix Subtract(const ::Matrix &right)
float Trace() const
Returns the trace of the matrix (sum of the values along the diagonal)
static Matrix RotateY(float angle)
bool operator==(const Matrix &other)
static Matrix GetProjection()
Get internal projection matrix.
Matrix Multiply(const ::Matrix &right) const
static Matrix Ortho(double left, double right, double bottom, double top, double near, double far)