vector_query.hpp 2.1 KB

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