GLM 0.9.5

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

- File List

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