|  | 
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 00046 #if(defined(GLM_MESSAGES) && !defined(glm_ext)) 00047 # pragma message("GLM: GLM_GTX_compatibility extension included") 00048 #endif 00049 00050 #if(GLM_COMPILER & GLM_COMPILER_VC) 00051 #include <cfloat> 00052 #elif(GLM_COMPILER & GLM_COMPILER_GCC) 00053 #include <cmath> 00054 #endif//GLM_COMPILER 00055 00056 namespace glm 00057 { 00060 00061 template <typename T> GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);} 00062 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);} 00063 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);} 00064 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);} 00065 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);} 00066 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);} 00067 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);} 00068 00069 template <typename T> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));} 00070 template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> saturate(const detail::tvec2<T>& x){return clamp(x, T(0), T(1));} 00071 template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> saturate(const detail::tvec3<T>& x){return clamp(x, T(0), T(1));} 00072 template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> saturate(const detail::tvec4<T>& x){return clamp(x, T(0), T(1));} 00073 00074 template <typename T> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);} 00075 template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> atan2(const detail::tvec2<T>& x, const detail::tvec2<T>& y){return atan(x, y);} 00076 template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> atan2(const detail::tvec3<T>& x, const detail::tvec3<T>& y){return atan(x, y);} 00077 template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> atan2(const detail::tvec4<T>& x, const detail::tvec4<T>& y){return atan(x, y);} 00078 00079 template <typename genType> bool isfinite(genType const & x); 00080 template <typename valType> detail::tvec2<bool> isfinite(const detail::tvec2<valType>& x); 00081 template <typename valType> detail::tvec3<bool> isfinite(const detail::tvec3<valType>& x); 00082 template <typename valType> detail::tvec4<bool> isfinite(const detail::tvec4<valType>& x); 00083 00084 template <typename genType> bool isinf(genType const & x); 00085 template <typename genType> detail::tvec2<bool> isinf(const detail::tvec2<genType>& x); 00086 template <typename genType> detail::tvec3<bool> isinf(const detail::tvec3<genType>& x); 00087 template <typename genType> detail::tvec4<bool> isinf(const detail::tvec4<genType>& x); 00088 00089 template <typename genType> bool isnan(genType const & x); 00090 template <typename genType> detail::tvec2<bool> isnan(const detail::tvec2<genType>& x); 00091 template <typename genType> detail::tvec3<bool> isnan(const detail::tvec3<genType>& x); 00092 template <typename genType> detail::tvec4<bool> isnan(const detail::tvec4<genType>& x); 00093 00094 typedef bool bool1; 00095 typedef detail::tvec2<bool> bool2; 00096 typedef detail::tvec3<bool> bool3; 00097 typedef detail::tvec4<bool> bool4; 00098 00099 typedef bool bool1x1; 00100 typedef detail::tmat2x2<bool> bool2x2; 00101 typedef detail::tmat2x3<bool> bool2x3; 00102 typedef detail::tmat2x4<bool> bool2x4; 00103 typedef detail::tmat3x2<bool> bool3x2; 00104 typedef detail::tmat3x3<bool> bool3x3; 00105 typedef detail::tmat3x4<bool> bool3x4; 00106 typedef detail::tmat4x2<bool> bool4x2; 00107 typedef detail::tmat4x3<bool> bool4x3; 00108 typedef detail::tmat4x4<bool> bool4x4; 00109 00110 typedef int int1; 00111 typedef detail::tvec2<int> int2; 00112 typedef detail::tvec3<int> int3; 00113 typedef detail::tvec4<int> int4; 00114 00115 typedef int int1x1; 00116 typedef detail::tmat2x2<int> int2x2; 00117 typedef detail::tmat2x3<int> int2x3; 00118 typedef detail::tmat2x4<int> int2x4; 00119 typedef detail::tmat3x2<int> int3x2; 00120 typedef detail::tmat3x3<int> int3x3; 00121 typedef detail::tmat3x4<int> int3x4; 00122 typedef detail::tmat4x2<int> int4x2; 00123 typedef detail::tmat4x3<int> int4x3; 00124 typedef detail::tmat4x4<int> int4x4; 00125 00126 typedef detail::thalf half1; 00127 typedef detail::tvec2<detail::thalf> half2; 00128 typedef detail::tvec3<detail::thalf> half3; 00129 typedef detail::tvec4<detail::thalf> half4; 00130 00131 typedef detail::thalf half1x1; 00132 typedef detail::tmat2x2<detail::thalf> half2x2; 00133 typedef detail::tmat2x3<detail::thalf> half2x3; 00134 typedef detail::tmat2x4<detail::thalf> half2x4; 00135 typedef detail::tmat3x2<detail::thalf> half3x2; 00136 typedef detail::tmat3x3<detail::thalf> half3x3; 00137 typedef detail::tmat3x4<detail::thalf> half3x4; 00138 typedef detail::tmat4x2<detail::thalf> half4x2; 00139 typedef detail::tmat4x3<detail::thalf> half4x3; 00140 typedef detail::tmat4x4<detail::thalf> half4x4; 00141 00142 typedef float float1; 00143 typedef detail::tvec2<float> float2; 00144 typedef detail::tvec3<float> float3; 00145 typedef detail::tvec4<float> float4; 00146 00147 typedef float float1x1; 00148 typedef detail::tmat2x2<float> float2x2; 00149 typedef detail::tmat2x3<float> float2x3; 00150 typedef detail::tmat2x4<float> float2x4; 00151 typedef detail::tmat3x2<float> float3x2; 00152 typedef detail::tmat3x3<float> float3x3; 00153 typedef detail::tmat3x4<float> float3x4; 00154 typedef detail::tmat4x2<float> float4x2; 00155 typedef detail::tmat4x3<float> float4x3; 00156 typedef detail::tmat4x4<float> float4x4; 00157 00158 typedef double double1; 00159 typedef detail::tvec2<double> double2; 00160 typedef detail::tvec3<double> double3; 00161 typedef detail::tvec4<double> double4; 00162 00163 typedef double double1x1; 00164 typedef detail::tmat2x2<double> double2x2; 00165 typedef detail::tmat2x3<double> double2x3; 00166 typedef detail::tmat2x4<double> double2x4; 00167 typedef detail::tmat3x2<double> double3x2; 00168 typedef detail::tmat3x3<double> double3x3; 00169 typedef detail::tmat3x4<double> double3x4; 00170 typedef detail::tmat4x2<double> double4x2; 00171 typedef detail::tmat4x3<double> double4x3; 00172 typedef detail::tmat4x4<double> double4x4; 00173 00175 }//namespace glm 00176 00177 #include "compatibility.inl" 00178 00179 #endif//GLM_GTX_compatibility 00180
 1.7.3
 1.7.3