Rev Author Line No. Line
23 ovan 1 ///////////////////////////////////////////////////////////////////////////////////
2 /// OpenGL Mathematics (glm.g-truc.net)
3 ///
4 /// Copyright (c) 2005 - 2015 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 /// Restrictions:
16 ///             By making use of the Software for military purposes, you choose to make
17 ///             a Bunny unhappy.
18 ///
19 /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 /// THE SOFTWARE.
26 ///
27 /// @ref core
28 /// @file glm/detail/func_vector_relational.hpp
29 /// @date 2008-08-03 / 2011-06-15
30 /// @author Christophe Riccio
31 ///
32 /// @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>
33 ///
34 /// @defgroup core_func_vector_relational Vector Relational Functions
35 /// @ingroup core
36 ///
37 /// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to
38 /// operate on scalars and produce scalar Boolean results. For vector results,
39 /// use the following built-in functions.
40 ///
41 /// In all cases, the sizes of all the input and return vectors for any particular
42 /// call must match.
43 ///////////////////////////////////////////////////////////////////////////////////
44  
45 #pragma once
46  
47 #include "precision.hpp"
48 #include "setup.hpp"
49  
50 namespace glm
51 {
52         /// @addtogroup core_func_vector_relational
53         /// @{
54  
55         /// Returns the component-wise comparison result of x < y.
56         ///
57         /// @tparam vecType Floating-point or integer vector types.
58         ///
59         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a>
60         /// @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>
61         template <typename T, precision P, template <typename, precision> class vecType>
62         GLM_FUNC_DECL vecType<bool, P> lessThan(vecType<T, P> const & x, vecType<T, P> const & y);
63  
64         /// Returns the component-wise comparison of result x <= y.
65         ///
66         /// @tparam vecType Floating-point or integer vector types.
67         ///
68         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a>
69         /// @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>
70         template <typename T, precision P, template <typename, precision> class vecType>
71         GLM_FUNC_DECL vecType<bool, P> lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
72  
73         /// Returns the component-wise comparison of result x > y.
74         ///
75         /// @tparam vecType Floating-point or integer vector types.
76         ///
77         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a>
78         /// @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>
79         template <typename T, precision P, template <typename, precision> class vecType>
80         GLM_FUNC_DECL vecType<bool, P> greaterThan(vecType<T, P> const & x, vecType<T, P> const & y);
81  
82         /// Returns the component-wise comparison of result x >= y.
83         ///
84         /// @tparam vecType Floating-point or integer vector types.
85         ///
86         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a>
87         /// @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>
88         template <typename T, precision P, template <typename, precision> class vecType>
89         GLM_FUNC_DECL vecType<bool, P> greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y);
90  
91         /// Returns the component-wise comparison of result x == y.
92         ///
93         /// @tparam vecType Floating-point, integer or boolean vector types.
94         ///
95         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a>
96         /// @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>
97         template <typename T, precision P, template <typename, precision> class vecType>
98         GLM_FUNC_DECL vecType<bool, P> equal(vecType<T, P> const & x, vecType<T, P> const & y);
99  
100         /// Returns the component-wise comparison of result x != y.
101         ///
102         /// @tparam vecType Floating-point, integer or boolean vector types.
103         ///
104         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a>
105         /// @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>
106         template <typename T, precision P, template <typename, precision> class vecType>
107         GLM_FUNC_DECL vecType<bool, P> notEqual(vecType<T, P> const & x, vecType<T, P> const & y);
108  
109         /// Returns true if any component of x is true.
110         ///
111         /// @tparam vecType Boolean vector types.
112         ///
113         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a>
114         /// @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>
115         template <precision P, template <typename, precision> class vecType>
116         GLM_FUNC_DECL bool any(vecType<bool, P> const & v);
117  
118         /// Returns true if all components of x are true.
119         ///
120         /// @tparam vecType Boolean vector types.
121         ///
122         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a>
123         /// @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>
124         template <precision P, template <typename, precision> class vecType>
125         GLM_FUNC_DECL bool all(vecType<bool, P> const & v);
126  
127         /// Returns the component-wise logical complement of x.
128         /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead.
129         ///
130         /// @tparam vecType Boolean vector types.
131         ///
132         /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a>
133         /// @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>
134         template <precision P, template <typename, precision> class vecType>
135         GLM_FUNC_DECL vecType<bool, P> not_(vecType<bool, P> const & v);
136  
137         /// @}
138 }//namespace glm
139  
140 #include "func_vector_relational.inl"