simd_mat4.hpp
Go to the documentation of this file.
1 
38 #pragma once
39 
40 // Dependencies
41 #include "../detail/setup.hpp"
42 
43 #if(GLM_ARCH != GLM_ARCH_PURE)
44 
45 #if(GLM_ARCH & GLM_ARCH_SSE2)
46 # include "../detail/intrinsic_matrix.hpp"
47 # include "../gtx/simd_vec4.hpp"
48 #else
49 # error "GLM: GLM_GTX_simd_mat4 requires compiler support of SSE2 through intrinsics"
50 #endif
51 
52 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
53 # pragma message("GLM: GLM_GTX_simd_mat4 extension included")
54 #endif
55 
56 namespace glm{
57 namespace detail
58 {
61  GLM_ALIGNED_STRUCT(16) fmat4x4SIMD
62  {
63  enum ctor{_null};
64  typedef float value_type;
65  typedef fvec4SIMD col_type;
66  typedef fvec4SIMD row_type;
67  typedef std::size_t size_type;
68  typedef fmat4x4SIMD type;
69  typedef fmat4x4SIMD transpose_type;
70 
72 
73  fvec4SIMD Data[4];
74 
76  // Constructors
77 
78  fmat4x4SIMD();
79  explicit fmat4x4SIMD(float const & s);
80  explicit fmat4x4SIMD(
81  float const & x0, float const & y0, float const & z0, float const & w0,
82  float const & x1, float const & y1, float const & z1, float const & w1,
83  float const & x2, float const & y2, float const & z2, float const & w2,
84  float const & x3, float const & y3, float const & z3, float const & w3);
85  explicit fmat4x4SIMD(
86  fvec4SIMD const & v0,
87  fvec4SIMD const & v1,
88  fvec4SIMD const & v2,
89  fvec4SIMD const & v3);
90  explicit fmat4x4SIMD(
91  mat4x4 const & m);
92  explicit fmat4x4SIMD(
93  __m128 const in[4]);
94 
95  // Conversions
96  //template <typename U>
97  //explicit tmat4x4(tmat4x4<U> const & m);
98 
99  //explicit tmat4x4(tmat2x2<T> const & x);
100  //explicit tmat4x4(tmat3x3<T> const & x);
101  //explicit tmat4x4(tmat2x3<T> const & x);
102  //explicit tmat4x4(tmat3x2<T> const & x);
103  //explicit tmat4x4(tmat2x4<T> const & x);
104  //explicit tmat4x4(tmat4x2<T> const & x);
105  //explicit tmat4x4(tmat3x4<T> const & x);
106  //explicit tmat4x4(tmat4x3<T> const & x);
107 
108  // Accesses
109  fvec4SIMD & operator[](length_t i);
110  fvec4SIMD const & operator[](length_t i) const;
111 
112  // Unary updatable operators
113  fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
114  fmat4x4SIMD & operator+= (float const & s);
115  fmat4x4SIMD & operator+= (fmat4x4SIMD const & m);
116  fmat4x4SIMD & operator-= (float const & s);
117  fmat4x4SIMD & operator-= (fmat4x4SIMD const & m);
118  fmat4x4SIMD & operator*= (float const & s);
119  fmat4x4SIMD & operator*= (fmat4x4SIMD const & m);
120  fmat4x4SIMD & operator/= (float const & s);
121  fmat4x4SIMD & operator/= (fmat4x4SIMD const & m);
122  fmat4x4SIMD & operator++ ();
123  fmat4x4SIMD & operator-- ();
124  };
125 
126  // Binary operators
127  fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s);
128  fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m);
129  fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
130 
131  fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s);
132  fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m);
133  fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
134 
135  fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s);
136  fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m);
137 
138  fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v);
139  fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m);
140 
141  fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
142 
143  fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s);
144  fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m);
145 
146  fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v);
147  fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m);
148 
149  fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
150 
151  // Unary constant operators
152  fmat4x4SIMD const operator- (fmat4x4SIMD const & m);
153  fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int);
154  fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int);
155 }//namespace detail
156 
157  typedef detail::fmat4x4SIMD simdMat4;
158 
161 
164  mat4 mat4_cast(
165  detail::fmat4x4SIMD const & x);
166 
170  detail::fmat4x4SIMD matrixCompMult(
171  detail::fmat4x4SIMD const & x,
172  detail::fmat4x4SIMD const & y);
173 
178  detail::fmat4x4SIMD outerProduct(
179  detail::fvec4SIMD const & c,
180  detail::fvec4SIMD const & r);
181 
184  detail::fmat4x4SIMD transpose(
185  detail::fmat4x4SIMD const & x);
186 
189  float determinant(
190  detail::fmat4x4SIMD const & m);
191 
194  detail::fmat4x4SIMD inverse(
195  detail::fmat4x4SIMD const & m);
196 
198 }// namespace glm
199 
200 #include "simd_mat4.inl"
201 
202 #endif//(GLM_ARCH != GLM_ARCH_PURE)
int length_t
Definition: setup.hpp:755
GLM_FUNC_DECL matType< T, P > matrixCompMult(matType< T, P > const &x, matType< T, P > const &y)
highp_mat4x4 mat4x4
Definition: type_mat.hpp:424
#define GLM_ALIGNED_STRUCT(x)
Definition: setup.hpp:793
GLM_FUNC_DECL T determinant(matType< T, P > const &m)
GLM_FUNC_DECL tmat2x2< T, P > operator*(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator+(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator/(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL tmat2x2< T, P > operator-(tmat2x2< T, P > const &m, T const &s)
GLM_FUNC_DECL detail::tmat4x4< T, P > mat4_cast(detail::tquat< T, P > const &x)
mat4x4 mat4
Definition: type_mat.hpp:441
GLM_FUNC_DECL genType::value_type length(genType const &x)
#define GLM_FUNC_DECL
Definition: setup.hpp:728
GLM_FUNC_DECL matType< T, P > inverse(matType< T, P > const &m)
GLM_FUNC_DECL detail::outerProduct_trait< T, P, vecTypeA, vecTypeB >::type outerProduct(vecTypeA< T, P > const &c, vecTypeB< T, P > const &r)


rtabmap
Author(s): Mathieu Labbe
autogenerated on Mon Dec 14 2020 03:35:00