aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/glm/gtx/normalize_dot.inl
blob: 9c720b43456f295ab3c128f51e74a691d67a2410 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
/// @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