master
ブランチ master
VulkanExample / dep / include / glm / ext / vector_relational.hpp
4.5 KB、107行 生 Blame 履歴
1/// @ref ext_vector_relational
2/// @file glm/ext/vector_relational.hpp
3///
4/// @see core (dependence)
5/// @see ext_scalar_integer (dependence)
6///
7/// @defgroup ext_vector_relational GLM_EXT_vector_relational
8/// @ingroup ext
9///
10/// Exposes comparison functions for vector types that take a user defined epsilon values.
11///
12/// Include <glm/ext/vector_relational.hpp> to use the features of this extension.
13///
14/// @see core_vector_relational
15/// @see ext_scalar_relational
16/// @see ext_matrix_relational
17
18#pragma once
19
20// Dependencies
21#include "../detail/qualifier.hpp"
22
23#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
24# pragma message("GLM: GLM_EXT_vector_relational extension included")
25#endif
26
27namespace glm
28{
29 /// @addtogroup ext_vector_relational
30 /// @{
31
32 /// Returns the component-wise comparison of |x - y| < epsilon.
33 /// True if this expression is satisfied.
34 ///
35 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
36 /// @tparam T Floating-point or integer scalar types
37 /// @tparam Q Value from qualifier enum
38 template<length_t L, typename T, qualifier Q>
39 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon);
40
41 /// Returns the component-wise comparison of |x - y| < epsilon.
42 /// True if this expression is satisfied.
43 ///
44 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
45 /// @tparam T Floating-point or integer scalar types
46 /// @tparam Q Value from qualifier enum
47 template<length_t L, typename T, qualifier Q>
48 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon);
49
50 /// Returns the component-wise comparison of |x - y| >= epsilon.
51 /// True if this expression is not satisfied.
52 ///
53 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
54 /// @tparam T Floating-point or integer scalar types
55 /// @tparam Q Value from qualifier enum
56 template<length_t L, typename T, qualifier Q>
57 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, T epsilon);
58
59 /// Returns the component-wise comparison of |x - y| >= epsilon.
60 /// True if this expression is not satisfied.
61 ///
62 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
63 /// @tparam T Floating-point or integer scalar types
64 /// @tparam Q Value from qualifier enum
65 template<length_t L, typename T, qualifier Q>
66 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, T, Q> const& epsilon);
67
68 /// Returns the component-wise comparison between two vectors in term of ULPs.
69 /// True if this expression is satisfied.
70 ///
71 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
72 /// @tparam T Floating-point
73 /// @tparam Q Value from qualifier enum
74 template<length_t L, typename T, qualifier Q>
75 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs);
76
77 /// Returns the component-wise comparison between two vectors in term of ULPs.
78 /// True if this expression is satisfied.
79 ///
80 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
81 /// @tparam T Floating-point
82 /// @tparam Q Value from qualifier enum
83 template<length_t L, typename T, qualifier Q>
84 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> equal(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs);
85
86 /// Returns the component-wise comparison between two vectors in term of ULPs.
87 /// True if this expression is not satisfied.
88 ///
89 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
90 /// @tparam T Floating-point
91 /// @tparam Q Value from qualifier enum
92 template<length_t L, typename T, qualifier Q>
93 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, int ULPs);
94
95 /// Returns the component-wise comparison between two vectors in term of ULPs.
96 /// True if this expression is not satisfied.
97 ///
98 /// @tparam L Integer between 1 and 4 included that qualify the dimension of the vector
99 /// @tparam T Floating-point
100 /// @tparam Q Value from qualifier enum
101 template<length_t L, typename T, qualifier Q>
102 GLM_FUNC_DECL GLM_CONSTEXPR vec<L, bool, Q> notEqual(vec<L, T, Q> const& x, vec<L, T, Q> const& y, vec<L, int, Q> const& ULPs);
103
104 /// @}
105}//namespace glm
106
107#include "vector_relational.inl"