0.9.7: type_mat3x3.hpp Source File

| 0.9.7

- Main Page
- Modules
- Files

- File List

type_mat3x3.hpp
Go to the documentation of this file.
1
33 #pragma once
34
35 #include "../fwd.hpp"
36 #include "type_vec3.hpp"
37 #include "type_mat.hpp"
38 #include <limits>
39 #include <cstddef>
40
41 namespace glm
42 {
43 template <typename T, precision P = defaultp>
44 struct tmat3x3
45 {
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 typedef T value_type;
51
52 # ifdef GLM_META_PROG_HELPERS
53 static GLM_RELAXED_CONSTEXPR length_t components = 3;
54 static GLM_RELAXED_CONSTEXPR length_t cols = 3;
55 static GLM_RELAXED_CONSTEXPR length_t rows = 3;
56 static GLM_RELAXED_CONSTEXPR precision prec = P;
57 # endif//GLM_META_PROG_HELPERS
58
59 template <typename U, precision Q>
60 friend tvec3<U, Q> operator/(tmat3x3<U, Q> const & m, tvec3<U, Q> const & v);
61 template <typename U, precision Q>
62 friend tvec3<U, Q> operator/(tvec3<U, Q> const & v, tmat3x3<U, Q> const & m);
63
64 private:
65 col_type value[3];
66
67 public:
68 // -- Constructors --
69
70 GLM_FUNC_DECL tmat3x3() GLM_DEFAULT_CTOR;
71 GLM_FUNC_DECL tmat3x3(tmat3x3<T, P> const & m) GLM_DEFAULT;
72 template <precision Q>
73 GLM_FUNC_DECL tmat3x3(tmat3x3<T, Q> const & m);
74
75 GLM_FUNC_DECL explicit tmat3x3(ctor);
76 GLM_FUNC_DECL explicit tmat3x3(T const & s);
77 GLM_FUNC_DECL tmat3x3(
78 T const & x0, T const & y0, T const & z0,
79 T const & x1, T const & y1, T const & z1,
80 T const & x2, T const & y2, T const & z2);
81 GLM_FUNC_DECL tmat3x3(
82 col_type const & v0,
83 col_type const & v1,
84 col_type const & v2);
85
86 // -- Conversions --
87
88 template<
89 typename X1, typename Y1, typename Z1,
90 typename X2, typename Y2, typename Z2,
91 typename X3, typename Y3, typename Z3>
92 GLM_FUNC_DECL tmat3x3(
93 X1 const & x1, Y1 const & y1, Z1 const & z1,
94 X2 const & x2, Y2 const & y2, Z2 const & z2,
95 X3 const & x3, Y3 const & y3, Z3 const & z3);
96
97 template <typename V1, typename V2, typename V3>
98 GLM_FUNC_DECL tmat3x3(
99 tvec3<V1, P> const & v1,
100 tvec3<V2, P> const & v2,
101 tvec3<V3, P> const & v3);
102
103 // -- Matrix conversions --
104
105 template <typename U, precision Q>
106 GLM_FUNC_DECL GLM_EXPLICIT tmat3x3(tmat3x3<U, Q> const & m);
107
108 GLM_FUNC_DECL explicit tmat3x3(tmat2x2<T, P> const & x);
109 GLM_FUNC_DECL explicit tmat3x3(tmat4x4<T, P> const & x);
110 GLM_FUNC_DECL explicit tmat3x3(tmat2x3<T, P> const & x);
111 GLM_FUNC_DECL explicit tmat3x3(tmat3x2<T, P> const & x);
112 GLM_FUNC_DECL explicit tmat3x3(tmat2x4<T, P> const & x);
113 GLM_FUNC_DECL explicit tmat3x3(tmat4x2<T, P> const & x);
114 GLM_FUNC_DECL explicit tmat3x3(tmat3x4<T, P> const & x);
115 GLM_FUNC_DECL explicit tmat3x3(tmat4x3<T, P> const & x);
116
117 // -- Accesses --
118
119 # ifdef GLM_FORCE_SIZE_FUNC
120 typedef size_t size_type;
121 GLM_FUNC_DECL GLM_CONSTEXPR size_t size() const;
122
123 GLM_FUNC_DECL col_type & operator[](size_type i);
124 GLM_FUNC_DECL col_type const & operator[](size_type i) const;
125 # else
126 typedef length_t length_type;
127 GLM_FUNC_DECL GLM_CONSTEXPR length_type length() const;
128
129 GLM_FUNC_DECL col_type & operator[](length_type i);
130 GLM_FUNC_DECL col_type const & operator[](length_type i) const;
131 # endif//GLM_FORCE_SIZE_FUNC
132
133 // -- Unary arithmetic operators --
134
135 GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<T, P> const & m) GLM_DEFAULT;
136
137 template <typename U>
138 GLM_FUNC_DECL tmat3x3<T, P> & operator=(tmat3x3<U, P> const & m);
139 template <typename U>
140 GLM_FUNC_DECL tmat3x3<T, P> & operator+=(U s);
141 template <typename U>
142 GLM_FUNC_DECL tmat3x3<T, P> & operator+=(tmat3x3<U, P> const & m);
143 template <typename U>
144 GLM_FUNC_DECL tmat3x3<T, P> & operator-=(U s);
145 template <typename U>
146 GLM_FUNC_DECL tmat3x3<T, P> & operator-=(tmat3x3<U, P> const & m);
147 template <typename U>
148 GLM_FUNC_DECL tmat3x3<T, P> & operator*=(U s);
149 template <typename U>
150 GLM_FUNC_DECL tmat3x3<T, P> & operator*=(tmat3x3<U, P> const & m);
151 template <typename U>
152 GLM_FUNC_DECL tmat3x3<T, P> & operator/=(U s);
153 template <typename U>
154 GLM_FUNC_DECL tmat3x3<T, P> & operator/=(tmat3x3<U, P> const & m);
155
156 // -- Increment and decrement operators --
157
158 GLM_FUNC_DECL tmat3x3<T, P> & operator++();
159 GLM_FUNC_DECL tmat3x3<T, P> & operator--();
160 GLM_FUNC_DECL tmat3x3<T, P> operator++(int);
161 GLM_FUNC_DECL tmat3x3<T, P> operator--(int);
162 };
163
164 // -- Unary operators --
165
166 template <typename T, precision P>
167 GLM_FUNC_DECL tmat3x3<T, P> const operator-(tmat3x3<T, P> const & m);
168
169 // -- Binary operators --
170
171 template <typename T, precision P>
172 GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m, T const & s);
173
174 template <typename T, precision P>
175 GLM_FUNC_DECL tmat3x3<T, P> operator+(T const & s, tmat3x3<T, P> const & m);
176
177 template <typename T, precision P>
178 GLM_FUNC_DECL tmat3x3<T, P> operator+(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
179
180 template <typename T, precision P>
181 GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m, T const & s);
182
183 template <typename T, precision P>
184 GLM_FUNC_DECL tmat3x3<T, P> operator-(T const & s, tmat3x3<T, P> const & m);
185
186 template <typename T, precision P>
187 GLM_FUNC_DECL tmat3x3<T, P> operator-(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
188
189 template <typename T, precision P>
190 GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m, T const & s);
191
192 template <typename T, precision P>
193 GLM_FUNC_DECL tmat3x3<T, P> operator*(T const & s, tmat3x3<T, P> const & m);
194
195 template <typename T, precision P>
196 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator*(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
197
198 template <typename T, precision P>
199 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator*(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
200
201 template <typename T, precision P>
202 GLM_FUNC_DECL tmat3x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
203
204 template <typename T, precision P>
205 GLM_FUNC_DECL tmat2x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat2x3<T, P> const & m2);
206
207 template <typename T, precision P>
208 GLM_FUNC_DECL tmat4x3<T, P> operator*(tmat3x3<T, P> const & m1, tmat4x3<T, P> const & m2);
209
210 template <typename T, precision P>
211 GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m, T const & s);
212
213 template <typename T, precision P>
214 GLM_FUNC_DECL tmat3x3<T, P> operator/(T const & s, tmat3x3<T, P> const & m);
215
216 template <typename T, precision P>
217 GLM_FUNC_DECL typename tmat3x3<T, P>::col_type operator/(tmat3x3<T, P> const & m, typename tmat3x3<T, P>::row_type const & v);
218
219 template <typename T, precision P>
220 GLM_FUNC_DECL typename tmat3x3<T, P>::row_type operator/(typename tmat3x3<T, P>::col_type const & v, tmat3x3<T, P> const & m);
221
222 template <typename T, precision P>
223 GLM_FUNC_DECL tmat3x3<T, P> operator/(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
224
225 // -- Boolean operators --
226
227 template <typename T, precision P>
228 GLM_FUNC_DECL bool operator==(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
229
230 template <typename T, precision P>
231 GLM_FUNC_DECL bool operator!=(tmat3x3<T, P> const & m1, tmat3x3<T, P> const & m2);
232 }//namespace glm
233
234 #ifndef GLM_EXTERNAL_TEMPLATE
235 #include "type_mat3x3.inl"
236 #endif
type_vec3.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:40
type_mat.hpp
OpenGL Mathematics (glm.g-truc.net)