GLM 0.9.5

- Main Page
- Related Pages
- Modules
- Namespaces
- Files

- File List

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