0.9.7: type_mat2x4.hpp Source File

| 0.9.7

- 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 # ifdef GLM_META_PROG_HELPERS
54 static GLM_RELAXED_CONSTEXPR length_t components = 2;
55 static GLM_RELAXED_CONSTEXPR length_t cols = 2;
56 static GLM_RELAXED_CONSTEXPR length_t rows = 4;
57 static GLM_RELAXED_CONSTEXPR precision prec = P;
58 # endif//GLM_META_PROG_HELPERS
59
60 private:
61 col_type value[2];
62
63 public:
64 // -- Constructors --
65
66 GLM_FUNC_DECL tmat2x4() GLM_DEFAULT_CTOR;
67 GLM_FUNC_DECL tmat2x4(tmat2x4<T, P> const & m) GLM_DEFAULT;
68 template <precision Q>
69 GLM_FUNC_DECL tmat2x4(tmat2x4<T, Q> const & m);
70
71 GLM_FUNC_DECL explicit tmat2x4(ctor);
72 GLM_FUNC_DECL explicit tmat2x4(T const & s);
73 GLM_FUNC_DECL tmat2x4(
74 T const & x0, T const & y0, T const & z0, T const & w0,
75 T const & x1, T const & y1, T const & z1, T const & w1);
76 GLM_FUNC_DECL tmat2x4(
77 col_type const & v0,
78 col_type const & v1);
79
80 // -- Conversions --
81
82 template <
83 typename X1, typename Y1, typename Z1, typename W1,
84 typename X2, typename Y2, typename Z2, typename W2>
85 GLM_FUNC_DECL tmat2x4(
86 X1 const & x1, Y1 const & y1, Z1 const & z1, W1 const & w1,
87 X2 const & x2, Y2 const & y2, Z2 const & z2, W2 const & w2);
88
89 template <typename U, typename V>
90 GLM_FUNC_DECL tmat2x4(
91 tvec4<U, P> const & v1,
92 tvec4<V, P> const & v2);
93
94 // -- Matrix conversions --
95
96 template <typename U, precision Q>
97 GLM_FUNC_DECL GLM_EXPLICIT tmat2x4(tmat2x4<U, Q> const & m);
98
99 GLM_FUNC_DECL explicit tmat2x4(tmat2x2<T, P> const & x);
100 GLM_FUNC_DECL explicit tmat2x4(tmat3x3<T, P> const & x);
101 GLM_FUNC_DECL explicit tmat2x4(tmat4x4<T, P> const & x);
102 GLM_FUNC_DECL explicit tmat2x4(tmat2x3<T, P> const & x);
103 GLM_FUNC_DECL explicit tmat2x4(tmat3x2<T, P> const & x);
104 GLM_FUNC_DECL explicit tmat2x4(tmat3x4<T, P> const & x);
105 GLM_FUNC_DECL explicit tmat2x4(tmat4x2<T, P> const & x);
106 GLM_FUNC_DECL explicit tmat2x4(tmat4x3<T, P> const & x);
107
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
124 // -- Unary arithmetic operators --
125
126 GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<T, P> const & m) GLM_DEFAULT;
127
128 template <typename U>
129 GLM_FUNC_DECL tmat2x4<T, P> & operator=(tmat2x4<U, P> const & m);
130 template <typename U>
131 GLM_FUNC_DECL tmat2x4<T, P> & operator+=(U s);
132 template <typename U>
133 GLM_FUNC_DECL tmat2x4<T, P> & operator+=(tmat2x4<U, P> const & m);
134 template <typename U>
135 GLM_FUNC_DECL tmat2x4<T, P> & operator-=(U s);
136 template <typename U>
137 GLM_FUNC_DECL tmat2x4<T, P> & operator-=(tmat2x4<U, P> const & m);
138 template <typename U>
139 GLM_FUNC_DECL tmat2x4<T, P> & operator*=(U s);
140 template <typename U>
141 GLM_FUNC_DECL tmat2x4<T, P> & operator/=(U s);
142
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 // -- Unary operators --
152
153 template <typename T, precision P>
154 GLM_FUNC_DECL tmat2x4<T, P> const operator-(tmat2x4<T, P> const & m);
155
156 // -- Binary operators --
157
158 template <typename T, precision P>
159 GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m, T const & s);
160
161 template <typename T, precision P>
162 GLM_FUNC_DECL tmat2x4<T, P> operator+(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
163
164 template <typename T, precision P>
165 GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m, T const & s);
166
167 template <typename T, precision P>
168 GLM_FUNC_DECL tmat2x4<T, P> operator-(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
169
170 template <typename T, precision P>
171 GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m, T const & s);
172
173 template <typename T, precision P>
174 GLM_FUNC_DECL tmat2x4<T, P> operator*(T const & s, tmat2x4<T, P> const & m);
175
176 template <typename T, precision P>
177 GLM_FUNC_DECL typename tmat2x4<T, P>::col_type operator*(tmat2x4<T, P> const & m, typename tmat2x4<T, P>::row_type const & v);
178
179 template <typename T, precision P>
180 GLM_FUNC_DECL typename tmat2x4<T, P>::row_type operator*(typename tmat2x4<T, P>::col_type const & v, tmat2x4<T, P> const & m);
181
182 template <typename T, precision P>
183 GLM_FUNC_DECL tmat4x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat4x2<T, P> const & m2);
184
185 template <typename T, precision P>
186 GLM_FUNC_DECL tmat2x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat2x2<T, P> const & m2);
187
188 template <typename T, precision P>
189 GLM_FUNC_DECL tmat3x4<T, P> operator*(tmat2x4<T, P> const & m1, tmat3x2<T, P> const & m2);
190
191 template <typename T, precision P>
192 GLM_FUNC_DECL tmat2x4<T, P> operator/(tmat2x4<T, P> const & m, T s);
193
194 template <typename T, precision P>
195 GLM_FUNC_DECL tmat2x4<T, P> operator/(T s, tmat2x4<T, P> const & m);
196
197 // -- Boolean operators --
198
199 template <typename T, precision P>
200 GLM_FUNC_DECL bool operator==(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
201
202 template <typename T, precision P>
203 GLM_FUNC_DECL bool operator!=(tmat2x4<T, P> const & m1, tmat2x4<T, P> const & m2);
204 }//namespace glm
205
206 #ifndef GLM_EXTERNAL_TEMPLATE
207 #include "type_mat2x4.inl"
208 #endif
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:40
type_vec2.hpp
OpenGL Mathematics (glm.g-truc.net)
type_mat.hpp
OpenGL Mathematics (glm.g-truc.net)
type_vec4.hpp
OpenGL Mathematics (glm.g-truc.net)