master
ブランチ master
ShaderPlayground / deps / glm / glm / gtx / vector_query.hpp
2.1 KB、66行 生 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 informations 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#endif
23
24#if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
25# pragma message("GLM: GLM_GTX_vector_query extension included")
26#endif
27
28namespace glm
29{
30 /// @addtogroup gtx_vector_query
31 /// @{
32
33 //! Check whether two vectors are collinears.
34 /// @see gtx_vector_query extensions.
35 template<length_t L, typename T, qualifier Q>
36 GLM_FUNC_DECL bool areCollinear(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
37
38 //! Check whether two vectors are orthogonals.
39 /// @see gtx_vector_query extensions.
40 template<length_t L, typename T, qualifier Q>
41 GLM_FUNC_DECL bool areOrthogonal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
42
43 //! Check whether a vector is normalized.
44 /// @see gtx_vector_query extensions.
45 template<length_t L, typename T, qualifier Q>
46 GLM_FUNC_DECL bool isNormalized(vec<L, T, Q> const& v, T const& epsilon);
47
48 //! Check whether a vector is null.
49 /// @see gtx_vector_query extensions.
50 template<length_t L, typename T, qualifier Q>
51 GLM_FUNC_DECL bool isNull(vec<L, T, Q> const& v, T const& epsilon);
52
53 //! Check whether a each component of a vector is null.
54 /// @see gtx_vector_query extensions.
55 template<length_t L, typename T, qualifier Q>
56 GLM_FUNC_DECL vec<L, bool, Q> isCompNull(vec<L, T, Q> const& v, T const& epsilon);
57
58 //! Check whether two vectors are orthonormal.
59 /// @see gtx_vector_query extensions.
60 template<length_t L, typename T, qualifier Q>
61 GLM_FUNC_DECL bool areOrthonormal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
62
63 /// @}
64}// namespace glm
65
66#include "vector_query.inl"