docs: add missing non-square matrix funcs

Functions include:
	* glm_mat#x#_copy
	* glm_mat#x#_zero
	* glm_mat#x#_mul
	* glm_mat#x#_mulv
	* glm_mat#x#_transpose
	* glm_mat#x#_scale

Commit also includes some minor changes to
	* mat2
	* mat3
	* mat4

Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This commit is contained in:
Vincent Davis Jr
2023-08-05 20:48:13 -04:00
parent 4d5653b1f6
commit 0fb9e73ec1
9 changed files with 383 additions and 15 deletions

View File

@@ -15,11 +15,32 @@ Macros:
Functions:
1. :c:func:`glm_mat4x2_make`
1. :c:func:`glm_mat4x2_copy`
#. :c:func:`glm_mat4x2_zero`
#. :c:func:`glm_mat4x2_make`
#. :c:func:`glm_mat4x2_mul`
#. :c:func:`glm_mat4x2_mulv`
#. :c:func:`glm_mat4x2_transpose`
#. :c:func:`glm_mat4x2_scale`
Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~
.. c:function:: void glm_mat4x2_copy(mat4x2 mat, mat4x2 dest)
copy mat4x2 to another one (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
.. c:function:: void glm_mat4x2_zero(mat4x2 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat4x2_make(float * __restrict src, mat4x2 dest)
Create mat4x2 matrix from pointer
@@ -28,3 +49,43 @@ Functions documentation
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix4x2
.. c:function:: void glm_mat4x2_mul(mat4x2 m1, mat2x4 m2, mat4 dest)
multiply m1 and m2 to dest
m1, m2 and dest matrices can be same matrix, it is possible to write this:
.. code-block:: c
glm_mat4x2_mul(m, m, m);
Parameters:
| *[in]* **m1** left matrix
| *[in]* **m2** right matrix
| *[out]* **dest** destination matrix
.. c:function:: void glm_mat4x2_mulv(mat4x2 m, vec2 v, vec4 dest)
multiply mat4x2 with vec2 (column vector) and store in dest vector
Parameters:
| *[in]* **m** mat4x2 (left)
| *[in]* **v** vec2 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. c:function:: void glm_mat4x2_transpose(mat4x2 m, mat2x4 dest)
transpose matrix and store in dest
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
.. c:function:: void glm_mat4x2_scale(mat4x2 m, float s)
multiply matrix with scalar
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar