00001
00002
00004
00005
00006
00007
00009
00010
00011
00013
00014 #ifndef glm_gtx_simd_mat4
00015 #define glm_gtx_simd_mat4
00016
00017
00018 #include "../glm.hpp"
00019
00020 #if(GLM_ARCH & GLM_ARCH_SSE2)
00021 # include "../core/intrinsic_matrix.hpp"
00022 # include "../gtx/simd_vec4.hpp"
00023 #else
00024 # error "GLM: GLM_GTX_simd_mat4 requires compiler support of SSE2 through intrinsics"
00025 #endif
00026
00027 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00028 # pragma message("GLM: GLM_GTX_simd_mat4 extension included")
00029 #endif
00030
00031 namespace glm
00032 {
00033 namespace detail
00034 {
00037 GLM_ALIGNED_STRUCT(16) fmat4x4SIMD
00038 {
00039 enum ctor{null};
00040
00041 typedef float value_type;
00042 typedef fvec4SIMD col_type;
00043 typedef fvec4SIMD row_type;
00044 typedef std::size_t size_type;
00045 static size_type value_size();
00046 static size_type col_size();
00047 static size_type row_size();
00048 static bool is_matrix();
00049
00050 fvec4SIMD Data[4];
00051
00053
00054
00055 fmat4x4SIMD();
00056 explicit fmat4x4SIMD(float const & s);
00057 explicit fmat4x4SIMD(
00058 float const & x0, float const & y0, float const & z0, float const & w0,
00059 float const & x1, float const & y1, float const & z1, float const & w1,
00060 float const & x2, float const & y2, float const & z2, float const & w2,
00061 float const & x3, float const & y3, float const & z3, float const & w3);
00062 explicit fmat4x4SIMD(
00063 fvec4SIMD const & v0,
00064 fvec4SIMD const & v1,
00065 fvec4SIMD const & v2,
00066 fvec4SIMD const & v3);
00067 explicit fmat4x4SIMD(
00068 tmat4x4<float> const & m);
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084 fvec4SIMD & operator[](size_type i);
00085 fvec4SIMD const & operator[](size_type i) const;
00086
00087
00088 fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
00089 fmat4x4SIMD & operator+= (float const & s);
00090 fmat4x4SIMD & operator+= (fmat4x4SIMD const & m);
00091 fmat4x4SIMD & operator-= (float const & s);
00092 fmat4x4SIMD & operator-= (fmat4x4SIMD const & m);
00093 fmat4x4SIMD & operator*= (float const & s);
00094 fmat4x4SIMD & operator*= (fmat4x4SIMD const & m);
00095 fmat4x4SIMD & operator/= (float const & s);
00096 fmat4x4SIMD & operator/= (fmat4x4SIMD const & m);
00097 fmat4x4SIMD & operator++ ();
00098 fmat4x4SIMD & operator-- ();
00099 };
00100
00101
00102 fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s);
00103 fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m);
00104 fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00105
00106 fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s);
00107 fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m);
00108 fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00109
00110 fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s);
00111 fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m);
00112
00113 fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v);
00114 fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m);
00115
00116 fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00117
00118 fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s);
00119 fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m);
00120
00121 fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v);
00122 fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m);
00123
00124 fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00125
00126
00127 fmat4x4SIMD const operator- (fmat4x4SIMD const & m);
00128 fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int);
00129 fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int);
00130
00131 }
00132
00133 namespace gtx{
00135 namespace simd_mat4
00136 {
00137 typedef detail::fmat4x4SIMD simdMat4;
00138
00141
00144 detail::tmat4x4<float> mat4_cast(
00145 detail::fmat4x4SIMD const & x);
00146
00150 detail::fmat4x4SIMD matrixCompMult(
00151 detail::fmat4x4SIMD const & x,
00152 detail::fmat4x4SIMD const & y);
00153
00158 detail::fmat4x4SIMD outerProduct(
00159 detail::fvec4SIMD const & c,
00160 detail::fvec4SIMD const & r);
00161
00164 detail::fmat4x4SIMD transpose(
00165 detail::fmat4x4SIMD const & x);
00166
00169 float determinant(
00170 detail::fmat4x4SIMD const & m);
00171
00174 detail::fmat4x4SIMD inverse(
00175 detail::fmat4x4SIMD const & m);
00176
00178
00179 }
00180 }
00181 }
00182
00183 #include "simd_mat4.inl"
00184
00185 namespace glm{using namespace gtx::simd_mat4;}
00186
00187 #endif//glm_gtx_simd_mat4