GLM 0.9.5

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

- File List

type_mat3x3.hpp
1
29 #ifndef glm_core_type_mat3x3
30 #define glm_core_type_mat3x3
31
32 #include "../fwd.hpp"
33 #include "type_vec3.hpp"
34 #include "type_mat.hpp"
35 #include <limits>
36
37 namespace glm{
38 namespace detail
39 {
40 template <typename T, precision P>
41 struct tmat3x3
42 {
43 enum ctor{_null};
44 typedef T value_type;
45 typedef std::size_t size_type;
46 typedef tvec3<T, P> col_type;
47 typedef tvec3<T, P> row_type;
48 typedef tmat3x3<T, P> type;
49 typedef tmat3x3<T, P> transpose_type;
50
51 GLM_FUNC_DECL GLM_CONSTEXPR length_t length() const;
52
53 template <typename U, precision Q>
54 friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
55 template <typename U, precision Q>
56 friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m);
57
58 private:
60 col_type value[3];
62
63 public:
64 // Constructors
65 GLM_FUNC_DECL tmat3x3();
66 GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
67 template <precision Q>
68 GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
69
70 GLM_FUNC_DECL explicit tmat3x3(
71 ctor Null);
72 GLM_FUNC_DECL explicit tmat3x3(
73 T const & s);
74 GLM_FUNC_DECL explicit tmat3x3(
75 T const & x0, T const & y0, T const & z0,
76 T const & x1, T const & y1, T const & z1,
77 T const & x2, T const & y2, T const & z2);
78 GLM_FUNC_DECL explicit tmat3x3(
79 col_type const & v0,
80 col_type const & v1,
81 col_type const & v2);
82
83 #if(GLM_HAS_INITIALIZER_LISTS)
84 template <typename U>
85 GLM_FUNC_DECL tmat3x3(std::initializer_list<U> m);
86
87 GLM_FUNC_DECL tmat3x3(std::initializer_list<tvec3<T, P> > m);
88 #endif//GLM_HAS_INITIALIZER_LISTS
89
91 // Conversions
92 template<
93 typename X1, typename Y1, typename Z1,
94 typename X2, typename Y2, typename Z2,
95 typename X3, typename Y3, typename Z3>
96 GLM_FUNC_DECL explicit tmat3x3(
97 X1 const & x1, Y1 const & y1, Z1 const & z1,
98 X2 const & x2, Y2 const & y2, Z2 const & z2,
99 X3 const & x3, Y3 const & y3, Z3 const & z3);
100
101 template <typename V1, typename V2, typename V3>
102 GLM_FUNC_DECL explicit tmat3x3(
103 tvec3<V1, P> const & v1,
104 tvec3<V2, P> const & v2,
105 tvec3<V3, P> const & v3);
106
107 // Matrix conversions
108 template <typename U, precision Q>
109 GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
110
111 GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
112 GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
113 GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x);
114 GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x);
115 GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x);
116 GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x);
117 GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
118 GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
119
120 // Accesses
121 GLM_FUNC_DECL col_type & operator[](length_t i);
122 GLM_FUNC_DECL col_type const & operator[](length_t i) const;
123
124 // Unary updatable operators
125 GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
126 template <typename U>
127 GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<U, P> const & m);
128 template <typename U>
129 GLM_FUNC_DECL tmat3x3<T, P>& operator+= (U s);
130 template <typename U>
131 GLM_FUNC_DECL tmat3x3<T, P>& operator+= (tmat3x3<U, P> const & m);
132 template <typename U>
133 GLM_FUNC_DECL tmat3x3<T, P>& operator-= (U s);
134 template <typename U>
135 GLM_FUNC_DECL tmat3x3<T, P>& operator-= (tmat3x3<U, P> const & m);
136 template <typename U>
137 GLM_FUNC_DECL tmat3x3<T, P>& operator*= (U s);
138 template <typename U>
139 GLM_FUNC_DECL tmat3x3<T, P>& operator*= (tmat3x3<U, P> const & m);
140 template <typename U>
141 GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U s);
142 template <typename U>
143 GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
144
146 // Increment and decrement operators
147
148 GLM_FUNC_DECL tmat3x3<T, P> & operator++ ();
149 GLM_FUNC_DECL tmat3x3<T, P> & operator-- ();
150 GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
151 GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
152 };
153
154 template <typename T, precision P>
155 GLM_FUNC_DECL tmat3x3<T, P> compute_inverse_mat3(tmat3x3<T, P> const & m);
156
157 // Binary operators
158 template <typename T, precision P>
159 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
160 tmat3x3<T, P> const & m,
161 T const & s);
162
163 template <typename T, precision P>
164 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
165 T const & s,
166 tmat3x3<T, P> const & m);
167
168 template <typename T, precision P>
169 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
170 tmat3x3<T, P> const & m1,
171 tmat3x3<T, P> const & m2);
172
173 template <typename T, precision P>
174 GLM_FUNC_DECL tmat3x3<T, P> operator- (
175 tmat3x3<T, P> const & m,
176 T const & s);
177
178 template <typename T, precision P>
179 GLM_FUNC_DECL tmat3x3<T, P> operator- (
180 T const & s,
181 tmat3x3<T, P> const & m);
182
183 template <typename T, precision P>
184 GLM_FUNC_DECL tmat3x3<T, P> operator- (
185 tmat3x3<T, P> const & m1,
186 tmat3x3<T, P> const & m2);
187
188 template <typename T, precision P>
189 GLM_FUNC_DECL tmat3x3<T, P> operator* (
190 tmat3x3<T, P> const & m,
191 T const & s);
192
193 template <typename T, precision P>
194 GLM_FUNC_DECL tmat3x3<T, P> operator* (
195 T const & s,
196 tmat3x3<T, P> const & m);
197
198 template <typename T, precision P>
199 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator* (
200 tmat3x3<T, P> const & m,
201 typename tmat3x3<T, P>::row_type const & v);
202
203 template <typename T, precision P>
204 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator* (
205 typename tmat3x3<T, P>::col_type const & v,
206 tmat3x3<T, P> const & m);
207
208 template <typename T, precision P>
209 GLM_FUNC_DECL tmat3x3<T, P> operator* (
210 tmat3x3<T, P> const & m1,
211 tmat3x3<T, P> const & m2);
212
213 template <typename T, precision P>
214 GLM_FUNC_DECL tmat2x3<T, P> operator* (
215 tmat3x3<T, P> const & m1,
216 tmat2x3<T, P> const & m2);
217
218 template <typename T, precision P>
219 GLM_FUNC_DECL tmat4x3<T, P> operator* (
220 tmat3x3<T, P> const & m1,
221 tmat4x3<T, P> const & m2);
222
223 template <typename T, precision P>
224 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
225 tmat3x3<T, P> const & m,
226 T const & s);
227
228 template <typename T, precision P>
229 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
230 T const & s,
231 tmat3x3<T, P> const & m);
232
233 template <typename T, precision P>
234 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/ (
235 tmat3x3<T, P> const & m,
236 typename tmat3x3<T, P>::row_type const & v);
237
238 template <typename T, precision P>
239 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/ (
240 typename tmat3x3<T, P>::col_type const & v,
241 tmat3x3<T, P> const & m);
242
243 template <typename T, precision P>
244 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
245 tmat3x3<T, P> const & m1,
246 tmat3x3<T, P> const & m2);
247
248 // Unary constant operators
249 template <typename T, precision P>
250 GLM_FUNC_DECL tmat3x3<T, P> const operator-(
251 tmat3x3<T, P> const & m);
252
253 }//namespace detail
254 }//namespace glm
255
256 #ifndef GLM_EXTERNAL_TEMPLATE
257 #include "type_mat3x3.inl"
258 #endif
259
260 #endif //glm_core_type_mat3x3
glm::length
GLM_FUNC_DECL genType::value_type length(genType const &x)
Returns the length of x, i.e., sqrt(x * x).