Tony-LunarG | b0b195d | 2015-05-13 15:01:06 -0600 | [diff] [blame] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
| 2 | /// OpenGL Mathematics (glm.g-truc.net) |
| 3 | /// |
| 4 | /// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) |
| 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy |
| 6 | /// of this software and associated documentation files (the "Software"), to deal |
| 7 | /// in the Software without restriction, including without limitation the rights |
| 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 9 | /// copies of the Software, and to permit persons to whom the Software is |
| 10 | /// furnished to do so, subject to the following conditions: |
| 11 | /// |
| 12 | /// The above copyright notice and this permission notice shall be included in |
| 13 | /// all copies or substantial portions of the Software. |
| 14 | /// |
| 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 21 | /// THE SOFTWARE. |
| 22 | /// |
| 23 | /// @ref gtc_epsilon |
| 24 | /// @file glm/gtc/epsilon.hpp |
| 25 | /// @date 2012-04-07 / 2012-04-07 |
| 26 | /// @author Christophe Riccio |
| 27 | /// |
| 28 | /// @see core (dependence) |
| 29 | /// @see gtc_half_float (dependence) |
| 30 | /// @see gtc_quaternion (dependence) |
| 31 | /// |
| 32 | /// @defgroup gtc_epsilon GLM_GTC_epsilon |
| 33 | /// @ingroup gtc |
| 34 | /// |
| 35 | /// @brief Comparison functions for a user defined epsilon values. |
| 36 | /// |
| 37 | /// <glm/gtc/epsilon.hpp> need to be included to use these functionalities. |
| 38 | /////////////////////////////////////////////////////////////////////////////////// |
| 39 | |
| 40 | #ifndef GLM_GTC_epsilon |
| 41 | #define GLM_GTC_epsilon |
| 42 | |
| 43 | // Dependencies |
| 44 | #include "../detail/setup.hpp" |
| 45 | #include "../detail/precision.hpp" |
| 46 | |
| 47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED)) |
| 48 | # pragma message("GLM: GLM_GTC_epsilon extension included") |
| 49 | #endif |
| 50 | |
| 51 | namespace glm |
| 52 | { |
| 53 | /// @addtogroup gtc_epsilon |
| 54 | /// @{ |
| 55 | |
| 56 | /// Returns the component-wise comparison of |x - y| < epsilon. |
| 57 | /// True if this expression is satisfied. |
| 58 | /// |
| 59 | /// @see gtc_epsilon |
| 60 | template <typename T, precision P, template <typename, precision> class vecType> |
| 61 | GLM_FUNC_DECL vecType<bool, P> epsilonEqual( |
| 62 | vecType<T, P> const & x, |
| 63 | vecType<T, P> const & y, |
| 64 | T const & epsilon); |
| 65 | |
| 66 | /// Returns the component-wise comparison of |x - y| < epsilon. |
| 67 | /// True if this expression is satisfied. |
| 68 | /// |
| 69 | /// @see gtc_epsilon |
| 70 | template <typename genType> |
| 71 | GLM_FUNC_DECL bool epsilonEqual( |
| 72 | genType const & x, |
| 73 | genType const & y, |
| 74 | genType const & epsilon); |
| 75 | |
| 76 | /// Returns the component-wise comparison of |x - y| < epsilon. |
| 77 | /// True if this expression is not satisfied. |
| 78 | /// |
| 79 | /// @see gtc_epsilon |
| 80 | template <typename genType> |
| 81 | GLM_FUNC_DECL typename genType::boolType epsilonNotEqual( |
| 82 | genType const & x, |
| 83 | genType const & y, |
| 84 | typename genType::value_type const & epsilon); |
| 85 | |
| 86 | /// Returns the component-wise comparison of |x - y| >= epsilon. |
| 87 | /// True if this expression is not satisfied. |
| 88 | /// |
| 89 | /// @see gtc_epsilon |
| 90 | template <typename genType> |
| 91 | GLM_FUNC_DECL bool epsilonNotEqual( |
| 92 | genType const & x, |
| 93 | genType const & y, |
| 94 | genType const & epsilon); |
| 95 | |
| 96 | /// @} |
| 97 | }//namespace glm |
| 98 | |
| 99 | #include "epsilon.inl" |
| 100 | |
| 101 | #endif//GLM_GTC_epsilon |