Added Matrix identity macros and few matrix unit tests (#742)

* Add matrix identity macros

* Add matrix some matrix unit tests

---------

Co-authored-by: Tonis <tanton@paysure.solutions>
This commit is contained in:
Tonis
2023-03-05 21:39:55 +02:00
committed by GitHub
parent 549e1b6029
commit ff4c35fae1
3 changed files with 53 additions and 0 deletions

View File

@@ -105,6 +105,9 @@ define matrix4_ortho = matrix::ortho<double>;
define matrix4_perspective = matrix::perspective<double>;
define matrix4f_ortho = matrix::ortho<float>;
define matrix4f_perspective = matrix::perspective<float>;
macro Matrix4 matrix4_indentity() => { .m = { [0] = 1, [5] = 1, [10] = 1, [15] = 1 } };
macro Matrix3 matrix3_indentity() => { .m = { [0] = 1, [4] = 1, [8] = 1 } };
macro Matrix2 matrix2_indentity() => { .m = { [0] = 1, [3] = 1 } };
/**
* @require types::is_numerical($typeof(x)) `The input must be a numerical value or numerical vector`