Merge pull request #465 from under-view/feature/mat4x3-tables

mat4x3: add tables to docs & fix comments
This commit is contained in:
Recep Aslantas
2025-04-04 22:57:01 +03:00
committed by GitHub
5 changed files with 206 additions and 159 deletions

View File

@@ -27,7 +27,7 @@ Represented
~~~~~~~~~~~
.. csv-table:: mat4x3
:header: "", "column 1", "column 2", "column 3", "column4"
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "m00", "m10", "m20", "m30"
"row 2", "m01", "m11", "m21", "m31"
@@ -36,52 +36,103 @@ Represented
Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~
.. c:function:: void glm_mat4x3_copy(mat4x3 mat, mat4x3 dest)
.. c:function:: void glm_mat4x3_copy(mat4x3 src, mat4x3 dest)
copy mat4x3 to another one (dest).
Copy mat4x3 (src) to mat4x3 (dest).
Parameters:
| *[in]* **mat** source
| *[out]* **dest** destination
| *[in]* **src** mat4x3 (left)
| *[out]* **dest** destination (result, mat4x3)
.. c:function:: void glm_mat4x3_zero(mat4x3 mat)
make given matrix zero
Parameters:
| *[in,out]* **mat** matrix
.. c:function:: void glm_mat4x3_make(const float * __restrict src, mat4x3 dest)
Create mat4x3 matrix from pointer
.. note:: **@src** must contain at least 12 elements.
Parameters:
| *[in]* **src** pointer to an array of floats
| *[out]* **dest** destination matrix4x3
.. c:function:: void glm_mat4x3_mul(mat4x3 m1, mat3x4 m2, mat3 dest)
multiply m1 and m2 to dest
.. code-block:: c
glm_mat4x3_mul(mat4x3, mat3x4, mat3);
Parameters:
| *[in]* **m1** left matrix (mat4x3)
| *[in]* **m2** right matrix (mat3x4)
| *[out]* **dest** destination matrix (mat3)
.. csv-table:: mat4x3
.. csv-table:: mat4x3 **(src)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "a00", "a10", "a20", "a30"
"row 2", "a01", "a11", "a21", "a31"
"row 3", "a02", "a12", "a22", "a32"
.. csv-table:: mat3x4
.. csv-table:: mat4x3 **(dest)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "b00 = a00", "b10 = a10", "b20 = a20", "b30 = a30"
"row 2", "b01 = a01", "b11 = a11", "b21 = a21", "b31 = a31"
"row 3", "b02 = a02", "b12 = a12", "b22 = a22", "b32 = a32"
.. c:function:: void glm_mat4x3_zero(mat4x3 m)
Zero out the mat4x3 (m).
Parameters:
| *[in, out]* **m** mat4x3 (src, dest)
.. csv-table:: mat4x3 **(m)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "0.00", "2.00", "15.00", "44.00"
"row 2", "5.00", "4.00", "6.00", "12.00"
"row 3", "88.00", "8.00", "4.30", "15.00"
.. csv-table:: mat4x3 **(m)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "0.00", "0.00", "0.00", "0.00"
"row 2", "0.00", "0.00", "0.00", "0.00"
"row3", "0.00", "0.00", "0.00", "0.00"
.. c:function:: void glm_mat4x3_make(const float * __restrict src, mat4x3 dest)
Create mat4x3 (dest) from pointer (src).
.. note:: **@src** must contain at least 12 elements.
Parameters:
| *[in]* **src** pointer to an array of floats (left)
| *[out]* **dest** destination (result, mat4x3)
.. csv-table:: float array (1x12) **(src)**
:header: "", "column 1"
"row 1", "v0"
"row 2", "v1"
"row 3", "v2"
"row 4", "v3"
"row 5", "v4"
"row 6", "v5"
"row 7", "v6"
"row 8", "v7"
"row 9", "v8"
"row 10", "v9"
"row 11", "v10"
"row 12", "v11"
.. csv-table:: mat4x3 **(dest)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "v0", "v3", "v6", "v9"
"row 2", "v1", "v4", "v7", "v10"
"row 3", "v2", "v5", "v8", "v11"
.. c:function:: void glm_mat4x3_mul(mat4x3 m1, mat3x4 m2, mat3 dest)
Multiply mat4x3 (m1) by mat3x4 (m2) and store in mat3 (dest).
.. code-block:: c
glm_mat4x3_mul(mat4x3, mat3x4, mat3);
Parameters:
| *[in]* **m1** mat4x3 (left)
| *[in]* **m2** mat3x4 (right)
| *[out]* **dest** destination (result, mat3)
.. csv-table:: mat4x3 **(m1)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "a00", "a10", "a20", "a30"
"row 2", "a01", "a11", "a21", "a31"
"row 3", "a02", "a12", "a22", "a32"
.. csv-table:: mat3x4 **(m2)**
:header: "", "column 1", "column 2", "column 3"
"row 1", "b00", "b10", "b20"
@@ -89,7 +140,7 @@ Functions documentation
"row 3", "b02", "b12", "b22"
"row 4", "b03", "b13", "b23"
.. csv-table:: mat3x3
.. csv-table:: mat3x3 **(dest)**
:header: "", "column 1", "column 2", "column 3"
"row 1", "a00 * b00 + a10 * b01 + a20 * b02 + a30 * b03", "a00 * b10 + a10 * b11 + a20 * b12 + a30 * b13", "a00 * b20 + a10 * b21 + a20 * b22 + a30 * b23"
@@ -98,21 +149,21 @@ Functions documentation
.. c:function:: void glm_mat4x3_mulv(mat4x3 m, vec4 v, vec3 dest)
multiply mat4x3 with vec4 (column vector) and store in dest column vector
Multiply mat4x3 (m) by vec4 (v) and store in vec3 (dest).
Parameters:
| *[in]* **m** mat4x3 (left)
| *[in]* **v** vec4 (right, column vector)
| *[out]* **dest** destination (result, column vector)
| *[in]* **m** mat4x3 (left)
| *[in]* **v** vec4 (right, column vector)
| *[out]* **dest** destination (result, column vector)
.. csv-table:: mat4x3
.. csv-table:: mat4x3 **(m)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "m00", "m10", "m20", "m30"
"row 2", "m01", "m11", "m21", "m31"
"row 3", "m02", "m12", "m22", "m32"
.. csv-table:: column vec4 (1x4)
.. csv-table:: column vec4 (1x4) **(v)**
:header: "", "column 1"
"row 1", "v0"
@@ -120,25 +171,47 @@ Functions documentation
"row 3", "v2"
"row 4", "v3"
.. csv-table:: column vec3 (1x3)
.. csv-table:: column vec3 (1x3) **(dest)**
:header: "", "column 1"
"row 1", "m00 * v0 + m10 * v1 + m20 * v2 + m30 * v3"
"row 2", "m01 * v0 + m11 * v1 + m21 * v2 + m31 * v3"
"row 3", "m02 * v0 + m12 * v1 + m22 * v2 + m32 * v3"
.. c:function:: void glm_mat4x3_transpose(mat4x3 m, mat3x4 dest)
.. c:function:: void glm_mat4x3_transpose(mat4x3 src, mat3x4 dest)
transpose matrix and store in dest
Transpose mat4x3 (src) and store in mat3x4 (dest).
Parameters:
| *[in]* **m** matrix
| *[out]* **dest** destination
| *[in]* **src** mat4x3 (left)
| *[out]* **dest** destination (result, mat3x4)
.. c:function:: void glm_mat4x3_scale(mat4x3 m, float s)
.. csv-table:: mat4x3 **(src)**
:header: "", "column 1", "column 2", "column 3", "column 4"
multiply matrix with scalar
"row 1", "a00", "a10", "a20", "a30"
"row 2", "a01", "a11", "a21", "a31"
"row 3", "a02", "a12", "a22", "a32"
.. csv-table:: mat3x4 **(dest)**
:header: "", "column 1", "column 2", "column 3"
"row 1", "b00 = a00", "b10 = a01", "b20 = a02"
"row 2", "b01 = a10", "b11 = a11", "b21 = a12"
"row 3", "b02 = a20", "b12 = a21", "b22 = a22"
"row 4", "b03 = a30", "b13 = a31", "b23 = a32"
.. c:function:: void glm_mat4x3_scale(mat4x3 m, float s)
Multiply mat4x3 (m) by scalar constant (s).
Parameters:
| *[in, out]* **m** matrix
| *[in]* **s** scalar
| *[in, out]* **m** mat4x3 (src, dest)
| *[in]* **s** float (scalar)
.. csv-table:: mat4x3 **(m)**
:header: "", "column 1", "column 2", "column 3", "column 4"
"row 1", "m00 = m00 * s", "m10 = m10 * s", "m20 = m20 * s", "m30 = m30 * s"
"row 2", "m01 = m01 * s", "m11 = m11 * s", "m21 = m21 * s", "m31 = m31 * s"
"row 3", "m02 = m02 * s", "m12 = m12 * s", "m22 = m22 * s", "m32 = m32 * s"