normalize_dot.hpp 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /// @ref gtx_normalize_dot
  2. /// @file glm/gtx/normalize_dot.hpp
  3. ///
  4. /// @see core (dependence)
  5. /// @see gtx_fast_square_root (dependence)
  6. ///
  7. /// @defgroup gtx_normalize_dot GLM_GTX_normalize_dot
  8. /// @ingroup gtx
  9. ///
  10. /// Include <glm/gtx/normalized_dot.hpp> to use the features of this extension.
  11. ///
  12. /// Dot product of vectors that need to be normalize with a single square root.
  13. #pragma once
  14. // Dependency:
  15. #include "../gtx/fast_square_root.hpp"
  16. #if GLM_MESSAGES == GLM_ENABLE && !defined(GLM_EXT_INCLUDED)
  17. # ifndef GLM_ENABLE_EXPERIMENTAL
  18. # pragma message("GLM: GLM_GTX_normalize_dot 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. # else
  20. # pragma message("GLM: GLM_GTX_normalize_dot extension included")
  21. # endif
  22. #endif
  23. namespace glm
  24. {
  25. /// @addtogroup gtx_normalize_dot
  26. /// @{
  27. /// Normalize parameters and returns the dot product of x and y.
  28. /// It's faster that dot(normalize(x), normalize(y)).
  29. ///
  30. /// @see gtx_normalize_dot extension.
  31. template<length_t L, typename T, qualifier Q>
  32. GLM_FUNC_DECL T normalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
  33. /// Normalize parameters and returns the dot product of x and y.
  34. /// Faster that dot(fastNormalize(x), fastNormalize(y)).
  35. ///
  36. /// @see gtx_normalize_dot extension.
  37. template<length_t L, typename T, qualifier Q>
  38. GLM_FUNC_DECL T fastNormalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y);
  39. /// @}
  40. }//namespace glm
  41. #include "normalize_dot.inl"