normalize_dot.inl 492 B

12345678910111213141516
  1. /// @ref gtx_normalize_dot
  2. namespace glm
  3. {
  4. template<length_t L, typename T, qualifier Q>
  5. GLM_FUNC_QUALIFIER T normalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
  6. {
  7. return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
  8. }
  9. template<length_t L, typename T, qualifier Q>
  10. GLM_FUNC_QUALIFIER T fastNormalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
  11. {
  12. return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y));
  13. }
  14. }//namespace glm