0.9.9 API documenation
type_mat4x2.hpp
Go to the documentation of this file.
1 
4 #pragma once
5 
6 #include "../fwd.hpp"
7 #include "type_vec2.hpp"
8 #include "type_vec4.hpp"
9 #include "type_mat.hpp"
10 #include <limits>
11 #include <cstddef>
12 
13 namespace glm
14 {
15  template<typename T, qualifier Q>
16  struct mat<4, 2, T, Q>
17  {
18  typedef vec<2, T, Q> col_type;
19  typedef vec<4, T, Q> row_type;
20  typedef mat<4, 2, T, Q> type;
21  typedef mat<2, 4, T, Q> transpose_type;
22  typedef T value_type;
23 
24  private:
25  col_type value[4];
26 
27  public:
28  // -- Accesses --
29 
30  typedef length_t length_type;
31  GLM_FUNC_DECL static GLM_CONSTEXPR length_type length() { return 4; }
32 
33  GLM_FUNC_DECL col_type & operator[](length_type i);
34  GLM_FUNC_DECL col_type const& operator[](length_type i) const;
35 
36  // -- Constructors --
37 
38  GLM_FUNC_DECL mat() GLM_DEFAULT;
39  GLM_FUNC_DECL mat(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
40  template<qualifier P>
41  GLM_FUNC_DECL mat(mat<4, 2, T, P> const& m);
42 
43  GLM_FUNC_DECL explicit mat(T scalar);
44  GLM_FUNC_DECL mat(
45  T x0, T y0,
46  T x1, T y1,
47  T x2, T y2,
48  T x3, T y3);
49  GLM_FUNC_DECL mat(
50  col_type const& v0,
51  col_type const& v1,
52  col_type const& v2,
53  col_type const& v3);
54 
55  // -- Conversions --
56 
57  template<
58  typename X1, typename Y1,
59  typename X2, typename Y2,
60  typename X3, typename Y3,
61  typename X4, typename Y4>
62  GLM_FUNC_DECL mat(
63  X1 x1, Y1 y1,
64  X2 x2, Y2 y2,
65  X3 x3, Y3 y3,
66  X4 x4, Y4 y4);
67 
68  template<typename V1, typename V2, typename V3, typename V4>
69  GLM_FUNC_DECL mat(
70  vec<2, V1, Q> const& v1,
71  vec<2, V2, Q> const& v2,
72  vec<2, V3, Q> const& v3,
73  vec<2, V4, Q> const& v4);
74 
75  // -- Matrix conversions --
76 
77  template<typename U, qualifier P>
78  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 2, U, P> const& m);
79 
80  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 2, T, Q> const& x);
81  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 3, T, Q> const& x);
82  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 4, T, Q> const& x);
83  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 3, T, Q> const& x);
84  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 2, T, Q> const& x);
85  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<2, 4, T, Q> const& x);
86  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<4, 3, T, Q> const& x);
87  GLM_FUNC_DECL GLM_EXPLICIT mat(mat<3, 4, T, Q> const& x);
88 
89  // -- Unary arithmetic operators --
90 
91  GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, T, Q> const& m) GLM_DEFAULT;
92 
93  template<typename U>
94  GLM_FUNC_DECL mat<4, 2, T, Q> & operator=(mat<4, 2, U, Q> const& m);
95  template<typename U>
96  GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(U s);
97  template<typename U>
98  GLM_FUNC_DECL mat<4, 2, T, Q> & operator+=(mat<4, 2, U, Q> const& m);
99  template<typename U>
100  GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(U s);
101  template<typename U>
102  GLM_FUNC_DECL mat<4, 2, T, Q> & operator-=(mat<4, 2, U, Q> const& m);
103  template<typename U>
104  GLM_FUNC_DECL mat<4, 2, T, Q> & operator*=(U s);
105  template<typename U>
106  GLM_FUNC_DECL mat<4, 2, T, Q> & operator/=(U s);
107 
108  // -- Increment and decrement operators --
109 
110  GLM_FUNC_DECL mat<4, 2, T, Q> & operator++ ();
111  GLM_FUNC_DECL mat<4, 2, T, Q> & operator-- ();
112  GLM_FUNC_DECL mat<4, 2, T, Q> operator++(int);
113  GLM_FUNC_DECL mat<4, 2, T, Q> operator--(int);
114  };
115 
116  // -- Unary operators --
117 
118  template<typename T, qualifier Q>
119  GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m);
120 
121  template<typename T, qualifier Q>
122  GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m);
123 
124  // -- Binary operators --
125 
126  template<typename T, qualifier Q>
127  GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m, T scalar);
128 
129  template<typename T, qualifier Q>
130  GLM_FUNC_DECL mat<4, 2, T, Q> operator+(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
131 
132  template<typename T, qualifier Q>
133  GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m, T scalar);
134 
135  template<typename T, qualifier Q>
136  GLM_FUNC_DECL mat<4, 2, T, Q> operator-(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
137 
138  template<typename T, qualifier Q>
139  GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m, T scalar);
140 
141  template<typename T, qualifier Q>
142  GLM_FUNC_DECL mat<4, 2, T, Q> operator*(T scalar, mat<4, 2, T, Q> const& m);
143 
144  template<typename T, qualifier Q>
145  GLM_FUNC_DECL typename mat<4, 2, T, Q>::col_type operator*(mat<4, 2, T, Q> const& m, typename mat<4, 2, T, Q>::row_type const& v);
146 
147  template<typename T, qualifier Q>
148  GLM_FUNC_DECL typename mat<4, 2, T, Q>::row_type operator*(typename mat<4, 2, T, Q>::col_type const& v, mat<4, 2, T, Q> const& m);
149 
150  template<typename T, qualifier Q>
151  GLM_FUNC_DECL mat<2, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<2, 4, T, Q> const& m2);
152 
153  template<typename T, qualifier Q>
154  GLM_FUNC_DECL mat<3, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<3, 4, T, Q> const& m2);
155 
156  template<typename T, qualifier Q>
157  GLM_FUNC_DECL mat<4, 2, T, Q> operator*(mat<4, 2, T, Q> const& m1, mat<4, 4, T, Q> const& m2);
158 
159  template<typename T, qualifier Q>
160  GLM_FUNC_DECL mat<4, 2, T, Q> operator/(mat<4, 2, T, Q> const& m, T scalar);
161 
162  template<typename T, qualifier Q>
163  GLM_FUNC_DECL mat<4, 2, T, Q> operator/(T scalar, mat<4, 2, T, Q> const& m);
164 
165  // -- Boolean operators --
166 
167  template<typename T, qualifier Q>
168  GLM_FUNC_DECL bool operator==(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
169 
170  template<typename T, qualifier Q>
171  GLM_FUNC_DECL bool operator!=(mat<4, 2, T, Q> const& m1, mat<4, 2, T, Q> const& m2);
172 }//namespace glm
173 
174 #ifndef GLM_EXTERNAL_TEMPLATE
175 #include "type_mat4x2.inl"
176 #endif
Core features
Core features
Definition: common.hpp:20
GLM_FUNC_DECL T length(vec< L, T, Q > const &x)
Returns the length of x, i.e., sqrt(x * x).
Core features