Flow Visualisation
compatibility.hpp
Go to the documentation of this file.
1 
39 #ifndef GLM_GTX_compatibility
40 #define GLM_GTX_compatibility GLM_VERSION
41 
42 // Dependency:
43 #include "../glm.hpp"
44 #include "../gtc/half_float.hpp"
45 #include "../gtc/quaternion.hpp"
46 
47 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
48 # pragma message("GLM: GLM_GTX_compatibility extension included")
49 #endif
50 
51 #if(GLM_COMPILER & GLM_COMPILER_VC)
52 # include <cfloat>
53 #elif(GLM_COMPILER & GLM_COMPILER_GCC)
54 # include <cmath>
55 # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
56 # undef isfinite
57 # endif
58 #endif//GLM_COMPILER
59 
60 namespace glm
61 {
64 
65  template <typename T> GLM_FUNC_QUALIFIER T lerp(T x, T y, T a){return mix(x, y, a);}
66  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);}
67  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);}
68  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);}
69  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);}
70  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);}
71  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);}
72 
73  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);}
74 
75  template <typename T> GLM_FUNC_QUALIFIER T saturate(T x){return clamp(x, T(0), T(1));}
76  template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> saturate(const detail::tvec2<T>& x){return clamp(x, T(0), T(1));}
77  template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> saturate(const detail::tvec3<T>& x){return clamp(x, T(0), T(1));}
78  template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> saturate(const detail::tvec4<T>& x){return clamp(x, T(0), T(1));}
79 
80  template <typename T> GLM_FUNC_QUALIFIER T atan2(T x, T y){return atan(x, y);}
81  template <typename T> GLM_FUNC_QUALIFIER detail::tvec2<T> atan2(const detail::tvec2<T>& x, const detail::tvec2<T>& y){return atan(x, y);}
82  template <typename T> GLM_FUNC_QUALIFIER detail::tvec3<T> atan2(const detail::tvec3<T>& x, const detail::tvec3<T>& y){return atan(x, y);}
83  template <typename T> GLM_FUNC_QUALIFIER detail::tvec4<T> atan2(const detail::tvec4<T>& x, const detail::tvec4<T>& y){return atan(x, y);}
84 
85  template <typename genType> bool isfinite(genType const & x);
86  template <typename valType> detail::tvec2<bool> isfinite(const detail::tvec2<valType>& x);
87  template <typename valType> detail::tvec3<bool> isfinite(const detail::tvec3<valType>& x);
88  template <typename valType> detail::tvec4<bool> isfinite(const detail::tvec4<valType>& x);
89 
90  typedef bool bool1;
94 
95  typedef bool bool1x1;
105 
106  typedef int int1;
110 
111  typedef int int1x1;
121 
122  typedef detail::half half1;
126 
137 
138  typedef float float1;
142 
143  typedef float float1x1;
153 
154  typedef double double1;
158 
159  typedef double double1x1;
169 
171 }//namespace glm
172 
173 #include "compatibility.inl"
174 
175 #endif//GLM_GTX_compatibility
176 
detail::tmat4x3< detail::half > half4x3
half-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:135
detail::tmat2x4< bool > bool2x4
boolean matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:98
detail::tmat2x4< detail::half > half2x4
half-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:130
detail::tmat2x3< bool > bool2x3
boolean matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:97
detail::tvec4< double > double4
double-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:157
detail::tmat4x2< detail::half > half4x2
half-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:134
detail::tmat2x4< float > float2x4
single-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:146
detail::tmat3x3< float > float3x3
single-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:148
detail::tmat3x2< detail::half > half3x2
half-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:131
int int1
integer vector with 1 component. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:106
detail::tmat4x4< detail::half > half4x4
half-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:136
detail::tmat2x4< double > double2x4
double-precision floating-point matrix with 2 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:162
detail::tmat3x4< int > int3x4
integer matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:117
double double1
double-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:154
detail::tmat4x4< double > double4x4
double-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:168
detail::half half1
half-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:122
detail::tmat4x3< int > int4x3
integer matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:119
Definition: type_mat2x2.hpp:45
Definition: type_mat2x2.hpp:48
detail::tmat3x3< double > double3x3
double-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:164
Definition: type_mat2x2.hpp:42
Definition: _detail.hpp:38
detail::tmat4x2< int > int4x2
integer matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:118
detail::tquat< T > slerp(detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
Returns the slurp interpolation between two quaternions.
Definition: quaternion.inl:492
detail::tmat3x3< bool > bool3x3
boolean matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:100
bool bool1
boolean type with 1 component. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:90
Definition: type_mat2x2.hpp:38
detail::tvec3< double > double3
double-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:156
detail::tmat3x4< detail::half > half3x4
half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:133
detail::half half1x1
half-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:127
bool isfinite(genType const &x)
Test whether or not a scalar or each vector component is a finite value. (From GLM_GTX_compatibility)...
Definition: compatibility.inl:14
detail::tmat3x4< double > double3x4
double-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:165
Definition: _swizzle.hpp:43
detail::tvec2< int > int2
integer vector with 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:107
detail::tvec2< float > float2
single-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:139
detail::tmat2x2< float > float2x2
single-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:144
detail::tmat4x4< bool > bool4x4
boolean matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:104
detail::tmat2x3< int > int2x3
integer matrix with 2 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:113
detail::tmat2x3< detail::half > half2x3
half-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:129
double double1x1
double-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:159
detail::tquat< T > lerp(detail::tquat< T > const &x, detail::tquat< T > const &y, T const &a)
Definition: quaternion.inl:477
detail::tmat2x2< int > int2x2
integer matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:112
detail::tmat4x2< float > float4x2
single-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:150
detail::tvec4< int > int4
integer vector with 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:109
detail::tmat3x3< int > int3x3
integer matrix with 3 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:116
float float1x1
single-precision floating-point matrix with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:143
detail::tmat2x3< float > float2x3
single-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:145
int int1x1
integer matrix with 1 component. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:111
detail::tvec3< float > float3
single-precision floating-point vector with 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:140
GLM_FUNC_DECL genType atan(genType const &y, genType const &x)
Definition: func_trigonometric.inl:131
detail::tvec3< bool > bool3
boolean type with 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:92
Definition: quaternion.hpp:56
detail::tmat2x4< int > int2x4
integer matrix with 2 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:114
Definition: type_mat2x2.hpp:39
detail::tmat4x3< bool > bool4x3
boolean matrix with 4 x 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:103
GLM_FUNC_DECL genType clamp(genType const &x, genType const &minVal, genType const &maxVal)
detail::tvec4< detail::half > half4
half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:125
detail::tmat4x4< float > float4x4
single-precision floating-point matrix with 4 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:152
GLM_FUNC_QUALIFIER T atan2(T x, T y)
Arc tangent. Returns an angle whose tangent is y/x. The signs of x and y are used to determine what q...
Definition: compatibility.hpp:80
detail::tvec4< float > float4
single-precision floating-point vector with 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:141
detail::tmat4x3< float > float4x3
single-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:151
Definition: type_mat2x2.hpp:44
Definition: type_mat2x2.hpp:47
Definition: type_mat2x2.hpp:41
Definition: type_half.hpp:42
detail::tvec2< bool > bool2
boolean type with 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:91
detail::tmat2x3< double > double2x3
double-precision floating-point matrix with 2 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:161
detail::tvec2< detail::half > half2
half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:123
detail::tvec4< bool > bool4
boolean type with 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:93
detail::tmat3x4< bool > bool3x4
boolean matrix with 3 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:101
GLM_FUNC_QUALIFIER T saturate(T x)
Returns clamp(x, 0, 1) for each component in x. (From GLM_GTX_compatibility)
Definition: compatibility.hpp:75
detail::tmat4x2< double > double4x2
double-precision floating-point matrix with 4 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:166
detail::tmat3x4< float > float3x4
single-precision floating-point matrix with 3 x 4 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:149
detail::tmat2x2< double > double2x2
double-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:160
Definition: type_mat2x2.hpp:40
float float1
single-precision floating-point vector with 1 component. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:138
detail::tvec3< int > int3
integer vector with 3 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:108
detail::tmat2x2< detail::half > half2x2
half-precision floating-point matrix with 2 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:128
detail::tmat4x2< bool > bool4x2
boolean matrix with 4 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:102
GLM_FUNC_DECL genTypeT mix(genTypeT const &x, genTypeT const &y, genTypeU const &a)
detail::tvec3< detail::half > half3
half-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:124
bool bool1x1
boolean matrix with 1 x 1 component. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:95
detail::tmat4x3< double > double4x3
double-precision floating-point matrix with 4 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:167
detail::tmat4x4< int > int4x4
integer matrix with 4 x 4 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:120
Definition: type_mat2x2.hpp:46
Definition: type_mat2x2.hpp:49
Definition: type_mat2x2.hpp:43
detail::tmat3x2< double > double3x2
double-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:163
detail::tmat3x2< int > int3x2
integer matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:115
detail::tmat3x2< float > float3x2
single-precision floating-point matrix with 3 x 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:147
detail::tmat3x3< detail::half > half3x3
half-precision floating-point matrix with 3 x 3 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:132
#define GLM_FUNC_QUALIFIER
Definition: setup.hpp:679
detail::tmat2x2< bool > bool2x2
boolean matrix with 2 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:96
detail::tvec2< double > double2
double-precision floating-point vector with 2 components. (From GLM_GTX_compatibility extension) ...
Definition: compatibility.hpp:155
detail::tmat3x2< bool > bool3x2
boolean matrix with 3 x 2 components. (From GLM_GTX_compatibility extension)
Definition: compatibility.hpp:99