GLM 0.9.5

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

- File List

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