0.9.6
func_matrix.hpp
Go to the documentation of this file.
1 
44 #pragma once
45 
46 // Dependencies
47 #include "../detail/precision.hpp"
48 #include "../detail/setup.hpp"
49 #include "../detail/type_mat.hpp"
50 #include "../vec2.hpp"
51 #include "../vec3.hpp"
52 #include "../vec4.hpp"
53 #include "../mat2x2.hpp"
54 #include "../mat2x3.hpp"
55 #include "../mat2x4.hpp"
56 #include "../mat3x2.hpp"
57 #include "../mat3x3.hpp"
58 #include "../mat3x4.hpp"
59 #include "../mat4x2.hpp"
60 #include "../mat4x3.hpp"
61 #include "../mat4x4.hpp"
62 
63 namespace glm{
64 namespace detail
65 {
66  template <typename T, precision P>
67  struct outerProduct_trait<T, P, tvec2, tvec2>
68  {
69  typedef tmat2x2<T, P> type;
70  };
71 
72  template <typename T, precision P>
73  struct outerProduct_trait<T, P, tvec2, tvec3>
74  {
75  typedef tmat2x3<T, P> type;
76  };
77 
78  template <typename T, precision P>
79  struct outerProduct_trait<T, P, tvec2, tvec4>
80  {
81  typedef tmat2x4<T, P> type;
82  };
83 
84  template <typename T, precision P>
85  struct outerProduct_trait<T, P, tvec3, tvec2>
86  {
87  typedef tmat3x2<T, P> type;
88  };
89 
90  template <typename T, precision P>
91  struct outerProduct_trait<T, P, tvec3, tvec3>
92  {
93  typedef tmat3x3<T, P> type;
94  };
95 
96  template <typename T, precision P>
97  struct outerProduct_trait<T, P, tvec3, tvec4>
98  {
99  typedef tmat3x4<T, P> type;
100  };
101 
102  template <typename T, precision P>
103  struct outerProduct_trait<T, P, tvec4, tvec2>
104  {
105  typedef tmat4x2<T, P> type;
106  };
107 
108  template <typename T, precision P>
109  struct outerProduct_trait<T, P, tvec4, tvec3>
110  {
111  typedef tmat4x3<T, P> type;
112  };
113 
114  template <typename T, precision P>
115  struct outerProduct_trait<T, P, tvec4, tvec4>
116  {
117  typedef tmat4x4<T, P> type;
118  };
119 
120 }//namespace detail
121 
124 
132  template <typename T, precision P, template <typename, precision> class matType>
133  GLM_FUNC_DECL matType<T, P> matrixCompMult(matType<T, P> const & x, matType<T, P> const & y);
134 
143  template <typename T, precision P, template <typename, precision> class vecTypeA, template <typename, precision> class vecTypeB>
144  GLM_FUNC_DECL typename detail::outerProduct_trait<T, P, vecTypeA, vecTypeB>::type outerProduct(vecTypeA<T, P> const & c, vecTypeB<T, P> const & r);
145 
152 # if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2012))
153  template <typename T, precision P, template <typename, precision> class matType>
154  GLM_FUNC_DECL typename matType<T, P>::transpose_type transpose(matType<T, P> const & x);
155 # endif
156 
163  template <typename T, precision P, template <typename, precision> class matType>
164  GLM_FUNC_DECL T determinant(matType<T, P> const & m);
165 
172  template <typename T, precision P, template <typename, precision> class matType>
173  GLM_FUNC_DECL matType<T, P> inverse(matType<T, P> const & m);
174 
176 }//namespace glm
177 
178 #include "func_matrix.inl"
GLM_FUNC_DECL detail::outerProduct_trait< T, P, vecTypeA, vecTypeB >::type outerProduct(vecTypeA< T, P > const &c, vecTypeB< T, P > const &r)
Treats the first parameter c as a column vector and the second parameter r as a row vector and does a...
Definition: _noise.hpp:39
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)
Return the inverse of a squared matrix.
GLM_FUNC_DECL matType< T, P > matrixCompMult(matType< T, P > const &x, matType< T, P > const &y)
Multiply matrix x by matrix y component-wise, i.e., result[i][j] is the scalar product of x[i][j] and...
GLM_FUNC_DECL T determinant(matType< T, P > const &m)
Returns the transposed matrix of x.