PSMoveService
type_mat2x2.hpp
Go to the documentation of this file.
1 
29 #ifndef glm_core_type_mat2x2
30 #define glm_core_type_mat2x2
31 
32 #include "type_mat.hpp"
33 
34 namespace glm{
35 namespace detail
36 {
37  template <typename T> struct tvec1;
38  template <typename T> struct tvec2;
39  template <typename T> struct tvec3;
40  template <typename T> struct tvec4;
41  template <typename T> struct tmat2x2;
42  template <typename T> struct tmat2x3;
43  template <typename T> struct tmat2x4;
44  template <typename T> struct tmat3x2;
45  template <typename T> struct tmat3x3;
46  template <typename T> struct tmat3x4;
47  template <typename T> struct tmat4x2;
48  template <typename T> struct tmat4x3;
49  template <typename T> struct tmat4x4;
50 
51  // @brief Template for 2 * 2 matrix of floating-point numbers.
52  // @ingroup core_template
53  template <typename T>
54  struct tmat2x2
55  {
56  // Implementation detail
57  enum ctor{null};
58  typedef T value_type;
59  typedef std::size_t size_type;
60  typedef tvec2<T> col_type;
61  typedef tvec2<T> row_type;
62  static GLM_FUNC_DECL size_type col_size();
63  static GLM_FUNC_DECL size_type row_size();
64 
65  typedef tmat2x2<T> type;
66  typedef tmat2x2<T> transpose_type;
67 
68  GLM_FUNC_DECL size_type length() const;
69 
70  public:
71  // Implementation detail
72  GLM_FUNC_DECL tmat2x2<T> _inverse() const;
73 
74  private:
76  // Implementation detail
77  col_type value[2];
78 
79  public:
81  // Constructors
82  GLM_FUNC_DECL tmat2x2();
83  GLM_FUNC_DECL tmat2x2(
84  tmat2x2 const & m);
85 
86  GLM_FUNC_DECL explicit tmat2x2(
87  ctor Null);
88  GLM_FUNC_DECL explicit tmat2x2(
89  value_type const & x);
90  GLM_FUNC_DECL explicit tmat2x2(
91  value_type const & x1, value_type const & y1,
92  value_type const & x2, value_type const & y2);
93  GLM_FUNC_DECL explicit tmat2x2(
94  col_type const & v1,
95  col_type const & v2);
96 
98  // Conversions
99  template <typename U>
100  GLM_FUNC_DECL explicit tmat2x2(
101  U const & x);
102 
103  template <typename U, typename V, typename M, typename N>
104  GLM_FUNC_DECL explicit tmat2x2(
105  U const & x1, V const & y1,
106  M const & x2, N const & y2);
107 
108  template <typename U, typename V>
109  GLM_FUNC_DECL explicit tmat2x2(
110  tvec2<U> const & v1,
111  tvec2<V> const & v2);
112 
114  // Matrix conversions
115  template <typename U>
116  GLM_FUNC_DECL explicit tmat2x2(tmat2x2<U> const & m);
117 
118  GLM_FUNC_DECL explicit tmat2x2(tmat3x3<T> const & x);
119  GLM_FUNC_DECL explicit tmat2x2(tmat4x4<T> const & x);
120  GLM_FUNC_DECL explicit tmat2x2(tmat2x3<T> const & x);
121  GLM_FUNC_DECL explicit tmat2x2(tmat3x2<T> const & x);
122  GLM_FUNC_DECL explicit tmat2x2(tmat2x4<T> const & x);
123  GLM_FUNC_DECL explicit tmat2x2(tmat4x2<T> const & x);
124  GLM_FUNC_DECL explicit tmat2x2(tmat3x4<T> const & x);
125  GLM_FUNC_DECL explicit tmat2x2(tmat4x3<T> const & x);
126 
128  // Accesses
129 
130  GLM_FUNC_DECL col_type & operator[](size_type i);
131  GLM_FUNC_DECL col_type const & operator[](size_type i) const;
132 
133  // Unary updatable operators
134  GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<T> const & m);
135  template <typename U>
136  GLM_FUNC_DECL tmat2x2<T> & operator=(tmat2x2<U> const & m);
137  template <typename U>
138  GLM_FUNC_DECL tmat2x2<T> & operator+=(U const & s);
139  template <typename U>
140  GLM_FUNC_DECL tmat2x2<T> & operator+=(tmat2x2<U> const & m);
141  template <typename U>
142  GLM_FUNC_DECL tmat2x2<T> & operator-=(U const & s);
143  template <typename U>
144  GLM_FUNC_DECL tmat2x2<T> & operator-=(tmat2x2<U> const & m);
145  template <typename U>
146  GLM_FUNC_DECL tmat2x2<T> & operator*=(U const & s);
147  template <typename U>
148  GLM_FUNC_DECL tmat2x2<T> & operator*=(tmat2x2<U> const & m);
149  template <typename U>
150  GLM_FUNC_DECL tmat2x2<T> & operator/=(U const & s);
151  template <typename U>
152  GLM_FUNC_DECL tmat2x2<T> & operator/=(tmat2x2<U> const & m);
153  GLM_FUNC_DECL tmat2x2<T> & operator++();
154  GLM_FUNC_DECL tmat2x2<T> & operator--();
155  };
156 
157  // Binary operators
158  template <typename T>
159  tmat2x2<T> operator+ (
160  tmat2x2<T> const & m,
161  typename tmat2x2<T>::value_type const & s);
162 
163  template <typename T>
164  tmat2x2<T> operator+ (
165  typename tmat2x2<T>::value_type const & s,
166  tmat2x2<T> const & m);
167 
168  template <typename T>
169  tmat2x2<T> operator+ (
170  tmat2x2<T> const & m1,
171  tmat2x2<T> const & m2);
172 
173  template <typename T>
174  tmat2x2<T> operator- (
175  tmat2x2<T> const & m,
176  typename tmat2x2<T>::value_type const & s);
177 
178  template <typename T>
179  tmat2x2<T> operator- (
180  typename tmat2x2<T>::value_type const & s,
181  tmat2x2<T> const & m);
182 
183  template <typename T>
184  tmat2x2<T> operator- (
185  tmat2x2<T> const & m1,
186  tmat2x2<T> const & m2);
187 
188  template <typename T>
189  tmat2x2<T> operator* (
190  tmat2x2<T> const & m,
191  typename tmat2x2<T>::value_type const & s);
192 
193  template <typename T>
194  tmat2x2<T> operator* (
195  typename tmat2x2<T>::value_type const & s,
196  tmat2x2<T> const & m);
197 
198  template <typename T>
199  typename tmat2x2<T>::col_type operator* (
200  tmat2x2<T> const & m,
201  typename tmat2x2<T>::row_type const & v);
202 
203  template <typename T>
204  typename tmat2x2<T>::row_type operator* (
205  typename tmat2x2<T>::col_type const & v,
206  tmat2x2<T> const & m);
207 
208  template <typename T>
209  tmat2x2<T> operator* (
210  tmat2x2<T> const & m1,
211  tmat2x2<T> const & m2);
212 
213  template <typename T>
214  tmat3x2<T> operator* (
215  tmat2x2<T> const & m1,
216  tmat3x2<T> const & m2);
217 
218  template <typename T>
219  tmat4x2<T> operator* (
220  tmat2x2<T> const & m1,
221  tmat4x2<T> const & m2);
222 
223  template <typename T>
224  tmat2x2<T> operator/ (
225  tmat2x2<T> const & m,
226  typename tmat2x2<T>::value_type const & s);
227 
228  template <typename T>
229  tmat2x2<T> operator/ (
230  typename tmat2x2<T>::value_type const & s,
231  tmat2x2<T> const & m);
232 
233  template <typename T>
234  typename tmat2x2<T>::col_type operator/ (
235  tmat2x2<T> const & m,
236  typename tmat2x2<T>::row_type const & v);
237 
238  template <typename T>
239  typename tmat2x2<T>::row_type operator/ (
240  typename tmat2x2<T>::col_type const & v,
241  tmat2x2<T> const & m);
242 
243  template <typename T>
244  tmat2x2<T> operator/ (
245  tmat2x2<T> const & m1,
246  tmat2x2<T> const & m2);
247 
248  // Unary constant operators
249  template <typename T>
250  tmat2x2<T> const operator- (
251  tmat2x2<T> const & m);
252 
253  template <typename T>
254  tmat2x2<T> const operator-- (
255  tmat2x2<T> const & m,
256  int);
257 
258  template <typename T>
259  tmat2x2<T> const operator++ (
260  tmat2x2<T> const & m,
261  int);
262 } //namespace detail
263 
266 
273 
280 
287 
294 
301 
308 
310 }//namespace glm
311 
312 #ifndef GLM_EXTERNAL_TEMPLATE
313 #include "type_mat2x2.inl"
314 #endif
315 
316 #endif //glm_core_type_mat2x2
Definition: type_mat2x2.hpp:45
Definition: type_mat2x2.hpp:48
Definition: type_mat2x2.hpp:42
Definition: _detail.hpp:38
detail::tmat2x2< mediump_float > mediump_mat2
2 columns of 2 components matrix of medium precision floating-point numbers.
Definition: type_mat2x2.hpp:279
Definition: type_mat2x2.hpp:38
detail::tmat2x2< highp_float > highp_mat2
2 columns of 2 components matrix of high precision floating-point numbers.
Definition: type_mat2x2.hpp:286
detail::tmat2x2< lowp_float > lowp_mat2x2
2 columns of 2 components matrix of low precision floating-point numbers.
Definition: type_mat2x2.hpp:293
detail::tmat2x2< mediump_float > mediump_mat2x2
2 columns of 2 components matrix of medium precision floating-point numbers.
Definition: type_mat2x2.hpp:300
Definition: type_mat2x2.hpp:39
OpenGL Mathematics (glm.g-truc.net)
detail::tmat2x2< lowp_float > lowp_mat2
2 columns of 2 components matrix of low precision floating-point numbers.
Definition: type_mat2x2.hpp:272
Definition: type_mat2x2.hpp:44
Definition: type_mat2x2.hpp:47
Definition: type_mat2x2.hpp:41
detail::tmat2x2< highp_float > highp_mat2x2
2 columns of 2 components matrix of high precision floating-point numbers.
Definition: type_mat2x2.hpp:307
Definition: type_mat2x2.hpp:40
OpenGL Mathematics (glm.g-truc.net)
Definition: type_mat2x2.hpp:46
Definition: type_mat2x2.hpp:49
Definition: type_mat2x2.hpp:43
Definition: type_mat2x2.hpp:37