Skip to content

Commit cdd4d0e

Browse files
authored
Merge pull request #340 from recp/non-square-matrix
add some missing non-square matrix funcs
2 parents 129287b + 54dfc4b commit cdd4d0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2929
-25
lines changed

docs/source/mat2.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,12 @@ Functions documentation
6565
make given matrix zero
6666
6767
Parameters:
68-
| *[in,out]* **mat** matrix to
68+
| *[in,out]* **mat** matrix
6969
7070
.. c:function:: void glm_mat2_mul(mat2 m1, mat2 m2, mat2 dest)
7171
7272
multiply m1 and m2 to dest
73+
7374
m1, m2 and dest matrices can be same matrix, it is possible to write this:
7475
7576
.. code-block:: c
@@ -101,7 +102,7 @@ Functions documentation
101102
102103
.. c:function:: void glm_mat2_mulv(mat2 m, vec2 v, vec2 dest)
103104
104-
multiply mat4 with vec4 (column vector) and store in dest vector
105+
multiply mat2 with vec2 (column vector) and store in dest vector
105106
106107
Parameters:
107108
| *[in]* **mat** mat2 (left)
@@ -113,8 +114,8 @@ Functions documentation
113114
multiply matrix with scalar
114115
115116
Parameters:
116-
| *[in, out]* **mat** matrix
117-
| *[in]* **dest** scalar
117+
| *[in, out]* **m** matrix
118+
| *[in]* **s** scalar
118119
119120
.. c:function:: float glm_mat2_det(mat2 mat)
120121

docs/source/mat2x3.rst

+62-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,32 @@ Macros:
1515

1616
Functions:
1717

18-
1. :c:func:`glm_mat2x3_make`
18+
1. :c:func:`glm_mat2x3_copy`
19+
#. :c:func:`glm_mat2x3_zero`
20+
#. :c:func:`glm_mat2x3_make`
21+
#. :c:func:`glm_mat2x3_mul`
22+
#. :c:func:`glm_mat2x3_mulv`
23+
#. :c:func:`glm_mat2x3_transpose`
24+
#. :c:func:`glm_mat2x3_scale`
1925

2026
Functions documentation
2127
~~~~~~~~~~~~~~~~~~~~~~~
2228

29+
.. c:function:: void glm_mat2x3_copy(mat2x3 mat, mat2x3 dest)
30+
31+
copy mat2x3 to another one (dest).
32+
33+
Parameters:
34+
| *[in]* **mat** source
35+
| *[out]* **dest** destination
36+
37+
.. c:function:: void glm_mat2x3_zero(mat2x3 mat)
38+
39+
make given matrix zero
40+
41+
Parameters:
42+
| *[in,out]* **mat** matrix
43+
2344
.. c:function:: void glm_mat2x3_make(float * __restrict src, mat2x3 dest)
2445
2546
Create mat2x3 matrix from pointer
@@ -29,3 +50,43 @@ Functions documentation
2950
Parameters:
3051
| *[in]* **src** pointer to an array of floats
3152
| *[out]* **dest** destination matrix2x3
53+
54+
.. c:function:: void glm_mat2x3_mul(mat2x3 m1, mat3x2 m2, mat2 dest)
55+
56+
multiply m1 and m2 to dest
57+
58+
m1, m2 and dest matrices can be same matrix, it is possible to write this:
59+
60+
.. code-block:: c
61+
62+
glm_mat2x3_mul(m, m, m);
63+
64+
Parameters:
65+
| *[in]* **m1** left matrix
66+
| *[in]* **m2** right matrix
67+
| *[out]* **dest** destination matrix
68+
69+
.. c:function:: void glm_mat2x3_mulv(mat2x3 m, vec3 v, vec2 dest)
70+
71+
multiply mat2x3 with vec3 (column vector) and store in dest vector
72+
73+
Parameters:
74+
| *[in]* **m** mat2x3 (left)
75+
| *[in]* **v** vec3 (right, column vector)
76+
| *[out]* **dest** destination (result, column vector)
77+
78+
.. c:function:: void glm_mat2x3_transpose(mat2x3 m, mat3x2 dest)
79+
80+
transpose matrix and store in dest
81+
82+
Parameters:
83+
| *[in]* **m** matrix
84+
| *[out]* **dest** destination
85+
86+
.. c:function:: void glm_mat2x3_scale(mat2x3 m, float s)
87+
88+
multiply matrix with scalar
89+
90+
Parameters:
91+
| *[in, out]* **m** matrix
92+
| *[in]* **s** scalar

docs/source/mat2x4.rst

+62-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,32 @@ Macros:
1515

1616
Functions:
1717

18-
1. :c:func:`glm_mat2x4_make`
18+
1. :c:func:`glm_mat2x4_copy`
19+
#. :c:func:`glm_mat2x4_zero`
20+
#. :c:func:`glm_mat2x4_make`
21+
#. :c:func:`glm_mat2x4_mul`
22+
#. :c:func:`glm_mat2x4_mulv`
23+
#. :c:func:`glm_mat2x4_transpose`
24+
#. :c:func:`glm_mat2x4_scale`
1925

2026
Functions documentation
2127
~~~~~~~~~~~~~~~~~~~~~~~
2228

29+
.. c:function:: void glm_mat2x4_copy(mat2x4 mat, mat2x4 dest)
30+
31+
copy mat2x4 to another one (dest).
32+
33+
Parameters:
34+
| *[in]* **mat** source
35+
| *[out]* **dest** destination
36+
37+
.. c:function:: void glm_mat2x4_zero(mat2x4 mat)
38+
39+
make given matrix zero
40+
41+
Parameters:
42+
| *[in,out]* **mat** matrix
43+
2344
.. c:function:: void glm_mat2x4_make(float * __restrict src, mat2x4 dest)
2445
2546
Create mat2x4 matrix from pointer
@@ -29,3 +50,43 @@ Functions documentation
2950
Parameters:
3051
| *[in]* **src** pointer to an array of floats
3152
| *[out]* **dest** destination matrix2x4
53+
54+
.. c:function:: void glm_mat2x4_mul(mat2x4 m1, mat4x2 m2, mat2 dest)
55+
56+
multiply m1 and m2 to dest
57+
58+
m1, m2 and dest matrices can be same matrix, it is possible to write this:
59+
60+
.. code-block:: c
61+
62+
glm_mat2x4_mul(m, m, m);
63+
64+
Parameters:
65+
| *[in]* **m1** left matrix
66+
| *[in]* **m2** right matrix
67+
| *[out]* **dest** destination matrix
68+
69+
.. c:function:: void glm_mat2x4_mulv(mat2x4 m, vec4 v, vec2 dest)
70+
71+
multiply mat2x4 with vec4 (column vector) and store in dest vector
72+
73+
Parameters:
74+
| *[in]* **m** mat2x4 (left)
75+
| *[in]* **v** vec4 (right, column vector)
76+
| *[out]* **dest** destination (result, column vector)
77+
78+
.. c:function:: void glm_mat2x4_transpose(mat2x4 m, mat4x2 dest)
79+
80+
transpose matrix and store in dest
81+
82+
Parameters:
83+
| *[in]* **m** matrix
84+
| *[out]* **dest** destination
85+
86+
.. c:function:: void glm_mat2x4_scale(mat2x4 m, float s)
87+
88+
multiply matrix with scalar
89+
90+
Parameters:
91+
| *[in, out]* **m** matrix
92+
| *[in]* **s** scalar

docs/source/mat3.rst

+5-4
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ Functions documentation
7272
.. c:function:: void glm_mat3_mul(mat3 m1, mat3 m2, mat3 dest)
7373
7474
multiply m1 and m2 to dest
75+
7576
m1, m2 and dest matrices can be same matrix, it is possible to write this:
7677
7778
.. code-block:: c
@@ -103,10 +104,10 @@ Functions documentation
103104
104105
.. c:function:: void glm_mat3_mulv(mat3 m, vec3 v, vec3 dest)
105106
106-
multiply mat4 with vec4 (column vector) and store in dest vector
107+
multiply mat3 with vec3 (column vector) and store in dest vector
107108
108109
Parameters:
109-
| *[in]* **mat** mat3 (left)
110+
| *[in]* **m** mat3 (left)
110111
| *[in]* **v** vec3 (right, column vector)
111112
| *[out]* **dest** destination (result, column vector)
112113
@@ -123,8 +124,8 @@ Functions documentation
123124
multiply matrix with scalar
124125
125126
Parameters:
126-
| *[in, out]* **mat** matrix
127-
| *[in]* **dest** scalar
127+
| *[in, out]* **m** matrix
128+
| *[in]* **s** scalar
128129
129130
.. c:function:: float glm_mat3_det(mat3 mat)
130131

docs/source/mat3x2.rst

+62-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,32 @@ Macros:
1515

1616
Functions:
1717

18-
1. :c:func:`glm_mat3x2_make`
18+
1. :c:func:`glm_mat3x2_copy`
19+
#. :c:func:`glm_mat3x2_zero`
20+
#. :c:func:`glm_mat3x2_make`
21+
#. :c:func:`glm_mat3x2_mul`
22+
#. :c:func:`glm_mat3x2_mulv`
23+
#. :c:func:`glm_mat3x2_transpose`
24+
#. :c:func:`glm_mat3x2_scale`
1925

2026
Functions documentation
2127
~~~~~~~~~~~~~~~~~~~~~~~
2228

29+
.. c:function:: void glm_mat3x2_copy(mat3x2 mat, mat3x2 dest)
30+
31+
copy mat3x2 to another one (dest).
32+
33+
Parameters:
34+
| *[in]* **mat** source
35+
| *[out]* **dest** destination
36+
37+
.. c:function:: void glm_mat3x2_zero(mat3x2 mat)
38+
39+
make given matrix zero
40+
41+
Parameters:
42+
| *[in,out]* **mat** matrix
43+
2344
.. c:function:: void glm_mat3x2_make(float * __restrict src, mat3x2 dest)
2445
2546
Create mat3x2 matrix from pointer
@@ -28,3 +49,43 @@ Functions documentation
2849
Parameters:
2950
| *[in]* **src** pointer to an array of floats
3051
| *[out]* **dest** destination matrix3x2
52+
53+
.. c:function:: void glm_mat3x2_mul(mat3x2 m1, mat2x3 m2, mat3 dest)
54+
55+
multiply m1 and m2 to dest
56+
57+
m1, m2 and dest matrices can be same matrix, it is possible to write this:
58+
59+
.. code-block:: c
60+
61+
glm_mat3x2_mul(m, m, m);
62+
63+
Parameters:
64+
| *[in]* **m1** left matrix
65+
| *[in]* **m2** right matrix
66+
| *[out]* **dest** destination matrix
67+
68+
.. c:function:: void glm_mat3x2_mulv(mat3x2 m, vec2 v, vec3 dest)
69+
70+
multiply mat3x2 with vec2 (column vector) and store in dest vector
71+
72+
Parameters:
73+
| *[in]* **m** mat3x2 (left)
74+
| *[in]* **v** vec3 (right, column vector)
75+
| *[out]* **dest** destination (result, column vector)
76+
77+
.. c:function:: void glm_mat3x2_transpose(mat3x2 m, mat2x3 dest)
78+
79+
transpose matrix and store in dest
80+
81+
Parameters:
82+
| *[in]* **m** matrix
83+
| *[out]* **dest** destination
84+
85+
.. c:function:: void glm_mat3x2_scale(mat3x2 m, float s)
86+
87+
multiply matrix with scalar
88+
89+
Parameters:
90+
| *[in, out]* **m** matrix
91+
| *[in]* **s** scalar

docs/source/mat3x4.rst

+62-1
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,32 @@ Macros:
1515

1616
Functions:
1717

18-
1. :c:func:`glm_mat3x4_make`
18+
1. :c:func:`glm_mat3x4_copy`
19+
#. :c:func:`glm_mat3x4_zero`
20+
#. :c:func:`glm_mat3x4_make`
21+
#. :c:func:`glm_mat3x4_mul`
22+
#. :c:func:`glm_mat3x4_mulv`
23+
#. :c:func:`glm_mat3x4_transpose`
24+
#. :c:func:`glm_mat3x4_scale`
1925

2026
Functions documentation
2127
~~~~~~~~~~~~~~~~~~~~~~~
2228

29+
.. c:function:: void glm_mat3x4_copy(mat3x4 mat, mat3x4 dest)
30+
31+
copy mat3x4 to another one (dest).
32+
33+
Parameters:
34+
| *[in]* **mat** source
35+
| *[out]* **dest** destination
36+
37+
.. c:function:: void glm_mat3x4_zero(mat3x4 mat)
38+
39+
make given matrix zero
40+
41+
Parameters:
42+
| *[in,out]* **mat** matrix
43+
2344
.. c:function:: void glm_mat3x4_make(float * __restrict src, mat3x4 dest)
2445
2546
Create mat3x4 matrix from pointer
@@ -28,3 +49,43 @@ Functions documentation
2849
Parameters:
2950
| *[in]* **src** pointer to an array of floats
3051
| *[out]* **dest** destination matrix3x4
52+
53+
.. c:function:: void glm_mat3x4_mul(mat3x4 m1, mat4x3 m2, mat3 dest)
54+
55+
multiply m1 and m2 to dest
56+
57+
m1, m2 and dest matrices can be same matrix, it is possible to write this:
58+
59+
.. code-block:: c
60+
61+
glm_mat3x4_mul(m, m, m);
62+
63+
Parameters:
64+
| *[in]* **m1** left matrix
65+
| *[in]* **m2** right matrix
66+
| *[out]* **dest** destination matrix
67+
68+
.. c:function:: void glm_mat3x4_mulv(mat3x4 m, vec4 v, vec3 dest)
69+
70+
multiply mat3x4 with vec4 (column vector) and store in dest vector
71+
72+
Parameters:
73+
| *[in]* **m** mat3x4 (left)
74+
| *[in]* **v** vec4 (right, column vector)
75+
| *[out]* **dest** destination (result, column vector)
76+
77+
.. c:function:: void glm_mat3x4_transpose(mat3x4 m, mat4x3 dest)
78+
79+
transpose matrix and store in dest
80+
81+
Parameters:
82+
| *[in]* **m** matrix
83+
| *[out]* **dest** destination
84+
85+
.. c:function:: void glm_mat3x4_scale(mat3x4 m, float s)
86+
87+
multiply matrix with scalar
88+
89+
Parameters:
90+
| *[in, out]* **m** matrix
91+
| *[in]* **s** scalar

docs/source/mat4.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ Functions documentation
119119
.. c:function:: void glm_mat4_mul(mat4 m1, mat4 m2, mat4 dest)
120120
121121
multiply m1 and m2 to dest
122+
122123
m1, m2 and dest matrices can be same matrix, it is possible to write this:
123124
124125
.. code-block:: c
@@ -157,7 +158,6 @@ Functions documentation
157158
Parameters:
158159
| *[in]* **m** mat4 (left)
159160
| *[in]* **v** vec4 (right, column vector)
160-
| *[in]* **last** 4th item to make it vec4
161161
| *[out]* **dest** vec4 (result, column vector)
162162
163163
.. c:function:: void glm_mat4_mulv3(mat4 m, vec3 v, float last, vec3 dest)

0 commit comments

Comments
 (0)