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