 |
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
123 ::SetMatrixProjection(*
this);
131 ::SetMatrixModelview(*
this);
139 return ::GetMatrixModelview();
146 return ::GetMatrixProjection();
149 #ifndef RAYLIB_CPP_NO_MATH
154 return ::MatrixTrace(*
this);
161 return ::MatrixTranspose(*
this);
165 return ::MatrixInvert(*
this);
169 return ::MatrixNormalize(*
this);
173 return ::MatrixIdentity();
177 return ::MatrixAdd(*
this, right);
181 return ::MatrixAdd(*
this, matrix);
185 return ::MatrixSubtract(*
this, right);
189 return ::MatrixSubtract(*
this, matrix);
193 return ::MatrixTranslate(x, y, z);
197 return ::MatrixRotate(axis, angle);
201 return ::MatrixRotateXYZ(angle);
205 return ::MatrixRotateX(angle);
209 return ::MatrixRotateY(angle);
213 return ::MatrixRotateZ(angle);
217 return ::MatrixScale(x, y, z);
221 return ::MatrixMultiply(*
this, right);
225 return ::MatrixMultiply(*
this, matrix);
229 double near,
double far) {
230 return ::MatrixFrustum(left, right, bottom, top, near, far);
234 return ::MatrixPerspective(fovy, aspect, near, far);
237 static Matrix Ortho(
double left,
double right,
double bottom,
double top,
238 double near,
double far) {
239 return ::MatrixOrtho(left, right, bottom, top, near, far);
243 return ::MatrixLookAt(eye, target, up);
247 return ::MatrixToFloatV(*
this);
258 ::SetShaderValueMatrix(shader, uniformLoc, *
this);
265 inline void set(const ::Matrix& mat) {
287 #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)
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)
static Matrix GetProjection()
Get internal projection matrix.
bool operator==(const ::Matrix &other)
Matrix Multiply(const ::Matrix &right) const
static Matrix Ortho(double left, double right, double bottom, double top, double near, double far)