# GLM: simd_vec4.hpp Source File

- Main Page
- Namespaces
- Files

- File List

# simd_vec4.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_vec4
    00015 #define glm_gtx_simd_vec4
    00016
    00017 // Dependency:
    00018 #include "../glm.hpp"
    00019 #include "../core/intrinsic_common.hpp"
    00020
    00021 namespace glm
    00022 {
    00023         namespace detail
    00024         {
    00025                 GLM_ALIGN(4) struct fvec4SIMD
    00026                 {
    00027                         static __m128 one;
    00028
    00029                         union
    00030                         {
    00031                                 __m128 Data;
    00032                                 struct{float x, y, z, w;};
    00033                                 float array[4];
    00034                         };
    00035
    00037                         // Implicit basic constructors
    00038
    00039                         fvec4SIMD();
    00040                         fvec4SIMD(__m128 const & Data);
    00041                         fvec4SIMD(fvec4SIMD const & v);
    00042                         fvec4SIMD(tvec4<float> const & v);
    00043
    00045                         // Explicit basic constructors
    00046
    00047                         fvec4SIMD(float const & s);
    00048                         fvec4SIMD(float const & x, float const & y, float const & z, float const & w);
    00049                         fvec4SIMD(float const v[4]);
    00050
    00053
    00054                         //fvec4SIMD(ref4<float> const & r);
    00055
    00058
    00059                         fvec4SIMD(vec2 const & v, float const & s1, float const & s2);
    00060                         fvec4SIMD(float const & s1, vec2 const & v, float const & s2);
    00061                         fvec4SIMD(float const & s1, float const & s2, vec2 const & v);
    00062                         fvec4SIMD(vec3 const & v, float const & s);
    00063                         fvec4SIMD(float const & s, vec3 const & v);
    00064                         fvec4SIMD(vec2 const & v1, vec2 const & v2);
    00065                         //fvec4SIMD(ivec4SIMD const & v);
    00066
    00068                         // Unary arithmetic operators
    00069
    00070                         fvec4SIMD& operator= (fvec4SIMD const & v);
    00071                         fvec4SIMD& operator+=(fvec4SIMD const & v);
    00072                         fvec4SIMD& operator-=(fvec4SIMD const & v);
    00073                         fvec4SIMD& operator*=(fvec4SIMD const & v);
    00074                         fvec4SIMD& operator/=(fvec4SIMD const & v);
    00075
    00076                         fvec4SIMD& operator+=(float const & s);
    00077                         fvec4SIMD& operator-=(float const & s);
    00078                         fvec4SIMD& operator*=(float const & s);
    00079                         fvec4SIMD& operator/=(float const & s);
    00080
    00081                         fvec4SIMD& operator++();
    00082                         fvec4SIMD& operator--();
    00083
    00086
    00087                         //fvec4SIMD& operator%= (float s);
    00088                         //fvec4SIMD& operator%= (fvec4SIMD const & v);
    00089                         //fvec4SIMD& operator&= (float s);
    00090                         //fvec4SIMD& operator&= (fvec4SIMD const & v);
    00091                         //fvec4SIMD& operator|= (float s);
    00092                         //fvec4SIMD& operator|= (fvec4SIMD const & v);
    00093                         //fvec4SIMD& operator^= (float s);
    00094                         //fvec4SIMD& operator^= (fvec4SIMD const & v);
    00095                         //fvec4SIMD& operator<<=(float s);
    00096                         //fvec4SIMD& operator<<=(fvec4SIMD const & v);
    00097                         //fvec4SIMD& operator>>=(float s);
    00098                         //fvec4SIMD& operator>>=(fvec4SIMD const & v);
    00099
    00101                         // Swizzle operators
    00102
    00103                         //float swizzle(comp X) const;
    00104                         //vec2 const swizzle(comp X, comp Y) const;
    00105                         //vec3 const swizzle(comp X, comp Y, comp Z) const;
    00106                         //fvec4SIMD const swizzle(comp X, comp Y, comp Z, comp W) const;
    00107                         //fvec4SIMD const swizzle(int X, int Y, int Z, int W) const;
    00108                         //ref4<float> swizzle(comp X, comp Y, comp Z, comp W);
    00109                 };
    00110
    00111         }//namespace detail
    00112
    00113         namespace gtx{
    00115         namespace simd_vec4
    00116         {
    00117                 typedef detail::fvec4SIMD vec4SIMD;
    00118
    00119         }//namespace simd_vec4
    00120         }//namespace gtx
    00121 }//namespace glm
    00122
    00123 #define GLM_GTX_simd_vec4               namespace gtx::simd_vec4;
    00124 #ifndef GLM_GTX_GLOBAL
    00125 namespace glm {using GLM_GTX_simd_vec4;}
    00126 #endif//GLM_GTX_GLOBAL
    00127
    00128 #include "simd_vec4.inl"
    00129
    00130 #endif//glm_gtx_simd_vec4