1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
.. default-domain:: C
ivec2
=====
Header: cglm/ivec2.h
Table of contents (click to go):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Functions:
1. :c:func:`glm_ivec2`
#. :c:func:`glm_ivec2_copy`
#. :c:func:`glm_ivec2_zero`
#. :c:func:`glm_ivec2_one`
#. :c:func:`glm_ivec2_add`
#. :c:func:`glm_ivec2_adds`
#. :c:func:`glm_ivec2_sub`
#. :c:func:`glm_ivec2_subs`
#. :c:func:`glm_ivec2_mul`
#. :c:func:`glm_ivec2_scale`
#. :c:func:`glm_ivec2_distance2`
#. :c:func:`glm_ivec2_distance`
#. :c:func:`glm_ivec2_maxv`
#. :c:func:`glm_ivec2_minv`
#. :c:func:`glm_ivec2_clamp`
Functions documentation
~~~~~~~~~~~~~~~~~~~~~~~
.. c:function:: void glm_ivec2(int * v, ivec2 dest)
init ivec2 using vec3 or vec4
Parameters:
| *[in]* **v** vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_copy(ivec2 a, ivec2 dest)
copy all members of [a] to [dest]
Parameters:
| *[in]* **a** source vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_zero(ivec2 v)
set all members of [v] to zero
Parameters:
| *[out]* **v** vector
.. c:function:: void glm_ivec2_one(ivec2 v)
set all members of [v] to one
Parameters:
| *[out]* **v** vector
.. c:function:: void glm_ivec2_add(ivec2 a, ivec2 b, ivec2 dest)
add vector [a] to vector [b] and store result in [dest]
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_adds(ivec2 v, int s, ivec2 dest)
add scalar s to vector [v] and store result in [dest]
Parameters:
| *[in]* **v** vector
| *[in]* **s** scalar
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_sub(ivec2 a, ivec2 b, ivec2 dest)
subtract vector [b] from vector [a] and store result in [dest]
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_subs(ivec2 v, int s, ivec2 dest)
subtract scalar s from vector [v] and store result in [dest]
Parameters:
| *[in]* **v** vector
| *[in]* **s** scalar
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_mul(ivec2 a, ivec2 b, ivec2 dest)
multiply vector [a] with vector [b] and store result in [dest]
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_scale(ivec2 v, int s, ivec2 dest)
multiply vector [a] with scalar s and store result in [dest]
Parameters:
| *[in]* **v** vector
| *[in]* **s** scalar
| *[out]* **dest** destination
.. c:function:: int glm_ivec2_distance2(ivec2 a, ivec2 b)
squared distance between two vectors
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
Returns:
squared distance (distance * distance)
.. c:function:: float glm_ivec2_distance(ivec2 a, ivec2 b)
distance between two vectors
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
Returns:
distance
.. c:function:: void glm_ivec2_maxv(ivec2 a, ivec2 b, ivec2 dest)
set each member of dest to greater of vector a and b
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_minv(ivec2 a, ivec2 b, ivec2 dest)
set each member of dest to lesser of vector a and b
Parameters:
| *[in]* **a** first vector
| *[in]* **b** second vector
| *[out]* **dest** destination
.. c:function:: void glm_ivec2_clamp(ivec2 v, int minVal, int maxVal)
clamp each member of [v] between minVal and maxVal (inclusive)
Parameters:
| *[in, out]* **v** vector
| *[in]* **minVal** minimum value
| *[in]* **maxVal** maximum value
|