ultimatepp/uppsrc/plugin/glm/gtx/normalize_dot.inl
cxl 1915662d51 plugin/glm, ide: Improved install
git-svn-id: svn://ultimatepp.org/upp/trunk@12737 f0d560ea-af0d-0410-9eb7-867de7ffcac7
2019-02-04 10:59:57 +00:00

16 lines
492 B
C++

/// @ref gtx_normalize_dot
namespace glm
{
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T normalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
}
template<length_t L, typename T, qualifier Q>
GLM_FUNC_QUALIFIER T fastNormalizeDot(vec<L, T, Q> const& x, vec<L, T, Q> const& y)
{
return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y));
}
}//namespace glm