0.9.6: type_mat2x2.hpp Source File

| 0.9.6

- Main Page
- Modules
- Files

- File List

type_mat2x2.hpp
Go to the documentation of this file.
1
33 #pragma once
34
35 #include "../fwd.hpp"
36 #include "type_vec2.hpp"
37 #include "type_mat.hpp"
38 #include <limits>
39 #include <cstddef>
40
41 namespace glm
42 {
43 template <typename T, precision P = defaultp>
44 struct tmat2x2
45 {
46 typedef tvec2<T, P> col_type;
47 typedef tvec2<T, P> row_type;
48 typedef tmat2x2<T, P> type;
49 typedef tmat2x2<T, P> transpose_type;
50 typedef T value_type;
51
52 template <typename U, precision Q>
53 friend tvec2<U, Q> operator/(tmat2x2<U, Q> const & m, tvec2<U, Q> const & v);
54 template <typename U, precision Q>
55 friend tvec2<U, Q> operator/(tvec2<U, Q> const & v, tmat2x2<U, Q> const & m);
56
57 private:
59 col_type value[2];
61
62 public:
64 // Constructors
65 GLM_FUNC_DECL tmat2x2();
66 template <precision Q>
67 GLM_FUNC_DECL tmat2x2(tmat2x2<T, Q> const & m);
68
69 GLM_FUNC_DECL explicit tmat2x2(ctor);
70 GLM_FUNC_DECL explicit tmat2x2(T const & x);
71 GLM_FUNC_DECL tmat2x2(
72 T const & x1, T const & y1,
73 T const & x2, T const & y2);
74 GLM_FUNC_DECL tmat2x2(
75 col_type const & v1,
76 col_type const & v2);
77
79 // Conversions
80 template <typename U, typename V, typename M, typename N>
81 GLM_FUNC_DECL tmat2x2(
82 U const & x1, V const & y1,
83 M const & x2, N const & y2);
84
85 template <typename U, typename V>
86 GLM_FUNC_DECL tmat2x2(
87 tvec2<U, P> const & v1,
88 tvec2<V, P> const & v2);
89
91 // Matrix conversions
92
93 # ifdef GLM_FORCE_EXPLICIT_CTOR
94 template <typename U, precision Q>
95 GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U, Q> const & m);
96 # else
97 template <typename U, precision Q>
98 GLM_FUNC_DECL tmat2x2(tmat2x2<U, Q> const & m);
99 # endif
100
101 GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T, P> const & x);
102 GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T, P> const & x);
103 GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T, P> const & x);
104 GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T, P> const & x);
105 GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T, P> const & x);
106 GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T, P> const & x);
107 GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T, P> const & x);
108 GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T, P> const & x);
109
111 // Accesses
112
113 # ifdef GLM_FORCE_SIZE_FUNC
114 typedef size_t size_type;
115 GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
116
117 GLM_FUNC_DECL col_type & operator[](size_type i);
118 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
119 # else
120 typedef length_t length_type;
121 GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
122
123 GLM_FUNC_DECL col_type & operator[](length_type i);
124 GLM_FUNC_DECL col_type const & operator[](length_type i) const;
125 # endif//GLM_FORCE_SIZE_FUNC
126
128 // Unary arithmetic operators
129
130 template <typename U>
131 GLM_FUNC_DECL tmat2x2<T, P> & operator=(tmat2x2<U, P> const & m);
132 template <typename U>
133 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(U s);
134 template <typename U>
135 GLM_FUNC_DECL tmat2x2<T, P> & operator+=(tmat2x2<U, P> const & m);
136 template <typename U>
137 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(U s);
138 template <typename U>
139 GLM_FUNC_DECL tmat2x2<T, P> & operator-=(tmat2x2<U, P> const & m);
140 template <typename U>
141 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(U s);
142 template <typename U>
143 GLM_FUNC_DECL tmat2x2<T, P> & operator*=(tmat2x2<U, P> const & m);
144 template <typename U>
145 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(U s);
146 template <typename U>
147 GLM_FUNC_DECL tmat2x2<T, P> & operator/=(tmat2x2<U, P> const & m);
148
150 // Increment and decrement operators
151
152 GLM_FUNC_DECL tmat2x2<T, P> & operator++ ();
153 GLM_FUNC_DECL tmat2x2<T, P> & operator-- ();
154 GLM_FUNC_DECL tmat2x2<T, P> operator++(int);
155 GLM_FUNC_DECL tmat2x2<T, P> operator--(int);
156 };
157
158 // Binary operators
159 template <typename T, precision P>
160 GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m, T const & s);
161
162 template <typename T, precision P>
163 GLM_FUNC_DECL tmat2x2<T, P> operator+(T const & s, tmat2x2<T, P> const & m);
164
165 template <typename T, precision P>
166 GLM_FUNC_DECL tmat2x2<T, P> operator+(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
167
168 template <typename T, precision P>
169 GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m, T const & s);
170
171 template <typename T, precision P>
172 GLM_FUNC_DECL tmat2x2<T, P> operator-(T const & s, tmat2x2<T, P> const & m);
173
174 template <typename T, precision P>
175 GLM_FUNC_DECL tmat2x2<T, P> operator-(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
176
177 template <typename T, precision P>
178 GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m, T const & s);
179
180 template <typename T, precision P>
181 GLM_FUNC_DECL tmat2x2<T, P> operator*(T const & s, tmat2x2<T, P> const & m);
182
183 template <typename T, precision P>
184 GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator*(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
185
186 template <typename T, precision P>
187 GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator*(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
188
189 template <typename T, precision P>
190 GLM_FUNC_DECL tmat2x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
191
192 template <typename T, precision P>
193 GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat3x2<T, P> const & m2);
194
195 template <typename T, precision P>
196 GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat2x2<T, P> const & m1, tmat4x2<T, P> const & m2);
197
198 template <typename T, precision P>
199 GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m, T const & s);
200
201 template <typename T, precision P>
202 GLM_FUNC_DECL tmat2x2<T, P> operator/(T const & s, tmat2x2<T, P> const & m);
203
204 template <typename T, precision P>
205 GLM_FUNC_DECL typename tmat2x2<T, P>::col_type operator/(tmat2x2<T, P> const & m, typename tmat2x2<T, P>::row_type const & v);
206
207 template <typename T, precision P>
208 GLM_FUNC_DECL typename tmat2x2<T, P>::row_type operator/(typename tmat2x2<T, P>::col_type const & v, tmat2x2<T, P> const & m);
209
210 template <typename T, precision P>
211 GLM_FUNC_DECL tmat2x2<T, P> operator/(tmat2x2<T, P> const & m1, tmat2x2<T, P> const & m2);
212
213 // Unary constant operators
214 template <typename T, precision P>
215 GLM_FUNC_DECL tmat2x2<T, P> const operator-(tmat2x2<T, P> const & m);
216 } //namespace glm
217
218 #ifndef GLM_EXTERNAL_TEMPLATE
219 #include "type_mat2x2.inl"
220 #endif
glm::length
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
glm
Definition: _noise.hpp:39
type_vec2.hpp
OpenGL Mathematics (glm.g-truc.net)
type_mat.hpp
OpenGL Mathematics (glm.g-truc.net)