GLM  0.9.5
type_mat3x2.hpp
1 
29 #ifndef glm_core_type_mat3x2
30 #define glm_core_type_mat3x2
31 
32 #include "../fwd.hpp"
33 #include "type_vec2.hpp"
34 #include "type_vec3.hpp"
35 #include "type_mat.hpp"
36 #include <limits>
37 
38 namespace glm{
39 namespace detail
40 {
41  template <typename T, precision P>
42  struct tmat3x2
43  {
44  enum ctor{_null};
45  typedef T value_type;
46  typedef std::size_t size_type;
47  typedef tvec2<T, P> col_type;
48  typedef tvec3<T, P> row_type;
49  typedef tmat3x2<T, P> type;
50  typedef tmat2x3<T, P> transpose_type;
51 
52  GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
53 
54  private:
55  // Data
56  col_type value[3];
57 
58  public:
59  // Constructors
60  GLM_FUNC_DECL tmat3x2();
61  GLM_FUNC_DECL tmat3x2(tmat3x2<T, P> const & m);
62  template <precision Q>
63  GLM_FUNC_DECL tmat3x2(tmat3x2<T, Q> const & m);
64 
65  GLM_FUNC_DECL explicit tmat3x2(
66  ctor);
67  GLM_FUNC_DECL explicit tmat3x2(
68  T const & s);
69  GLM_FUNC_DECL explicit tmat3x2(
70  T const & x0, T const & y0,
71  T const & x1, T const & y1,
72  T const & x2, T const & y2);
73  GLM_FUNC_DECL explicit tmat3x2(
74  col_type const & v0,
75  col_type const & v1,
76  col_type const & v2);
77 
78 #if(GLM_HAS_INITIALIZER_LISTS)
79  template <typename U>
80  GLM_FUNC_DECL tmat3x2(std::initializer_list<U> l);
81 
82  GLM_FUNC_DECL tmat3x2(std::initializer_list<tvec2<T, P> > l);
83 #endif//GLM_HAS_INITIALIZER_LISTS
84 
86  // Conversions
87  template<
88  typename X1, typename Y1,
89  typename X2, typename Y2,
90  typename X3, typename Y3>
91  GLM_FUNC_DECL explicit tmat3x2(
92  X1 const & x1, Y1 const & y1,
93  X2 const & x2, Y2 const & y2,
94  X3 const & x3, Y3 const & y3);
95 
96  template <typename V1, typename V2, typename V3>
97  GLM_FUNC_DECL explicit tmat3x2(
98  tvec2<V1, P> const & v1,
99  tvec2<V2, P> const & v2,
100  tvec2<V3, P> const & v3);
101 
102  // Matrix conversions
103  template <typename U, precision Q>
104  GLM_FUNC_DECL explicit tmat3x2(tmat3x2<U, Q> const & m);
105 
106  GLM_FUNC_DECL explicit tmat3x2(tmat2x2<T, P> const & x);
107  GLM_FUNC_DECL explicit tmat3x2(tmat3x3<T, P> const & x);
108  GLM_FUNC_DECL explicit tmat3x2(tmat4x4<T, P> const & x);
109  GLM_FUNC_DECL explicit tmat3x2(tmat2x3<T, P> const & x);
110  GLM_FUNC_DECL explicit tmat3x2(tmat2x4<T, P> const & x);
111  GLM_FUNC_DECL explicit tmat3x2(tmat3x4<T, P> const & x);
112  GLM_FUNC_DECL explicit tmat3x2(tmat4x2<T, P> const & x);
113  GLM_FUNC_DECL explicit tmat3x2(tmat4x3<T, P> const & x);
114 
115  // Accesses
116  GLM_FUNC_DECL col_type & operator[](length_t i);
117  GLM_FUNC_DECL col_type const & operator[](length_t i) const;
118 
119  // Unary updatable operators
120  GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<T, P> const & m);
121  template <typename U>
122  GLM_FUNC_DECL tmat3x2<T, P> & operator= (tmat3x2<U, P> const & m);
123  template <typename U>
124  GLM_FUNC_DECL tmat3x2<T, P> & operator+= (U s);
125  template <typename U>
126  GLM_FUNC_DECL tmat3x2<T, P> & operator+= (tmat3x2<U, P> const & m);
127  template <typename U>
128  GLM_FUNC_DECL tmat3x2<T, P> & operator-= (U s);
129  template <typename U>
130  GLM_FUNC_DECL tmat3x2<T, P> & operator-= (tmat3x2<U, P> const & m);
131  template <typename U>
132  GLM_FUNC_DECL tmat3x2<T, P> & operator*= (U s);
133  template <typename U>
134  GLM_FUNC_DECL tmat3x2<T, P> & operator/= (U s);
135 
137  // Increment and decrement operators
138 
139  GLM_FUNC_DECL tmat3x2<T, P> & operator++ ();
140  GLM_FUNC_DECL tmat3x2<T, P> & operator-- ();
141  GLM_FUNC_DECL tmat3x2<T, P> operator++(int);
142  GLM_FUNC_DECL tmat3x2<T, P> operator--(int);
143  };
144 
145  // Binary operators
146  template <typename T, precision P>
147  GLM_FUNC_DECL tmat3x2<T, P> operator+ (
148  tmat3x2<T, P> const & m,
149  T const & s);
150 
151  template <typename T, precision P>
152  GLM_FUNC_DECL tmat3x2<T, P> operator+ (
153  tmat3x2<T, P> const & m1,
154  tmat3x2<T, P> const & m2);
155 
156  template <typename T, precision P>
157  GLM_FUNC_DECL tmat3x2<T, P> operator- (
158  tmat3x2<T, P> const & m,
159  T const & s);
160 
161  template <typename T, precision P>
162  GLM_FUNC_DECL tmat3x2<T, P> operator- (
163  tmat3x2<T, P> const & m1,
164  tmat3x2<T, P> const & m2);
165 
166  template <typename T, precision P>
167  GLM_FUNC_DECL tmat3x2<T, P> operator* (
168  tmat3x2<T, P> const & m,
169  T const & s);
170 
171  template <typename T, precision P>
172  GLM_FUNC_DECL tmat3x2<T, P> operator* (
173  T const & s,
174  tmat3x2<T, P> const & m);
175 
176  template <typename T, precision P>
177  GLM_FUNC_DECL typename tmat3x2<T, P>::col_type operator* (
178  tmat3x2<T, P> const & m,
179  typename tmat3x2<T, P>::row_type const & v);
180 
181  template <typename T, precision P>
182  GLM_FUNC_DECL typename tmat3x2<T, P>::row_type operator* (
183  typename tmat3x2<T, P>::col_type const & v,
184  tmat3x2<T, P> const & m);
185 
186  template <typename T, precision P>
187  GLM_FUNC_DECL tmat2x2<T, P> operator* (
188  tmat3x2<T, P> const & m1,
189  tmat2x3<T, P> const & m2);
190 
191  template <typename T, precision P>
192  GLM_FUNC_DECL tmat3x2<T, P> operator* (
193  tmat3x2<T, P> const & m1,
194  tmat3x3<T, P> const & m2);
195 
196  template <typename T, precision P>
197  GLM_FUNC_DECL tmat4x2<T, P> operator* (
198  tmat3x2<T, P> const & m1,
199  tmat4x3<T, P> const & m2);
200 
201  template <typename T, precision P>
202  GLM_FUNC_DECL tmat3x2<T, P> operator/ (
203  tmat3x2<T, P> const & m,
204  T const & s);
205 
206  template <typename T, precision P>
207  GLM_FUNC_DECL tmat3x2<T, P> operator/ (
208  T const & s,
209  tmat3x2<T, P> const & m);
210 
211  // Unary constant operators
212  template <typename T, precision P>
213  GLM_FUNC_DECL tmat3x2<T, P> const operator-(
214  tmat3x2<T, P> const & m);
215 
216 }//namespace detail
217 }//namespace glm
218 
219 #ifndef GLM_EXTERNAL_TEMPLATE
220 #include "type_mat3x2.inl"
221 #endif
222 
223 #endif //glm_core_type_mat3x2
GLM_FUNC_DECL genType::value_type length(genType const &x)
Returns the length of x, i.e., sqrt(x * x).