From e62817b8252974b8a98393275874ee303840bf13 Mon Sep 17 00:00:00 2001 From: LaG1924 <12997935+LaG1924@users.noreply.github.com> Date: Fri, 12 May 2017 18:49:50 +0500 Subject: 2017-05-12 --- depedencies/include/glm/gtx/compatibility.inl | 65 +++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 depedencies/include/glm/gtx/compatibility.inl (limited to 'depedencies/include/glm/gtx/compatibility.inl') diff --git a/depedencies/include/glm/gtx/compatibility.inl b/depedencies/include/glm/gtx/compatibility.inl new file mode 100644 index 0000000..368527a --- /dev/null +++ b/depedencies/include/glm/gtx/compatibility.inl @@ -0,0 +1,65 @@ +/// @ref gtx_compatibility +/// @file glm/gtx/compatibility.inl + +#include + +namespace glm +{ + // isfinite + template + GLM_FUNC_QUALIFIER bool isfinite( + genType const & x) + { +# if GLM_HAS_CXX11_STL + return std::isfinite(x) != 0; +# elif GLM_COMPILER & GLM_COMPILER_VC + return _finite(x); +# elif GLM_COMPILER & GLM_COMPILER_GCC && GLM_PLATFORM & GLM_PLATFORM_ANDROID + return _isfinite(x) != 0; +# else + if (std::numeric_limits::is_integer || std::denorm_absent == std::numeric_limits::has_denorm) + return std::numeric_limits::min() <= x && std::numeric_limits::max() >= x; + else + return -std::numeric_limits::max() <= x && std::numeric_limits::max() >= x; +# endif + } + + template + GLM_FUNC_QUALIFIER tvec1 isfinite( + tvec1 const & x) + { + return tvec1( + isfinite(x.x)); + } + + template + GLM_FUNC_QUALIFIER tvec2 isfinite( + tvec2 const & x) + { + return tvec2( + isfinite(x.x), + isfinite(x.y)); + } + + template + GLM_FUNC_QUALIFIER tvec3 isfinite( + tvec3 const & x) + { + return tvec3( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z)); + } + + template + GLM_FUNC_QUALIFIER tvec4 isfinite( + tvec4 const & x) + { + return tvec4( + isfinite(x.x), + isfinite(x.y), + isfinite(x.z), + isfinite(x.w)); + } + +}//namespace glm -- cgit v1.2.3