closest_point.hpp 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. #endif
  18. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  19. # pragma message("GLM: GLM_GTX_closest_point extension included")
  20. #endif
  21. namespace glm
  22. {
  23. /// @addtogroup gtx_closest_point
  24. /// @{
  25. /// Find the point on a straight line which is the closet of a point.
  26. /// @see gtx_closest_point
  27. template<typename T, qualifier Q>
  28. GLM_FUNC_DECL vec<3, T, Q> closestPointOnLine(
  29. vec<3, T, Q> const& point,
  30. vec<3, T, Q> const& a,
  31. vec<3, T, Q> const& b);
  32. /// 2d lines work as well
  33. template<typename T, qualifier Q>
  34. GLM_FUNC_DECL vec<2, T, Q> closestPointOnLine(
  35. vec<2, T, Q> const& point,
  36. vec<2, T, Q> const& a,
  37. vec<2, T, Q> const& b);
  38. /// @}
  39. }// namespace glm
  40. #include "closest_point.inl"