1 #ifndef RAYLIB_CPP_INCLUDE_MATRIX_HPP_
2 #define RAYLIB_CPP_INCLUDE_MATRIX_HPP_
4 #include "./raylib.hpp"
5 #include "./raylib-cpp-utils.hpp"
6 #include "./raymath.hpp"
8 #ifndef RAYLIB_CPP_NO_MATH
18 Matrix(const ::Matrix& mat) {
22 Matrix(
float M0 = 0,
float M1 = 0,
float M2 = 0,
float M3 = 0,
float M4 = 0,
float M5 = 0,
23 float M6 = 0,
float M7 = 0,
float M8 = 0,
float M9 = 0,
float M10 = 0,
float M11 = 0,
24 float M12 = 0,
float M13 = 0,
float M14 = 0,
float M15 = 0) {
43 GETTERSETTER(
float, M0, m0)
44 GETTERSETTER(
float, M1, m1)
45 GETTERSETTER(
float, M2, m2)
46 GETTERSETTER(
float, M3, m3)
47 GETTERSETTER(
float, M4, m4)
48 GETTERSETTER(
float, M5, m5)
49 GETTERSETTER(
float, M6, m6)
50 GETTERSETTER(
float, M7, m7)
51 GETTERSETTER(
float, M8, m8)
52 GETTERSETTER(
float, M9, m9)
53 GETTERSETTER(
float, M10, m10)
54 GETTERSETTER(
float, M11, m11)
55 GETTERSETTER(
float, M12, m12)
56 GETTERSETTER(
float, M13, m13)
57 GETTERSETTER(
float, M14, m14)
58 GETTERSETTER(
float, M15, m15)
70 bool operator==(const ::Matrix& other) {
89 #ifndef RAYLIB_CPP_NO_MATH
94 return ::MatrixTrace(*
this);
101 return ::MatrixTranspose(*
this);
104 inline Matrix Invert()
const {
105 return ::MatrixInvert(*
this);
108 inline Matrix Normalize()
const {
109 return ::MatrixNormalize(*
this);
112 static Matrix Identity() {
113 return ::MatrixIdentity();
116 Matrix Add(const ::Matrix& right) {
117 return ::MatrixAdd(*
this, right);
120 Matrix operator+(const ::Matrix& matrix) {
121 return ::MatrixAdd(*
this, matrix);
124 Matrix Subtract(const ::Matrix& right) {
125 return ::MatrixSubtract(*
this, right);
128 Matrix operator-(const ::Matrix& matrix) {
129 return ::MatrixSubtract(*
this, matrix);
132 static Matrix Translate(
float x,
float y,
float z) {
133 return ::MatrixTranslate(x, y, z);
136 static Matrix Rotate(Vector3 axis,
float angle) {
137 return ::MatrixRotate(axis, angle);
140 static Matrix RotateXYZ(Vector3 angle) {
141 return ::MatrixRotateXYZ(angle);
144 static Matrix RotateX(
float angle) {
145 return ::MatrixRotateX(angle);
148 static Matrix RotateY(
float angle) {
149 return ::MatrixRotateY(angle);
152 static Matrix RotateZ(
float angle) {
153 return ::MatrixRotateZ(angle);
156 static Matrix Scale(
float x,
float y,
float z) {
157 return ::MatrixScale(x, y, z);
160 Matrix Multiply(const ::Matrix& right)
const {
161 return ::MatrixMultiply(*
this, right);
164 Matrix operator*(const ::Matrix& matrix) {
165 return ::MatrixMultiply(*
this, matrix);
168 static Matrix Frustum(
double left,
double right,
double bottom,
double top,
169 double near,
double far) {
170 return ::MatrixFrustum(left, right, bottom, top, near, far);
173 static Matrix Perspective(
double fovy,
double aspect,
double near,
double far) {
174 return ::MatrixPerspective(fovy, aspect, near, far);
177 static Matrix Ortho(
double left,
double right,
double bottom,
double top,
178 double near,
double far) {
179 return ::MatrixOrtho(left, right, bottom, top, near, far);
182 static Matrix LookAt(Vector3 eye, Vector3 target, Vector3 up) {
183 return ::MatrixLookAt(eye, target, up);
186 inline float16 ToFloatV()
const {
187 return ::MatrixToFloatV(*
this);
198 ::SetShaderValueMatrix(shader, uniformLoc, *
this);
205 inline void set(const ::Matrix& mat) {
227 #endif // RAYLIB_CPP_INCLUDE_MATRIX_HPP_