master
ブランチ master
VulkanExample / dep / include / glm / gtx / vector_query.hpp
2.2 KB、64行 生 Blame 履歴
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/// Include <glm/gtx/vector_query.hpp> to use the features of this extension.
10///
11/// Query information of vector types
12
13#pragma once
14
15// Dependency:
16#include "../glm.hpp"
17#include <cfloat>
18#include <limits>
19
20#ifndef GLM_ENABLE_EXPERIMENTAL
21# error "GLM: GLM_GTX_vector_query is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
22#elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
23# pragma message("GLM: GLM_GTX_vector_query extension included")
24#endif
25
26namespace glm
27{
28 /// @addtogroup gtx_vector_query
29 /// @{
30
31 //! Check whether two vectors are collinears.
32 /// @see gtx_vector_query extensions.
33 template<length_t L, typename T, qualifier Q>
34 GLM_FUNC_DECL bool areCollinear(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
35
36 //! Check whether two vectors are orthogonals.
37 /// @see gtx_vector_query extensions.
38 template<length_t L, typename T, qualifier Q>
39 GLM_FUNC_DECL bool areOrthogonal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
40
41 //! Check whether a vector is normalized.
42 /// @see gtx_vector_query extensions.
43 template<length_t L, typename T, qualifier Q>
44 GLM_FUNC_DECL bool isNormalized(vec<L, T, Q> const& v, T const& epsilon);
45
46 //! Check whether a vector is null.
47 /// @see gtx_vector_query extensions.
48 template<length_t L, typename T, qualifier Q>
49 GLM_FUNC_DECL bool isNull(vec<L, T, Q> const& v, T const& epsilon);
50
51 //! Check whether a each component of a vector is null.
52 /// @see gtx_vector_query extensions.
53 template<length_t L, typename T, qualifier Q>
54 GLM_FUNC_DECL vec<L, bool, Q> isCompNull(vec<L, T, Q> const& v, T const& epsilon);
55
56 //! Check whether two vectors are orthonormal.
57 /// @see gtx_vector_query extensions.
58 template<length_t L, typename T, qualifier Q>
59 GLM_FUNC_DECL bool areOrthonormal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
60
61 /// @}
62}// namespace glm
63
64#include "vector_query.inl"