1 /// @ref gtc_epsilon 2 /// @file glm/gtc/epsilon.hpp 3 /// 4 /// @see core (dependence) 5 /// @see gtc_half_float (dependence) 6 /// @see gtc_quaternion (dependence) 7 /// 8 /// @defgroup gtc_epsilon GLM_GTC_epsilon 9 /// @ingroup gtc 10 /// 11 /// @brief Comparison functions for a user defined epsilon values. 12 /// 13 /// <glm/gtc/epsilon.hpp> need to be included to use these functionalities. 14 15 #pragma once 16 17 // Dependencies 18 #include "../detail/setup.hpp" 19 #include "../detail/precision.hpp" 20 21 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED) 22 # pragma message("GLM: GLM_GTC_epsilon extension included") 23 #endif 24 25 namespace glm 26 { 27 /// @addtogroup gtc_epsilon 28 /// @{ 29 30 /// Returns the component-wise comparison of |x - y| < epsilon. 31 /// True if this expression is satisfied. 32 /// 33 /// @see gtc_epsilon 34 template <typename T, precision P, template <typename, precision> class vecType> 35 GLM_FUNC_DECL vecType<bool, P> epsilonEqual( 36 vecType<T, P> const & x, 37 vecType<T, P> const & y, 38 T const & epsilon); 39 40 /// Returns the component-wise comparison of |x - y| < epsilon. 41 /// True if this expression is satisfied. 42 /// 43 /// @see gtc_epsilon 44 template <typename genType> 45 GLM_FUNC_DECL bool epsilonEqual( 46 genType const & x, 47 genType const & y, 48 genType const & epsilon); 49 50 /// Returns the component-wise comparison of |x - y| < epsilon. 51 /// True if this expression is not satisfied. 52 /// 53 /// @see gtc_epsilon 54 template <typename genType> 55 GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( 56 genType const & x, 57 genType const & y, 58 typename genType::value_type const & epsilon); 59 60 /// Returns the component-wise comparison of |x - y| >= epsilon. 61 /// True if this expression is not satisfied. 62 /// 63 /// @see gtc_epsilon 64 template <typename genType> 65 GLM_FUNC_DECL bool epsilonNotEqual( 66 genType const & x, 67 genType const & y, 68 genType const & epsilon); 69 70 /// @} 71 }//namespace glm 72 73 #include "epsilon.inl" 74