• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /// @ref gtx_vector_query
2 /// @file glm/gtx/vector_query.hpp
3 ///
4 /// @see core (dependence)
5 ///
6 /// @defgroup gtx_vector_query GLM_GTX_vector_query
7 /// @ingroup gtx
8 ///
9 /// @brief Query informations of vector types
10 ///
11 /// <glm/gtx/vector_query.hpp> need to be included to use these functionalities.
12 
13 #pragma once
14 
15 // Dependency:
16 #include "../glm.hpp"
17 #include <cfloat>
18 #include <limits>
19 
20 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
21 #	pragma message("GLM: GLM_GTX_vector_query extension included")
22 #endif
23 
24 namespace glm
25 {
26 	/// @addtogroup gtx_vector_query
27 	/// @{
28 
29 	//! Check whether two vectors are collinears.
30 	/// @see gtx_vector_query extensions.
31 	template <typename T, precision P, template <typename, precision> class vecType>
32 	GLM_FUNC_DECL bool areCollinear(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
33 
34 	//! Check whether two vectors are orthogonals.
35 	/// @see gtx_vector_query extensions.
36 	template <typename T, precision P, template <typename, precision> class vecType>
37 	GLM_FUNC_DECL bool areOrthogonal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
38 
39 	//! Check whether a vector is normalized.
40 	/// @see gtx_vector_query extensions.
41 	template <typename T, precision P, template <typename, precision> class vecType>
42 	GLM_FUNC_DECL bool isNormalized(vecType<T, P> const & v, T const & epsilon);
43 
44 	//! Check whether a vector is null.
45 	/// @see gtx_vector_query extensions.
46 	template <typename T, precision P, template <typename, precision> class vecType>
47 	GLM_FUNC_DECL bool isNull(vecType<T, P> const & v, T const & epsilon);
48 
49 	//! Check whether a each component of a vector is null.
50 	/// @see gtx_vector_query extensions.
51 	template <typename T, precision P, template <typename, precision> class vecType>
52 	GLM_FUNC_DECL vecType<bool, P> isCompNull(vecType<T, P> const & v, T const & epsilon);
53 
54 	//! Check whether two vectors are orthonormal.
55 	/// @see gtx_vector_query extensions.
56 	template <typename T, precision P, template <typename, precision> class vecType>
57 	GLM_FUNC_DECL bool areOrthonormal(vecType<T, P> const & v0, vecType<T, P> const & v1, T const & epsilon);
58 
59 	/// @}
60 }// namespace glm
61 
62 #include "vector_query.inl"
63