| 0.9.6

- Main Page
- Modules
- Files

- File List

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