vector_query.hpp 2.2 KB

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