master
ブランチ master
VulkanExample / dep / include / glm / ext / scalar_relational.hpp
2.3 KB、68行 生 Blame 履歴
1/// @ref ext_scalar_relational
2/// @file glm/ext/scalar_relational.hpp
3///
4/// @defgroup ext_scalar_relational GLM_EXT_scalar_relational
5/// @ingroup ext
6///
7/// Exposes comparison functions for scalar types that take a user defined epsilon values.
8///
9/// Include <glm/ext/scalar_relational.hpp> to use the features of this extension.
10///
11/// @see core_vector_relational
12/// @see ext_vector_relational
13/// @see ext_matrix_relational
14
15#pragma once
16
17// Dependencies
18#include "../detail/qualifier.hpp"
19
20#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
21# pragma message("GLM: GLM_EXT_scalar_relational extension included")
22#endif
23
24namespace glm
25{
26 /// @addtogroup ext_scalar_relational
27 /// @{
28
29 /// Returns the component-wise comparison of |x - y| < epsilon.
30 /// True if this expression is satisfied.
31 ///
32 /// @tparam genType Floating-point or integer scalar types
33 template<typename genType>
34 GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, genType const& epsilon);
35
36 /// Returns the component-wise comparison of |x - y| >= epsilon.
37 /// True if this expression is not satisfied.
38 ///
39 /// @tparam genType Floating-point or integer scalar types
40 template<typename genType>
41 GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, genType const& epsilon);
42
43 /// Returns the component-wise comparison between two scalars in term of ULPs.
44 /// True if this expression is satisfied.
45 ///
46 /// @param x First operand.
47 /// @param y Second operand.
48 /// @param ULPs Maximum difference in ULPs between the two operators to consider them equal.
49 ///
50 /// @tparam genType Floating-point or integer scalar types
51 template<typename genType>
52 GLM_FUNC_DECL GLM_CONSTEXPR bool equal(genType const& x, genType const& y, int ULPs);
53
54 /// Returns the component-wise comparison between two scalars in term of ULPs.
55 /// True if this expression is not satisfied.
56 ///
57 /// @param x First operand.
58 /// @param y Second operand.
59 /// @param ULPs Maximum difference in ULPs between the two operators to consider them not equal.
60 ///
61 /// @tparam genType Floating-point or integer scalar types
62 template<typename genType>
63 GLM_FUNC_DECL GLM_CONSTEXPR bool notEqual(genType const& x, genType const& y, int ULPs);
64
65 /// @}
66}//namespace glm
67
68#include "scalar_relational.inl"