1b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/////////////////////////////////////////////////////////////////////////////////// 2b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// OpenGL Mathematics (glm.g-truc.net) 3b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 4b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// Copyright (c) 2005 - 2014 G-Truc Creation (www.g-truc.net) 5b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// Permission is hereby granted, free of charge, to any person obtaining a copy 6b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// of this software and associated documentation files (the "Software"), to deal 7b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// in the Software without restriction, including without limitation the rights 8b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// copies of the Software, and to permit persons to whom the Software is 10b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// furnished to do so, subject to the following conditions: 11b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 12b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// The above copyright notice and this permission notice shall be included in 13b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// all copies or substantial portions of the Software. 14b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 15b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// THE SOFTWARE. 22b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 23b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @ref core 24b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @file glm/core/func_vector_relational.hpp 25b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @date 2008-08-03 / 2011-06-15 26b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @author Christophe Riccio 27b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 28b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @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> 29b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 30b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @defgroup core_func_vector_relational Vector Relational Functions 31b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// @ingroup core 32b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 33b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// Relational and equality operators (<, <=, >, >=, ==, !=) are defined to 34b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// operate on scalars and produce scalar Boolean results. For vector results, 35b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// use the following built-in functions. 36b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// 37b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// In all cases, the sizes of all the input and return vectors for any particular 38b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/// call must match. 39b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG/////////////////////////////////////////////////////////////////////////////////// 40b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 41b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#ifndef GLM_CORE_func_vector_relational 42b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#define GLM_CORE_func_vector_relational 43b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 44b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "precision.hpp" 45b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "setup.hpp" 46b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 47b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#if !((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER <= GLM_COMPILER_VC10)) // Workaround a Visual C++ bug 48b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 49b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarGnamespace glm 50b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG{ 51b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @addtogroup core_func_vector_relational 52b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @{ 53b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 54b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison result of x < y. 55b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 56b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point or integer vector types. 57b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 58b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThan.xml">GLSL lessThan man page</a> 59b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 60b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG // TODO: Mismatched 61b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG //template <typename T, precision P, template <typename, precision> class vecType> 62b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG //GLM_FUNC_DECL typename vecType<T, P>::bool_type lessThan(vecType<T, P> const & x, vecType<T, P> const & y); 63b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 64b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison of result x <= y. 65b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 66b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point or integer vector types. 67b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 68b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/lessThanEqual.xml">GLSL lessThanEqual man page</a> 69b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 70b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P, template <typename, precision> class vecType> 71b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL typename vecType<T, P>::bool_type lessThanEqual(vecType<T, P> const & x, vecType<T, P> const & y); 72b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 73b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison of result x > y. 74b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 75b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point or integer vector types. 76b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 77b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThan.xml">GLSL greaterThan man page</a> 78b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 79b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P, template <typename, precision> class vecType> 80b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL typename vecType<T, P>::bool_type greaterThan(vecType<T, P> const & x, vecType<T, P> const & y); 81b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 82b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison of result x >= y. 83b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 84b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point or integer vector types. 85b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 86b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/greaterThanEqual.xml">GLSL greaterThanEqual man page</a> 87b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 88b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P, template <typename, precision> class vecType> 89b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL typename vecType<T, P>::bool_type greaterThanEqual(vecType<T, P> const & x, vecType<T, P> const & y); 90b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 91b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison of result x == y. 92b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 93b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point, integer or boolean vector types. 94b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 95b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/equal.xml">GLSL equal man page</a> 96b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 97b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG //TODO: conflicts with definision 98b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG //template <typename T, precision P, template <typename, precision> class vecType> 99b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG //GLM_FUNC_DECL typename vecType<T, P>::bool_type equal(vecType<T, P> const & x, vecType<T, P> const & y); 100b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 101b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise comparison of result x != y. 102b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 103b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Floating-point, integer or boolean vector types. 104b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 105b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/notEqual.xml">GLSL notEqual man page</a> 106b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 107b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <typename T, precision P, template <typename, precision> class vecType> 108b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL typename vecType<T, P>::bool_type notEqual(vecType<T, P> const & x, vecType<T, P> const & y); 109b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 110b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns true if any component of x is true. 111b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 112b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Boolean vector types. 113b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 114b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/any.xml">GLSL any man page</a> 115b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 116b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <precision P, template <typename, precision> class vecType> 117b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL bool any(vecType<bool, P> const & v); 118b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 119b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns true if all components of x are true. 120b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 121b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Boolean vector types. 122b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 123b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/all.xml">GLSL all man page</a> 124b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 125b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <precision P, template <typename, precision> class vecType> 126b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL bool all(vecType<bool, P> const & v); 127b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 128b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// Returns the component-wise logical complement of x. 129b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// /!\ Because of language incompatibilities between C++ and GLSL, GLM defines the function not but not_ instead. 130b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 131b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @tparam vecType Boolean vector types. 132b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// 133b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @see <a href="http://www.opengl.org/sdk/docs/manglsl/xhtml/not.xml">GLSL not man page</a> 134b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @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> 135b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG template <precision P, template <typename, precision> class vecType> 136b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG GLM_FUNC_DECL vecType<bool, P> not_(vecType<bool, P> const & v); 137b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 138b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG /// @} 139b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG}//namespace glm 140b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 141b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#endif 142b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 143b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#include "func_vector_relational.inl" 144b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG 145b0b195df6c4343219e339ccb37978e8432a5f871Tony-LunarG#endif//GLM_CORE_func_vector_relational 146