0.9.7
type_mat4x2.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_vec4.hpp"
38 #include "type_mat.hpp"
39 #include <limits>
40 #include <cstddef>
41 
42 namespace glm
43 {
44  template <typename T, precision P = defaultp>
45  struct tmat4x2
46  {
47  typedef tvec2<T, P> col_type;
48  typedef tvec4<T, P> row_type;
49  typedef tmat4x2<T, P> type;
50  typedef tmat2x4<T, P> transpose_type;
51  typedef T value_type;
52 
53 # ifdef GLM_META_PROG_HELPERS
54  static GLM_RELAXED_CONSTEXPR length_t components = 4;
55  static GLM_RELAXED_CONSTEXPR length_t cols = 4;
56  static GLM_RELAXED_CONSTEXPR length_t rows = 2;
57  static GLM_RELAXED_CONSTEXPR precision prec = P;
58 # endif//GLM_META_PROG_HELPERS
59 
60  private:
61  col_type value[4];
62 
63  public:
64  // -- Constructors --
65 
66  GLM_FUNC_DECL tmat4x2() GLM_DEFAULT_CTOR;
67  GLM_FUNC_DECL tmat4x2(tmat4x2<T, P> const & m) GLM_DEFAULT;
68  template <precision Q>
69  GLM_FUNC_DECL tmat4x2(tmat4x2<T, Q> const & m);
70 
71  GLM_FUNC_DECL explicit tmat4x2(ctor);
72  GLM_FUNC_DECL explicit tmat4x2(T const & x);
73  GLM_FUNC_DECL tmat4x2(
74  T const & x0, T const & y0,
75  T const & x1, T const & y1,
76  T const & x2, T const & y2,
77  T const & x3, T const & y3);
78  GLM_FUNC_DECL tmat4x2(
79  col_type const & v0,
80  col_type const & v1,
81  col_type const & v2,
82  col_type const & v3);
83 
84  // -- Conversions --
85 
86  template <
87  typename X1, typename Y1,
88  typename X2, typename Y2,
89  typename X3, typename Y3,
90  typename X4, typename Y4>
91  GLM_FUNC_DECL tmat4x2(
92  X1 const & x1, Y1 const & y1,
93  X2 const & x2, Y2 const & y2,
94  X3 const & x3, Y3 const & y3,
95  X4 const & x4, Y4 const & y4);
96 
97  template <typename V1, typename V2, typename V3, typename V4>
98  GLM_FUNC_DECL tmat4x2(
99  tvec2<V1, P> const & v1,
100  tvec2<V2, P> const & v2,
101  tvec2<V3, P> const & v3,
102  tvec2<V4, P> const & v4);
103 
104  // -- Matrix conversions --
105 
106  template <typename U, precision Q>
107  GLM_FUNC_DECL GLM_EXPLICIT tmat4x2(tmat4x2<U, Q> const & m);
108 
109  GLM_FUNC_DECL explicit tmat4x2(tmat2x2<T, P> const & x);
110  GLM_FUNC_DECL explicit tmat4x2(tmat3x3<T, P> const & x);
111  GLM_FUNC_DECL explicit tmat4x2(tmat4x4<T, P> const & x);
112  GLM_FUNC_DECL explicit tmat4x2(tmat2x3<T, P> const & x);
113  GLM_FUNC_DECL explicit tmat4x2(tmat3x2<T, P> const & x);
114  GLM_FUNC_DECL explicit tmat4x2(tmat2x4<T, P> const & x);
115  GLM_FUNC_DECL explicit tmat4x2(tmat4x3<T, P> const & x);
116  GLM_FUNC_DECL explicit tmat4x2(tmat3x4<T, P> const & x);
117 
118  // -- Accesses --
119 
120 # ifdef GLM_FORCE_SIZE_FUNC
121  typedef size_t size_type;
122  GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
123 
124  GLM_FUNC_DECL col_type & operator[](size_type i);
125  GLM_FUNC_DECL col_type const & operator[](size_type i) const;
126 # else
127  typedef length_t length_type;
128  GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
129 
130  GLM_FUNC_DECL col_type & operator[](length_type i);
131  GLM_FUNC_DECL col_type const & operator[](length_type i) const;
132 # endif//GLM_FORCE_SIZE_FUNC
133 
134  // -- Unary arithmetic operators --
135 
136  GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<T, P> const & m) GLM_DEFAULT;
137 
138  template <typename U>
139  GLM_FUNC_DECL tmat4x2<T, P> & operator=(tmat4x2<U, P> const & m);
140  template <typename U>
141  GLM_FUNC_DECL tmat4x2<T, P> & operator+=(U s);
142  template <typename U>
143  GLM_FUNC_DECL tmat4x2<T, P> & operator+=(tmat4x2<U, P> const & m);
144  template <typename U>
145  GLM_FUNC_DECL tmat4x2<T, P> & operator-=(U s);
146  template <typename U>
147  GLM_FUNC_DECL tmat4x2<T, P> & operator-=(tmat4x2<U, P> const & m);
148  template <typename U>
149  GLM_FUNC_DECL tmat4x2<T, P> & operator*=(U s);
150  template <typename U>
151  GLM_FUNC_DECL tmat4x2<T, P> & operator/=(U s);
152 
153  // -- Increment and decrement operators --
154 
155  GLM_FUNC_DECL tmat4x2<T, P> & operator++ ();
156  GLM_FUNC_DECL tmat4x2<T, P> & operator-- ();
157  GLM_FUNC_DECL tmat4x2<T, P> operator++(int);
158  GLM_FUNC_DECL tmat4x2<T, P> operator--(int);
159  };
160 
161  // -- Unary operators --
162 
163  template <typename T, precision P>
164  GLM_FUNC_DECL tmat4x2<T, P> const operator-(tmat4x2<T, P> const & m);
165 
166  // -- Binary operators --
167 
168  template <typename T, precision P>
169  GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m, T const & s);
170 
171  template <typename T, precision P>
172  GLM_FUNC_DECL tmat4x2<T, P> operator+(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
173 
174  template <typename T, precision P>
175  GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m, T const & s);
176 
177  template <typename T, precision P>
178  GLM_FUNC_DECL tmat4x2<T, P> operator-(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
179 
180  template <typename T, precision P>
181  GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m, T const & s);
182 
183  template <typename T, precision P>
184  GLM_FUNC_DECL tmat4x2<T, P> operator*(T const & s, tmat4x2<T, P> const & m);
185 
186  template <typename T, precision P>
187  GLM_FUNC_DECL typename tmat4x2<T, P>::col_type operator*(tmat4x2<T, P> const & m, typename tmat4x2<T, P>::row_type const & v);
188 
189  template <typename T, precision P>
190  GLM_FUNC_DECL typename tmat4x2<T, P>::row_type operator*(typename tmat4x2<T, P>::col_type const & v, tmat4x2<T, P> const & m);
191 
192  template <typename T, precision P>
193  GLM_FUNC_DECL tmat3x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat3x4<T, P> const & m2);
194 
195  template <typename T, precision P>
196  GLM_FUNC_DECL tmat4x2<T, P> operator*(tmat4x2<T, P> const & m1, tmat4x4<T, P> const & m2);
197 
198  template <typename T, precision P>
199  GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat4x3<T, P> const & m1, tmat2x4<T, P> const & m2);
200 
201  template <typename T, precision P>
202  GLM_FUNC_DECL tmat4x2<T, P> operator/(tmat4x2<T, P> const & m, T const & s);
203 
204  template <typename T, precision P>
205  GLM_FUNC_DECL tmat4x2<T, P> operator/(T const & s, tmat4x2<T, P> const & m);
206 
207  // -- Boolean operators --
208 
209  template <typename T, precision P>
210  GLM_FUNC_DECL bool operator==(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
211 
212  template <typename T, precision P>
213  GLM_FUNC_DECL bool operator!=(tmat4x2<T, P> const & m1, tmat4x2<T, P> const & m2);
214 }//namespace glm
215 
216 #ifndef GLM_EXTERNAL_TEMPLATE
217 #include "type_mat4x2.inl"
218 #endif
GLM_FUNC_DECL T length(vecType< T, P > const &x)
Returns the length of x, i.e., sqrt(x * x).
Definition: _noise.hpp:40
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)
OpenGL Mathematics (glm.g-truc.net)