compatibility.hpp
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 
00015 
00016 
00017 
00018 
00019 
00020 
00021 
00022 
00023 
00024 
00025 
00026 
00027 
00028 
00029 
00030 
00031 
00032 
00033 
00034 
00035 
00036 
00037 
00038 
00039 #ifndef GLM_GTX_compatibility
00040 #define GLM_GTX_compatibility GLM_VERSION
00041 
00042 // Dependency:
00043 #include "../glm.hpp"  
00044 #include "../gtc/half_float.hpp"
00045 #include "../gtc/quaternion.hpp"
00046 
00047 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00048 #       pragma message("GLM: GLM_GTX_compatibility extension included")
00049 #endif
00050 
00051 #if(GLM_COMPILER & GLM_COMPILER_VC)
00052 #include <cfloat>
00053 #elif(GLM_COMPILER & GLM_COMPILER_GCC)
00054 #include <cmath>
00055 #   if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
00056 #       undef isfinite
00057 #   endif
00058 #endif//GLM_COMPILER
00059 
00060 namespace glm
00061 {
00064 
00065         template <typename T> GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);}                                                                                                                                                                    
00066         template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> lerp(const detail::tvec2<T>& x, const detail::tvec2<T>& y, T a){return mix(x, y, a);}                                                 
00067         template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> lerp(const detail::tvec3<T>& x, const detail::tvec3<T>& y, T a){return mix(x, y, a);}                                                 
00068         template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> lerp(const detail::tvec4<T>& x, const detail::tvec4<T>& y, T a){return mix(x, y, a);}                                                 
00069         template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> lerp(const detail::tvec2<T>& x, const detail::tvec2<T>& y, const detail::tvec2<T>& a){return mix(x, y, a);}   
00070         template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> lerp(const detail::tvec3<T>& x, const detail::tvec3<T>& y, const detail::tvec3<T>& a){return mix(x, y, a);}   
00071         template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> lerp(const detail::tvec4<T>& x, const detail::tvec4<T>& y, const detail::tvec4<T>& a){return mix(x, y, a);}   
00072 
00073         template <typename T> GLM_FUNC_QUALIFIER T slerp(detail::tquat<T> const & x, detail::tquat<T> const & y, T const & a){return mix(x, y, a);} 
00074 
00075         template <typename T> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));}                                                                                                          
00076         template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> saturate(const detail::tvec2<T>& x){return clamp(x, T(0), T(1));}                                     
00077         template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> saturate(const detail::tvec3<T>& x){return clamp(x, T(0), T(1));}                                     
00078         template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> saturate(const detail::tvec4<T>& x){return clamp(x, T(0), T(1));}                                     
00079 
00080         template <typename T> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);}                                                                                                                          
00081         template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> atan2(const detail::tvec2<T>& x, const detail::tvec2<T>& y){return atan(x, y);}       
00082         template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> atan2(const detail::tvec3<T>& x, const detail::tvec3<T>& y){return atan(x, y);}       
00083         template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> atan2(const detail::tvec4<T>& x, const detail::tvec4<T>& y){return atan(x, y);}       
00084 
00085         template <typename genType> bool isfinite(genType const & x);                                                                                   
00086         template <typename valType> detail::tvec2<bool> isfinite(const detail::tvec2<valType>& x);                              
00087         template <typename valType> detail::tvec3<bool> isfinite(const detail::tvec3<valType>& x);                              
00088         template <typename valType> detail::tvec4<bool> isfinite(const detail::tvec4<valType>& x);                              
00089 
00090         typedef bool                                            bool1;                  
00091         typedef detail::tvec2<bool>                     bool2;                  
00092         typedef detail::tvec3<bool>                     bool3;                  
00093         typedef detail::tvec4<bool>                     bool4;                  
00094 
00095         typedef bool                                            bool1x1;                
00096         typedef detail::tmat2x2<bool>           bool2x2;                
00097         typedef detail::tmat2x3<bool>           bool2x3;                
00098         typedef detail::tmat2x4<bool>           bool2x4;                
00099         typedef detail::tmat3x2<bool>           bool3x2;                
00100         typedef detail::tmat3x3<bool>           bool3x3;                
00101         typedef detail::tmat3x4<bool>           bool3x4;                
00102         typedef detail::tmat4x2<bool>           bool4x2;                
00103         typedef detail::tmat4x3<bool>           bool4x3;                
00104         typedef detail::tmat4x4<bool>           bool4x4;                
00105 
00106         typedef int                                                     int1;                   
00107         typedef detail::tvec2<int>                      int2;                   
00108         typedef detail::tvec3<int>                      int3;                   
00109         typedef detail::tvec4<int>                      int4;                   
00110 
00111         typedef int                                                     int1x1;                 
00112         typedef detail::tmat2x2<int>            int2x2;                 
00113         typedef detail::tmat2x3<int>            int2x3;                 
00114         typedef detail::tmat2x4<int>            int2x4;                 
00115         typedef detail::tmat3x2<int>            int3x2;                 
00116         typedef detail::tmat3x3<int>            int3x3;                 
00117         typedef detail::tmat3x4<int>            int3x4;                 
00118         typedef detail::tmat4x2<int>            int4x2;                 
00119         typedef detail::tmat4x3<int>            int4x3;                 
00120         typedef detail::tmat4x4<int>            int4x4;                 
00121 
00122         typedef detail::half                                    half1;                  
00123         typedef detail::tvec2<detail::half>     half2;                  
00124         typedef detail::tvec3<detail::half>     half3;                  
00125         typedef detail::tvec4<detail::half>     half4;                  
00126 
00127         typedef detail::half                                    half1x1;                
00128         typedef detail::tmat2x2<detail::half>   half2x2;                
00129         typedef detail::tmat2x3<detail::half>   half2x3;                
00130         typedef detail::tmat2x4<detail::half>   half2x4;                
00131         typedef detail::tmat3x2<detail::half>   half3x2;                
00132         typedef detail::tmat3x3<detail::half>   half3x3;                
00133         typedef detail::tmat3x4<detail::half>   half3x4;                
00134         typedef detail::tmat4x2<detail::half>   half4x2;                
00135         typedef detail::tmat4x3<detail::half>   half4x3;                
00136         typedef detail::tmat4x4<detail::half>   half4x4;                
00137 
00138         typedef float                                           float1;                 
00139         typedef detail::tvec2<float>            float2;                 
00140         typedef detail::tvec3<float>            float3;                 
00141         typedef detail::tvec4<float>            float4;                 
00142 
00143         typedef float                                           float1x1;               
00144         typedef detail::tmat2x2<float>          float2x2;               
00145         typedef detail::tmat2x3<float>          float2x3;               
00146         typedef detail::tmat2x4<float>          float2x4;               
00147         typedef detail::tmat3x2<float>          float3x2;               
00148         typedef detail::tmat3x3<float>          float3x3;               
00149         typedef detail::tmat3x4<float>          float3x4;               
00150         typedef detail::tmat4x2<float>          float4x2;               
00151         typedef detail::tmat4x3<float>          float4x3;               
00152         typedef detail::tmat4x4<float>          float4x4;               
00153 
00154         typedef double                                          double1;                
00155         typedef detail::tvec2<double>           double2;                
00156         typedef detail::tvec3<double>           double3;                
00157         typedef detail::tvec4<double>           double4;                
00158 
00159         typedef double                                          double1x1;              
00160         typedef detail::tmat2x2<double>         double2x2;              
00161         typedef detail::tmat2x3<double>         double2x3;              
00162         typedef detail::tmat2x4<double>         double2x4;              
00163         typedef detail::tmat3x2<double>         double3x2;              
00164         typedef detail::tmat3x3<double>         double3x3;              
00165         typedef detail::tmat3x4<double>         double3x4;              
00166         typedef detail::tmat4x2<double>         double4x2;              
00167         typedef detail::tmat4x3<double>         double4x3;              
00168         typedef detail::tmat4x4<double>         double4x4;              
00169 
00171 }//namespace glm
00172 
00173 #include "compatibility.inl"
00174     
00175 #endif//GLM_GTX_compatibility
00176