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 tmat3x3<U, Q> inverse(tmat3x3<U, Q> const & m);
55 template <typename U, precision Q>
56 friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
57 template <typename U, precision Q>
58 friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m);
59
60 private:
62 col_type value[3];
63
64 GLM_FUNC_DECL tmat3x3<T, P> _inverse() const;
66
67 public:
68 // Constructors
69 GLM_FUNC_DECL tmat3x3();
70 GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m);
71 template <precision Q>
72 GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
73
74 GLM_FUNC_DECL explicit tmat3x3(
75 ctor Null);
76 GLM_FUNC_DECL explicit tmat3x3(
77 T const & s);
78 GLM_FUNC_DECL explicit tmat3x3(
79 T const & x0, T const & y0, T const & z0,
80 T const & x1, T const & y1, T const & z1,
81 T const & x2, T const & y2, T const & z2);
82 GLM_FUNC_DECL explicit tmat3x3(
83 col_type const & v0,
84 col_type const & v1,
85 col_type const & v2);
86
87 #if(GLM_HAS_INITIALIZER_LISTS)
88 template <typename U>
89 GLM_FUNC_DECL tmat3x3(std::initializer_list<U> m);
90
91 GLM_FUNC_DECL tmat3x3(std::initializer_list<tvec3<T, P> > m);
92 #endif//GLM_HAS_INITIALIZER_LISTS
93
95 // Conversions
96 template <typename U>
97 GLM_FUNC_DECL explicit tmat3x3(
98 U const & x);
99
100 template<
101 typename X1, typename Y1, typename Z1,
102 typename X2, typename Y2, typename Z2,
103 typename X3, typename Y3, typename Z3>
104 GLM_FUNC_DECL explicit tmat3x3(
105 X1 const & x1, Y1 const & y1, Z1 const & z1,
106 X2 const & x2, Y2 const & y2, Z2 const & z2,
107 X3 const & x3, Y3 const & y3, Z3 const & z3);
108
109 template <typename V1, typename V2, typename V3>
110 GLM_FUNC_DECL explicit tmat3x3(
111 tvec3<V1, P> const & v1,
112 tvec3<V2, P> const & v2,
113 tvec3<V3, P> const & v3);
114
115 // Matrix conversions
116 template <typename U, precision Q>
117 GLM_FUNC_DECL explicit tmat3x3(tmat3x3<U, Q> const & m);
118
119 GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
120 GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
121 GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x);
122 GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x);
123 GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x);
124 GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x);
125 GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
126 GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
127
128 // Accesses
129 GLM_FUNC_DECL col_type & operator[](length_t i);
130 GLM_FUNC_DECL col_type const & operator[](length_t i) const;
131
132 // Unary updatable operators
133 GLM_FUNC_DECL tmat3x3<T, P>& operator= (tmat3x3<T, P> const & m);
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 template <typename U>
145 GLM_FUNC_DECL tmat3x3<T, P>& operator*= (U s);
146 template <typename U>
147 GLM_FUNC_DECL tmat3x3<T, P>& operator*= (tmat3x3<U, P> const & m);
148 template <typename U>
149 GLM_FUNC_DECL tmat3x3<T, P>& operator/= (U s);
150 template <typename U>
151 GLM_FUNC_DECL tmat3x3<T, P>& operator/= (tmat3x3<U, P> const & m);
152
154 // Increment and decrement operators
155
156 GLM_FUNC_DECL tmat3x3<T, P> & operator++ ();
157 GLM_FUNC_DECL tmat3x3<T, P> & operator-- ();
158 GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
159 GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
160 };
161
162 // Binary operators
163 template <typename T, precision P>
164 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
165 tmat3x3<T, P> const & m,
166 T const & s);
167
168 template <typename T, precision P>
169 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
170 T const & s,
171 tmat3x3<T, P> const & m);
172
173 template <typename T, precision P>
174 GLM_FUNC_DECL tmat3x3<T, P> operator+ (
175 tmat3x3<T, P> const & m1,
176 tmat3x3<T, P> const & m2);
177
178 template <typename T, precision P>
179 GLM_FUNC_DECL tmat3x3<T, P> operator- (
180 tmat3x3<T, P> const & m,
181 T const & s);
182
183 template <typename T, precision P>
184 GLM_FUNC_DECL tmat3x3<T, P> operator- (
185 T const & s,
186 tmat3x3<T, P> const & m);
187
188 template <typename T, precision P>
189 GLM_FUNC_DECL tmat3x3<T, P> operator- (
190 tmat3x3<T, P> const & m1,
191 tmat3x3<T, P> const & m2);
192
193 template <typename T, precision P>
194 GLM_FUNC_DECL tmat3x3<T, P> operator* (
195 tmat3x3<T, P> const & m,
196 T const & s);
197
198 template <typename T, precision P>
199 GLM_FUNC_DECL tmat3x3<T, P> operator* (
200 T const & s,
201 tmat3x3<T, P> const & m);
202
203 template <typename T, precision P>
204 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator* (
205 tmat3x3<T, P> const & m,
206 typename tmat3x3<T, P>::row_type const & v);
207
208 template <typename T, precision P>
209 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator* (
210 typename tmat3x3<T, P>::col_type const & v,
211 tmat3x3<T, P> const & m);
212
213 template <typename T, precision P>
214 GLM_FUNC_DECL tmat3x3<T, P> operator* (
215 tmat3x3<T, P> const & m1,
216 tmat3x3<T, P> const & m2);
217
218 template <typename T, precision P>
219 GLM_FUNC_DECL tmat2x3<T, P> operator* (
220 tmat3x3<T, P> const & m1,
221 tmat2x3<T, P> const & m2);
222
223 template <typename T, precision P>
224 GLM_FUNC_DECL tmat4x3<T, P> operator* (
225 tmat3x3<T, P> const & m1,
226 tmat4x3<T, P> const & m2);
227
228 template <typename T, precision P>
229 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
230 tmat3x3<T, P> const & m,
231 T const & s);
232
233 template <typename T, precision P>
234 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
235 T const & s,
236 tmat3x3<T, P> const & m);
237
238 template <typename T, precision P>
239 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/ (
240 tmat3x3<T, P> const & m,
241 typename tmat3x3<T, P>::row_type const & v);
242
243 template <typename T, precision P>
244 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/ (
245 typename tmat3x3<T, P>::col_type const & v,
246 tmat3x3<T, P> const & m);
247
248 template <typename T, precision P>
249 GLM_FUNC_DECL tmat3x3<T, P> operator/ (
250 tmat3x3<T, P> const & m1,
251 tmat3x3<T, P> const & m2);
252
253 // Unary constant operators
254 template <typename T, precision P>
255 GLM_FUNC_DECL tmat3x3<T, P> const operator-(
256 tmat3x3<T, P> const & m);
257
258 }//namespace detail
259 }//namespace glm
260
261 #ifndef GLM_EXTERNAL_TEMPLATE
262 #include "type_mat3x3.inl"
263 #endif
264
265 #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).
glm::inverse
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)
Return the inverse of a squared matrix.