vector_query.hpp 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #include <cfloat>
  16. #include <limits>
  17. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # ifndef GLM_ENABLE_EXPERIMENTAL
  19. # pragma message("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.")
  20. # else
  21. # pragma message("GLM: GLM_GTX_vector_query extension included")
  22. # endif
  23. #endif
  24. namespace glm
  25. {
  26. /// @addtogroup gtx_vector_query
  27. /// @{
  28. //! Check whether two vectors are collinears.
  29. /// @see gtx_vector_query extensions.
  30. template<length_t L, typename T, qualifier Q>
  31. GLM_FUNC_DECL bool areCollinear(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
  32. //! Check whether two vectors are orthogonals.
  33. /// @see gtx_vector_query extensions.
  34. template<length_t L, typename T, qualifier Q>
  35. GLM_FUNC_DECL bool areOrthogonal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
  36. //! Check whether a vector is normalized.
  37. /// @see gtx_vector_query extensions.
  38. template<length_t L, typename T, qualifier Q>
  39. GLM_FUNC_DECL bool isNormalized(vec<L, T, Q> const& v, T const& epsilon);
  40. //! Check whether a vector is null.
  41. /// @see gtx_vector_query extensions.
  42. template<length_t L, typename T, qualifier Q>
  43. GLM_FUNC_DECL bool isNull(vec<L, T, Q> const& v, T const& epsilon);
  44. //! Check whether a each component of a vector is null.
  45. /// @see gtx_vector_query extensions.
  46. template<length_t L, typename T, qualifier Q>
  47. GLM_FUNC_DECL vec<L, bool, Q> isCompNull(vec<L, T, Q> const& v, T const& epsilon);
  48. //! Check whether two vectors are orthonormal.
  49. /// @see gtx_vector_query extensions.
  50. template<length_t L, typename T, qualifier Q>
  51. GLM_FUNC_DECL bool areOrthonormal(vec<L, T, Q> const& v0, vec<L, T, Q> const& v1, T const& epsilon);
  52. /// @}
  53. }// namespace glm
  54. #include "vector_query.inl"