0.9.6: type_mat2x4.hpp Source File

| 0.9.6

- Main Page
- Modules
- Files

- File List

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