You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5 KiB

  1. ///////////////////////////////////////////////////////////////////////////////////////////////////
  2. // OpenGL Mathematics Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net)
  3. ///////////////////////////////////////////////////////////////////////////////////////////////////
  4. // Created : 2007-03-16
  5. // Updated : 2008-10-24
  6. // Licence : This source is under MIT License
  7. // File : glm/gtx/compatibility.inl
  8. ///////////////////////////////////////////////////////////////////////////////////////////////////
  9. namespace glm
  10. {
  11. // isfinite
  12. template <typename genType>
  13. GLM_FUNC_QUALIFIER bool isfinite(
  14. genType const & x)
  15. {
  16. # if(GLM_COMPILER & GLM_COMPILER_VC)
  17. return _finite(x);
  18. # elif(GLM_COMPILER & GLM_COMPILER_GCC)
  19. # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID)
  20. return _isfinite(x) != 0;
  21. # else
  22. return std::isfinite(x) != 0;
  23. # endif
  24. # else
  25. return std::isfinite(x) != 0;
  26. # endif
  27. }
  28. template <typename valType>
  29. GLM_FUNC_QUALIFIER detail::tvec2<bool> isfinite(
  30. detail::tvec2<valType> const & x)
  31. {
  32. return detail::tvec2<bool>(
  33. isfinite(x.x),
  34. isfinite(x.y));
  35. }
  36. template <typename valType>
  37. GLM_FUNC_QUALIFIER detail::tvec3<bool> isfinite(
  38. detail::tvec3<valType> const & x)
  39. {
  40. return detail::tvec3<bool>(
  41. isfinite(x.x),
  42. isfinite(x.y),
  43. isfinite(x.z));
  44. }
  45. template <typename valType>
  46. GLM_FUNC_QUALIFIER detail::tvec4<bool> isfinite(
  47. detail::tvec4<valType> const & x)
  48. {
  49. return detail::tvec4<bool>(
  50. isfinite(x.x),
  51. isfinite(x.y),
  52. isfinite(x.z),
  53. isfinite(x.w));
  54. }
  55. }//namespace glm