1#ifndef RAYLIB_CPP_INCLUDE_MATRIX_HPP_
2#define RAYLIB_CPP_INCLUDE_MATRIX_HPP_
5#include "./raylib-cpp-utils.hpp"
6#include "./raymath.hpp"
8#ifndef RAYLIB_CPP_NO_MATH
23 float m0 = 0,
float m1 = 0,
float m2 = 0,
float m3 = 0,
float m4 = 0,
float m5 = 0,
24 float m6 = 0,
float m7 = 0,
float m8 = 0,
float m9 = 0,
float m10 = 0,
float m11 = 0,
25 float m12 = 0,
float m13 = 0,
float m14 = 0,
26 float m15 = 0) : ::
Matrix{m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, m10, m11, m12, m13, m14, m15} {}
28 GETTERSETTER(
float, M0, m0)
29 GETTERSETTER(
float, M1, m1)
30 GETTERSETTER(
float, M2, m2)
31 GETTERSETTER(
float, M3, m3)
32 GETTERSETTER(
float, M4, m4)
33 GETTERSETTER(
float, M5, m5)
34 GETTERSETTER(
float, M6, m6)
35 GETTERSETTER(
float, M7, m7)
36 GETTERSETTER(
float, M8, m8)
37 GETTERSETTER(
float, M9, m9)
38 GETTERSETTER(
float, M10, m10)
39 GETTERSETTER(
float, M11, m11)
40 GETTERSETTER(
float, M12, m12)
41 GETTERSETTER(
float, M13, m13)
42 GETTERSETTER(
float, M14, m14)
43 GETTERSETTER(
float, M15, m15)
75 return !(*
this == other);
78#ifndef RAYLIB_CPP_NO_MATH
83 return ::MatrixTrace(*
this);
90 return ::MatrixTranspose(*
this);
94 return ::MatrixInvert(*
this);
98 return ::MatrixNormalize(*
this);
102 return ::MatrixIdentity();
106 return ::MatrixAdd(*
this, right);
110 return ::MatrixAdd(*
this, matrix);
114 return ::MatrixSubtract(*
this, right);
118 return ::MatrixSubtract(*
this, matrix);
122 return ::MatrixTranslate(x, y, z);
126 return ::MatrixRotate(axis, angle);
130 return ::MatrixRotateXYZ(angle);
134 return ::MatrixRotateX(angle);
138 return ::MatrixRotateY(angle);
142 return ::MatrixRotateZ(angle);
146 return ::MatrixScale(x, y, z);
150 return ::MatrixMultiply(*
this, right);
154 return ::MatrixMultiply(*
this, matrix);
158 double near,
double far) {
159 return ::MatrixFrustum(left, right, bottom, top, near, far);
163 return ::MatrixPerspective(fovy, aspect, near, far);
166 static Matrix Ortho(
double left,
double right,
double bottom,
double top,
167 double near,
double far) {
168 return ::MatrixOrtho(left, right, bottom, top, near, far);
172 return ::MatrixLookAt(eye, target, up);
176 return ::MatrixToFloatV(*
this);
187 ::SetShaderValueMatrix(shader, uniformLoc, *
this);
194 inline void set(const ::Matrix& mat) {
Matrix type (OpenGL style 4x4 - right handed, column major)
Matrix(const ::Matrix &mat)
Matrix Subtract(const ::Matrix &right)
Matrix & SetShaderValue(::Shader shader, int uniformLoc)
Set shader uniform value (matrix 4x4)
Matrix operator-(const ::Matrix &matrix)
static Matrix RotateXYZ(Vector3 angle)
static Matrix LookAt(Vector3 eye, Vector3 target, Vector3 up)
static Matrix Scale(float x, float y, float z)
Matrix & operator=(const Matrix &matrix)
static Matrix Translate(float x, float y, float z)
float Trace() const
Returns the trace of the matrix (sum of the values along the diagonal)
Matrix Transpose() const
Transposes provided matrix.
static Matrix RotateZ(float angle)
bool operator!=(const ::Matrix &other)
static Matrix RotateY(float angle)
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)
Matrix Add(const ::Matrix &right)
bool operator==(const ::Matrix &other)
Matrix operator+(const ::Matrix &matrix)
static Matrix Rotate(Vector3 axis, float angle)
static Matrix Frustum(double left, double right, double bottom, double top, double near, double far)
static Matrix Ortho(double left, double right, double bottom, double top, double near, double far)
static Matrix Perspective(double fovy, double aspect, double near, double far)
Matrix operator*(const ::Matrix &matrix)
static Matrix RotateX(float angle)
Matrix Multiply(const ::Matrix &right) const
All raylib-cpp classes and functions appear in the raylib namespace.