mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
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:
@@ -105,9 +105,13 @@ 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 } };
|
||||
|
||||
define MATRIX2_IDENTITY = matrix::IDENTITY2<double>;
|
||||
define MATRIX2F_IDENTITY = matrix::IDENTITY2<float>;
|
||||
define MATRIX3_IDENTITY = matrix::IDENTITY3<double>;
|
||||
define MATRIX3F_IDENTITY = matrix::IDENTITY3<float>;
|
||||
define MATRIX4_IDENTITY = matrix::IDENTITY4<double>;
|
||||
define MATRIX4F_IDENTITY = matrix::IDENTITY4<float>;
|
||||
|
||||
/**
|
||||
* @require types::is_numerical($typeof(x)) `The input must be a numerical value or numerical vector`
|
||||
|
||||
Reference in New Issue
Block a user