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 #include <xmmintrin.h>
00020 #include <emmintrin.h>
00021
00022 namespace glm
00023 {
00024 namespace detail
00025 {
00026 GLM_ALIGN(16) struct fmat4x4SIMD
00027 {
00028 static __m128 one;
00029
00030 enum no_init
00031 {
00032 NO_INIT
00033 };
00034
00035 typedef float value_type;
00036 typedef fvec4SIMD col_type;
00037 typedef fvec4SIMD row_type;
00038 typedef glm::sizeType size_type;
00039 static size_type value_size();
00040 static size_type col_size();
00041 static size_type row_size();
00042 static bool is_matrix();
00043
00044 fvec4SIMD Data[4];
00045
00047
00048
00049 fmat4x4SIMD();
00050 explicit fmat4x4SIMD(float const & s);
00051 explicit fmat4x4SIMD(
00052 float const & x0, float const & y0, float const & z0, float const & w0,
00053 float const & x1, float const & y1, float const & z1, float const & w1,
00054 float const & x2, float const & y2, float const & z2, float const & w2,
00055 float const & x3, float const & y3, float const & z3, float const & w3);
00056 explicit fmat4x4SIMD(
00057 fvec4SIMD const & v0,
00058 fvec4SIMD const & v1,
00059 fvec4SIMD const & v2,
00060 fvec4SIMD const & v3);
00061 explicit fmat4x4SIMD(
00062 tmat4x4 const & m);
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078 fvec4SIMD & operator[](size_type i);
00079 fvec4SIMD const & operator[](size_type i) const;
00080
00081
00082 fmat4x4SIMD & operator= (fmat4x4SIMD const & m);
00083 fmat4x4SIMD & operator+= (float const & s);
00084 fmat4x4SIMD & operator+= (fmat4x4SIMD const & m);
00085 fmat4x4SIMD & operator-= (float const & s);
00086 fmat4x4SIMD & operator-= (fmat4x4SIMD const & m);
00087 fmat4x4SIMD & operator*= (float const & s);
00088 fmat4x4SIMD & operator*= (fmat4x4SIMD const & m);
00089 fmat4x4SIMD & operator/= (float const & s);
00090 fmat4x4SIMD & operator/= (fmat4x4SIMD const & m);
00091 fmat4x4SIMD & operator++ ();
00092 fmat4x4SIMD & operator-- ();
00093 };
00094
00095
00096 fmat4x4SIMD operator+ (fmat4x4SIMD const & m, float const & s);
00097 fmat4x4SIMD operator+ (float const & s, fmat4x4SIMD const & m);
00098 fmat4x4SIMD operator+ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00099
00100 fmat4x4SIMD operator- (fmat4x4SIMD const & m, float const & s);
00101 fmat4x4SIMD operator- (float const & s, fmat4x4SIMD const & m);
00102 fmat4x4SIMD operator- (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00103
00104 fmat4x4SIMD operator* (fmat4x4SIMD const & m, float const & s);
00105 fmat4x4SIMD operator* (float const & s, fmat4x4SIMD const & m);
00106
00107 fvec4SIMD operator* (fmat4x4SIMD const & m, fvec4SIMD const & v);
00108 fvec4SIMD operator* (fvec4SIMD const & v, fmat4x4SIMD const & m);
00109
00110 fmat4x4SIMD operator* (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00111
00112 fmat4x4SIMD operator/ (fmat4x4SIMD const & m, float const & s);
00113 fmat4x4SIMD operator/ (float const & s, fmat4x4SIMD const & m);
00114
00115 fvec4SIMD operator/ (fmat4x4SIMD const & m, fvec4SIMD const & v);
00116 fvec4SIMD operator/ (fvec4SIMD const & v, fmat4x4SIMD const & m);
00117
00118 fmat4x4SIMD operator/ (fmat4x4SIMD const & m1, fmat4x4SIMD const & m2);
00119
00120
00121 fmat4x4SIMD const operator- (fmat4x4SIMD const & m);
00122 fmat4x4SIMD const operator-- (fmat4x4SIMD const & m, int);
00123 fmat4x4SIMD const operator++ (fmat4x4SIMD const & m, int);
00124
00125 }
00126
00127 namespace gtx{
00129 namespace simd_mat4
00130 {
00131 typedef detail::fmat4SIMD mat4SIMD;
00132
00133 }
00134 }
00135 }
00136
00137 #define GLM_GTX_simd_mat4 namespace gtx::simd_mat4;
00138 #ifndef GLM_GTX_GLOBAL
00139 namespace glm {using GLM_GTX_simd_mat4;}
00140 #endif//GLM_GTX_GLOBAL
00141
00142 #include "simd_mat4.inl"
00143
00144 #endif//glm_gtx_simd_mat4