closest_point.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /// @ref gtx_closest_point
  2. /// @file glm/gtx/closest_point.hpp
  3. ///
  4. /// @see core (dependence)
  5. ///
  6. /// @defgroup gtx_closest_point GLM_GTX_closest_point
  7. /// @ingroup gtx
  8. ///
  9. /// Include <glm/gtx/closest_point.hpp> to use the features of this extension.
  10. ///
  11. /// Find the point on a straight line which is the closet of a point.
  12. #pragma once
  13. // Dependency:
  14. #include "../glm.hpp"
  15. #ifndef GLM_ENABLE_EXPERIMENTAL
  16. # error "GLM: GLM_GTX_closest_point 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."
  17. #elif GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  18. # pragma message("GLM: GLM_GTX_closest_point extension included")
  19. #endif
  20. namespace glm
  21. {
  22. /// @addtogroup gtx_closest_point
  23. /// @{
  24. /// Find the point on a straight line which is the closet of a point.
  25. /// @see gtx_closest_point
  26. template<typename T, qualifier Q>
  27. GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine(
  28. vec<3, T, Q> const& point,
  29. vec<3, T, Q> const& a,
  30. vec<3, T, Q> const& b);
  31. /// 2d lines work as well
  32. template<typename T, qualifier Q>
  33. GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine(
  34. vec<2, T, Q> const& point,
  35. vec<2, T, Q> const& a,
  36. vec<2, T, Q> const& b);
  37. /// @}
  38. }// namespace glm
  39. #include "closest_point.inl"