Improve Matrix identity functions and add Quaternion to matrix function (#765)

* Edit matrix identity fn and add quaternion to matrix fn

* Change matrix identity macros to constants

---------

Co-authored-by: Tonis <tanton@paysure.solutions>
This commit is contained in:
Tonis
2023-05-16 12:50:01 +03:00
committed by GitHub
parent 3a725d1348
commit a877d4458c
4 changed files with 43 additions and 4 deletions

View File

@@ -1,10 +1,12 @@
module math_matrix @test;
import std::math;
fn void test_mat4()
{
{|
Matrix4 mat = math::matrix4_indentity();
Matrix4 mat = MATRIX4_IDENTITY;
Matrix4 mat2 = { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1 };
Matrix4 calc = mat.mul(mat2);
assert(calc.m == mat.m);