1 /// @ref core
2 /// @file glm/detail/func_vector_relational.hpp
3 ///
4 /// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
5 ///
6 /// @defgroup core_func_vector_relational Vector Relational Functions
7 /// @ingroup core
8 ///
9 /// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
10 /// operate on scalars and produce scalar Boolean results. For vector results,
11 /// use the following built-in functions.
12 ///
13 /// In all cases, the sizes of all the input and return vectors for any particular
14 /// call must match.
15 
16 #pragma once
17 
18 #include "precision.hpp"
19 #include "setup.hpp"
20 
21 namespace glm
22 {
23 	/// @addtogroup core_func_vector_relational
24 	/// @{
25 
26 	/// Returns the component-wise comparison result of x < y.
27 	///
28 	/// @tparam vecType Floating-point or integer vector types.
29 	///
30 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
31 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
32 	template <typename T, precision P, template <typename, precision> class vecType>
33 	GLM_FUNC_DECL vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y);
34 
35 	/// Returns the component-wise comparison of result x <= y.
36 	///
37 	/// @tparam vecType Floating-point or integer vector types.
38 	///
39 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
40 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
41 	template <typename T, precision P, template <typename, precision> class vecType>
42 	GLM_FUNC_DECL vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
43 
44 	/// Returns the component-wise comparison of result x > y.
45 	///
46 	/// @tparam vecType Floating-point or integer vector types.
47 	///
48 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
49 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
50 	template <typename T, precision P, template <typename, precision> class vecType>
51 	GLM_FUNC_DECL vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y);
52 
53 	/// Returns the component-wise comparison of result x >= y.
54 	///
55 	/// @tparam vecType Floating-point or integer vector types.
56 	///
57 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
58 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
59 	template <typename T, precision P, template <typename, precision> class vecType>
60 	GLM_FUNC_DECL vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
61 
62 	/// Returns the component-wise comparison of result x == y.
63 	///
64 	/// @tparam vecType Floating-point, integer or boolean vector types.
65 	///
66 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
67 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
68 	template <typename T, precision P, template <typename, precision> class vecType>
69 	GLM_FUNC_DECL vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y);
70 
71 	/// Returns the component-wise comparison of result x != y.
72 	///
73 	/// @tparam vecType Floating-point, integer or boolean vector types.
74 	///
75 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
76 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
77 	template <typename T, precision P, template <typename, precision> class vecType>
78 	GLM_FUNC_DECL vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y);
79 
80 	/// Returns true if any component of x is true.
81 	///
82 	/// @tparam vecType Boolean vector types.
83 	///
84 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
85 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
86 	template <precision P, template <typename, precision> class vecType>
87 	GLM_FUNC_DECL bool any(vecType<bool, P> const & v);
88 
89 	/// Returns true if all components of x are true.
90 	///
91 	/// @tparam vecType Boolean vector types.
92 	///
93 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
94 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
95 	template <precision P, template <typename, precision> class vecType>
96 	GLM_FUNC_DECL bool all(vecType<bool, P> const & v);
97 
98 	/// Returns the component-wise logical complement of x.
99 	/// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
100 	///
101 	/// @tparam vecType Boolean vector types.
102 	///
103 	/// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
104 	/// @see <a href="http://www.opengl.org/registry/doc/GLSLangSpec.4.20.8.pdf">GLSL 4.20.8 specification, section 8.7 Vector Relational Functions</a>
105 	template <precision P, template <typename, precision> class vecType>
106 	GLM_FUNC_DECL vecType<bool, P> not_(vecType<bool, P> const & v);
107 
108 	/// @}
109 }//namespace glm
110 
111 #include "func_vector_relational.inl"
112