# GLM: simd_mat4.hpp Source File

- Main Page
- Namespaces
- Files

- File List

# simd_mat4.hpp

    00001
    00002 // OpenGL Mathematics Copyright (c) 2005 - 2009 G-Truc Creation (www.g-truc.net)
    00004 // Created : 2009-05-07
    00005 // Updated : 2009-05-07
    00006 // Licence : This source is under MIT License
    00007 // File    : glm/gtx/simd_vec4.hpp
    00009 // Dependency:
    00010 // - GLM core
    00011 // - intrinsic
    00013
    00014 #ifndef glm_gtx_simd_mat4
    00015 #define glm_gtx_simd_mat4
    00016
    00017 // Dependency:
    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                         // Constructors
    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                         // Conversions
    00065                         //template <typename U>
    00066                         //explicit tmat4x4(tmat4x4<U> const & m);
    00067
    00068                         //explicit tmat4x4(tmat2x2<T> const & x);
    00069                         //explicit tmat4x4(tmat3x3<T> const & x);
    00070                         //explicit tmat4x4(tmat2x3<T> const & x);
    00071                         //explicit tmat4x4(tmat3x2<T> const & x);
    00072                         //explicit tmat4x4(tmat2x4<T> const & x);
    00073                         //explicit tmat4x4(tmat4x2<T> const & x);
    00074                         //explicit tmat4x4(tmat3x4<T> const & x);
    00075                         //explicit tmat4x4(tmat4x3<T> const & x);
    00076
    00077                         // Accesses
    00078                         fvec4SIMD & operator[](size_type i);
    00079                         fvec4SIMD const & operator[](size_type i) const;
    00080
    00081                         // Unary updatable operators
    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                 // Binary operators
    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                 // Unary constant operators
    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         }//namespace detail
    00126
    00127         namespace gtx{
    00129         namespace simd_mat4
    00130         {
    00131                 typedef detail::fmat4SIMD mat4SIMD;
    00132
    00133         }//namespace simd_mat4
    00134         }//namespace gtx
    00135 }//namespace glm
    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