00001 
00002 
00004 
00005 
00006 
00007 
00009 
00010 
00012 
00013 #ifndef glm_gtx_vecx
00014 #define glm_gtx_vecx
00015 
00016 namespace glm{
00017 namespace detail{
00018 
00019         template <int N>
00020     class _bvecxGTX
00021     {
00022         private:
00023                 bool data[N];
00024 
00025         public:
00026                 typedef bool value_type;
00027                 typedef int size_type;
00028                 static const size_type value_size;
00029                 static const size_type col_size;
00030                 static const size_type row_size;
00031 
00032         
00033             _bvecxGTX();
00034         _bvecxGTX(const _bvecxGTX& v);
00035 
00036                 
00037         bool& operator[](int i);
00038         bool operator[](int i) const;
00039         operator bool*();
00040             operator const bool*() const;
00041 
00042         
00043         explicit _bvecxGTX(const bool a);
00044 
00045         
00046         _bvecxGTX<N>& operator=(const _bvecxGTX<N>& v);
00047             _bvecxGTX<N> operator! () const;
00048     };
00049 
00050     template <int N, typename T = float>
00051     class _xvecxGTX
00052     {
00053         private:
00054                 T data[N];
00055 
00056         public:
00057                 typedef T value_type;
00058                 typedef int size_type;
00059                 static const size_type value_size;
00060 
00061         
00062             _xvecxGTX();
00063         _xvecxGTX(const _xvecxGTX<N, T>& v);
00064 
00065                 
00066         T& operator[](int i);
00067         T operator[](int i) const;
00068         operator T*();
00069             operator const T*() const;
00070 
00071         
00072         explicit _xvecxGTX(const T x);
00073 
00074         
00075         _xvecxGTX<N, T>& operator= (const _xvecxGTX<N, T>& v);
00076             _xvecxGTX<N, T>& operator+=(const T s);
00077             _xvecxGTX<N, T>& operator+=(const _xvecxGTX<N, T>& v);
00078             _xvecxGTX<N, T>& operator-=(const T s);
00079             _xvecxGTX<N, T>& operator-=(const _xvecxGTX<N, T>& v);
00080             _xvecxGTX<N, T>& operator*=(const T s);
00081             _xvecxGTX<N, T>& operator*=(const _xvecxGTX<N, T>& v);
00082             _xvecxGTX<N, T>& operator/=(const T s);
00083             _xvecxGTX<N, T>& operator/=(const _xvecxGTX<N, T>& v);
00084             _xvecxGTX<N, T>& operator++();
00085         _xvecxGTX<N, T>& operator--();
00086     };
00087 
00088     
00089     template <int N, typename T>
00090         detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v, const T s);
00091 
00092     template <int N, typename T>
00093     detail::_xvecxGTX<N, T> operator+ (const T s, const detail::_xvecxGTX<N, T>& v);
00094 
00095     template <int N, typename T>
00096     detail::_xvecxGTX<N, T> operator+ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);
00097     
00098     template <int N, typename T>
00099         detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v, const T s);
00100 
00101     template <int N, typename T>
00102     detail::_xvecxGTX<N, T> operator- (const T s, const detail::_xvecxGTX<N, T>& v);
00103 
00104     template <int N, typename T>
00105     detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);
00106 
00107     template <int N, typename T>
00108     detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v, const T s);
00109 
00110     template <int N, typename T>
00111     detail::_xvecxGTX<N, T> operator* (const T s, const detail::_xvecxGTX<N, T>& v);
00112 
00113     template <int N, typename T>
00114     detail::_xvecxGTX<N, T> operator* (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);
00115 
00116     template <int N, typename T>
00117     detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v, const T s);
00118 
00119     template <int N, typename T>
00120     detail::_xvecxGTX<N, T> operator/ (const T s, const detail::_xvecxGTX<N, T>& v);
00121 
00122     template <int N, typename T>
00123     detail::_xvecxGTX<N, T> operator/ (const detail::_xvecxGTX<N, T>& v1, const detail::_xvecxGTX<N, T>& v2);
00124 
00125     
00126     template <int N, typename T>
00127     const detail::_xvecxGTX<N, T> operator- (const detail::_xvecxGTX<N, T>& v);
00128 
00129     template <int N, typename T>
00130     const detail::_xvecxGTX<N, T> operator-- (const detail::_xvecxGTX<N, T>& v, int);
00131 
00132     template <int N, typename T>
00133     const detail::_xvecxGTX<N, T> operator++ (const detail::_xvecxGTX<N, T>& v, int);
00134 
00135 }
00136 
00137         namespace gtx
00138     {
00140         namespace vecx
00141         {
00142                         template<typename T, int N>
00143                         struct vec
00144                         {
00145                                 typedef detail::_xvecxGTX<N, T> type;
00146                         };
00147 
00148                         
00149                         template <int N, typename T> detail::_xvecxGTX<N, T> radiansGTX(const detail::_xvecxGTX<N, T>& degrees); 
00150                         template <int N, typename T> detail::_xvecxGTX<N, T> degreesGTX(const detail::_xvecxGTX<N, T>& radians); 
00151                         template <int N, typename T> detail::_xvecxGTX<N, T> sinGTX(const detail::_xvecxGTX<N, T>& angle);              
00152                         template <int N, typename T> detail::_xvecxGTX<N, T> cosGTX(const detail::_xvecxGTX<N, T>& angle);              
00153                         template <int N, typename T> detail::_xvecxGTX<N, T> tanGTX(const detail::_xvecxGTX<N, T>& angle);              
00154                         template <int N, typename T> detail::_xvecxGTX<N, T> asinGTX(const detail::_xvecxGTX<N, T>& x);                 
00155                         template <int N, typename T> detail::_xvecxGTX<N, T> acosGTX(const detail::_xvecxGTX<N, T>& x);                 
00156                         template <int N, typename T> detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, T>& y, const detail::_xvecxGTX<N, T>& x);       
00157                         template <int N, typename T> detail::_xvecxGTX<N, T> atanGTX(const detail::_xvecxGTX<N, T>& y_over_x);                                                          
00158 
00159                         
00160                         template <int N, typename T> detail::_xvecxGTX<N, T> powGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y); 
00161                         template <int N, typename T> detail::_xvecxGTX<N, T> expGTX(const detail::_xvecxGTX<N, T>& x);  
00162                         template <int N, typename T> detail::_xvecxGTX<N, T> logGTX(const detail::_xvecxGTX<N, T>& x);  
00163                         template <int N, typename T> detail::_xvecxGTX<N, T> exp2GTX(const detail::_xvecxGTX<N, T>& x); 
00164                         template <int N, typename T> detail::_xvecxGTX<N, T> log2GTX(const detail::_xvecxGTX<N, T>& x); 
00165                         template <int N, typename T> detail::_xvecxGTX<N, T> sqrtGTX(const detail::_xvecxGTX<N, T>& x); 
00166                         template <int N, typename T> detail::_xvecxGTX<N, T> inversesqrtGTX(const detail::_xvecxGTX<N, T>& x);  
00167 
00168                         
00169                         template <int N, typename T> detail::_xvecxGTX<N, T> absGTX(const detail::_xvecxGTX<N, T>& x);          
00170                         template <int N, typename T> detail::_xvecxGTX<N, T> floorGTX(const detail::_xvecxGTX<N, T>& x);                
00171                         template <int N, typename T> detail::_xvecxGTX<N, T> ceilGTX(const detail::_xvecxGTX<N, T>& x);         
00172                         template <int N, typename T> detail::_xvecxGTX<N, T> fractGTX(const detail::_xvecxGTX<N, T>& x);                
00173                         template <int N, typename T> detail::_xvecxGTX<N, T> modGTX(const detail::_xvecxGTX<N, T>& x, T y);                                                                     
00174                         template <int N, typename T> detail::_xvecxGTX<N, T> modGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                
00175                         template <int N, typename T> detail::_xvecxGTX<N, T> minGTX(const detail::_xvecxGTX<N, T>& x, T y);                                                                     
00176                         template <int N, typename T> detail::_xvecxGTX<N, T> minGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                
00177                         template <int N, typename T> detail::_xvecxGTX<N, T> maxGTX(const detail::_xvecxGTX<N, T>& x, T y);                                                                     
00178                         template <int N, typename T> detail::_xvecxGTX<N, T> maxGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                
00179                         template <int N, typename T> detail::_xvecxGTX<N, T> clampGTX(const detail::_xvecxGTX<N, T>& x, T minVal, T maxVal);                                                                                                                            
00180                         template <int N, typename T> detail::_xvecxGTX<N, T> clampGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& minVal, const detail::_xvecxGTX<N, T>& maxVal);  
00181                         template <int N, typename T> detail::_xvecxGTX<N, T> stepGTX(T edge, const detail::_xvecxGTX<N, T>& x);                                                                                                                                                 
00182                         template <int N, typename T> detail::_xvecxGTX<N, T> stepGTX(const detail::_xvecxGTX<N, T>& edge, const detail::_xvecxGTX<N, T>& x);                                                                                            
00183                         template <int N, typename T> detail::_xvecxGTX<N, T> smoothstepGTX(T edge0, T edge1, const detail::_xvecxGTX<N, T>& x);                                                                                                                 
00184                         template <int N, typename T> detail::_xvecxGTX<N, T> smoothstepGTX(const detail::_xvecxGTX<N, T>& edge0, const detail::_xvecxGTX<N, T>& edge1, const detail::_xvecxGTX<N, T>& x);
00185 
00186                         
00187                         template <int N, typename T> T lengthGTX(const detail::_xvecxGTX<N, T>& x);                                                                                     
00188                         template <int N, typename T> T distanceGTX(const detail::_xvecxGTX<N, T>& p0, const detail::_xvecxGTX<N, T>& p1);       
00189                         template <int N, typename T> T dotGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                      
00190                         template <int N, typename T> detail::_xvecxGTX<N, T> normalizeGTX(const detail::_xvecxGTX<N, T>& x);                                    
00191                         template <int N, typename T> detail::_xvecxGTX<N, T> faceforwardGTX(const detail::_xvecxGTX<N, T>& Norm, const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, T>& Nref);                
00192                         template <int N, typename T> detail::_xvecxGTX<N, T> reflectGTX(const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, T>& N);                                                                                                    
00193                         template <int N, typename T> detail::_xvecxGTX<N, T> refractGTX(const detail::_xvecxGTX<N, T>& I, const detail::_xvecxGTX<N, T>& N, T eta);                                                                                     
00194 
00195                         
00196                         template <int N, typename T> detail::_bvecxGTX<N> lessThanGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                      
00197                         template <int N, typename T> detail::_bvecxGTX<N> lessThanEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);         
00198                         template <int N, typename T> detail::_bvecxGTX<N> greaterThanGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);           
00199                         template <int N, typename T> detail::_bvecxGTX<N> greaterThanEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);      
00200                         template <int N> detail::_bvecxGTX<N> equalGTX(const detail::_bvecxGTX<N>& x, const detail::_bvecxGTX<N>& y);                                                           
00201                         template <int N, typename T> detail::_bvecxGTX<N> equalGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                         
00202                         template <int N> detail::_bvecxGTX<N> notEqualGTX(const detail::_bvecxGTX<N>& x, const detail::_bvecxGTX<N>& y);                                                                
00203                         template <int N, typename T> detail::_bvecxGTX<N> notEqualGTX(const detail::_xvecxGTX<N, T>& x, const detail::_xvecxGTX<N, T>& y);                      
00204                         template <int N> bool anyGTX(const detail::_bvecxGTX<N>& x);                                                                                                                                                                    
00205                         template <int N> bool allGTX(const detail::_bvecxGTX<N>& x);                                                                                                                                                                    
00206                         template <int N> detail::_bvecxGTX<N> notGTX(const detail::_bvecxGTX<N>& v); 
00207         }
00208     }
00209 }
00210 
00211 #define GLM_GTX_vecx namespace gtx::vecx
00212 #ifndef GLM_GTX_GLOBAL
00213 namespace glm {using GLM_GTX_vecx;}
00214 #endif//GLM_GTX_GLOBAL
00215 
00216 #include "vecx.inl"
00217 
00218 #endif//glm_gtx_vecx