0.9.6
type_mat4x2.hpp
Go to the documentation of this file.
1 
29 #pragma once
30 
31 #include "../fwd.hpp"
32 #include "type_vec2.hpp"
33 #include "type_vec4.hpp"
34 #include "type_mat.hpp"
35 #include <limits>
36 #include <cstddef>
37 
38 namespace glm
39 {
40  template <typename T, precision P = defaultp>
41  struct tmat4x2
42  {
43  typedef T value_type;
44  typedef std::size_t size_type;
45  typedef tvec2<T, P> col_type;
46  typedef tvec4<T, P> row_type;
47  typedef tmat4x2<T, P> type;
48  typedef tmat2x4<T, P> transpose_type;
49 
50 # ifdef GLM_FORCE_SIZE_FUNC
51  GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
52 # else
53  GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
54 # endif//GLM_FORCE_SIZE_FUNC
55 
56  private:
58  col_type value[4];
60 
61  public:
62  // Constructors
63  GLM_FUNC_DECL tmat4x2();
64  template <precision Q>
65  GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
66 
67  GLM_FUNC_DECL explicit tmat4x2(ctor);
68  GLM_FUNC_DECL explicit tmat4x2(T const & x);
69  GLM_FUNC_DECL tmat4x2(
70  T const & x0, T const & y0,
71  T const & x1, T const & y1,
72  T const & x2, T const & y2,
73  T const & x3, T const & y3);
74  GLM_FUNC_DECL tmat4x2(
75  col_type const & v0,
76  col_type const & v1,
77  col_type const & v2,
78  col_type const & v3);
79 
81  // Conversions
82 
83  template <
84  typename X1, typename Y1,
85  typename X2, typename Y2,
86  typename X3, typename Y3,
87  typename X4, typename Y4>
88  GLM_FUNC_DECL tmat4x2(
89  X1 const & x1, Y1 const & y1,
90  X2 const & x2, Y2 const & y2,
91  X3 const & x3, Y3 const & y3,
92  X4 const & x4, Y4 const & y4);
93 
94  template <typename V1, typename V2, typename V3, typename V4>
95  GLM_FUNC_DECL tmat4x2(
96  tvec2<V1, P> const & v1,
97  tvec2<V2, P> const & v2,
98  tvec2<V3, P> const & v3,
99  tvec2<V4, P> const & v4);
100 
102  // Matrix conversions
103 
104 # ifdef GLM_FORCE_EXPLICIT_CTOR
105  template <typename U, precision Q>
106  GLM_FUNC_DECL explicit tmat4x2(tmat4x2<U, Q> const & m);
107 # else
108  template <typename U, precision Q>
109  GLM_FUNC_DECL tmat4x2(tmat4x2<U, Q> const & m);
110 # endif
111 
112  GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
113  GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
114  GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T, P> const & x);
115  GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T, P> const & x);
116  GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T, P> const & x);
117  GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T, P> const & x);
118  GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
119  GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
120 
121  // Accesses
122  GLM_FUNC_DECL col_type & operator[](length_t i);
123  GLM_FUNC_DECL col_type const & operator[](length_t i) const;
124 
125  template <typename U>
126  GLM_FUNC_DECL tmat4x2<T, P>& operator=(tmat4x2<U, P> const & m);
127  template <typename U>
128  GLM_FUNC_DECL tmat4x2<T, P>& operator+=(U s);
129  template <typename U>
130  GLM_FUNC_DECL tmat4x2<T, P>& operator+=(tmat4x2<U, P> const & m);
131  template <typename U>
132  GLM_FUNC_DECL tmat4x2<T, P>& operator-=(U s);
133  template <typename U>
134  GLM_FUNC_DECL tmat4x2<T, P>& operator-=(tmat4x2<U, P> const & m);
135  template <typename U>
136  GLM_FUNC_DECL tmat4x2<T, P>& operator*=(U s);
137  template <typename U>
138  GLM_FUNC_DECL tmat4x2<T, P>& operator/=(U s);
139 
141  // Increment and decrement operators
142 
143  GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
144  GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
145  GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
146  GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
147  };
148 
149  // Binary operators
150  template <typename T, precision P>
151  GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s);
152 
153  template <typename T, precision P>
154  GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
155 
156  template <typename T, precision P>
157  GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s);
158 
159  template <typename T, precision P>
160  GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
161 
162  template <typename T, precision P>
163  GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s);
164 
165  template <typename T, precision P>
166  GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m);
167 
168  template <typename T, precision P>
169  GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
170 
171  template <typename T, precision P>
172  GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
173 
174  template <typename T, precision P>
175  GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
176 
177  template <typename T, precision P>
178  GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
179 
180  template <typename T, precision P>
181  GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
182 
183  template <typename T, precision P>
184  GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s);
185 
186  template <typename T, precision P>
187  GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m);
188 
189  // Unary constant operators
190  template <typename T, precision P>
191  GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
192 }//namespace glm
193 
194 #ifndef GLM_EXTERNAL_TEMPLATE
195 #include "type_mat4x2.inl"
196 #endif
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
Definition: _noise.hpp:31
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)