summaryrefslogtreecommitdiff
path: root/src/glm/gtx/normalize_dot.hpp
blob: 444fd9512a3a5b8fea31b5e2f7f545b47cf301e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
//////////////////////////////////////////////////////////////////////////////////
// Created : 2007-09-28
// Updated : 2008-10-07
// Licence : This source is under MIT License
// File    : glm/gtx/normalize_dot.hpp
//////////////////////////////////////////////////////////////////////////////////
// Dependency:
// - GLM core
// - GLM_GTX_fast_square_root
//////////////////////////////////////////////////////////////////////////////////

#ifndef glm_gtx_normalize_dot
#define glm_gtx_normalize_dot

// Dependency:
#include "../glm.hpp"
#include "../gtx/fast_square_root.hpp"

#if(defined(GLM_MESSAGES) && !defined(glm_ext))
#	pragma message("GLM: GLM_GTX_normalize_dot extension included")
#endif

namespace glm{
namespace gtx{
namespace normalize_dot	///< GLM_GTX_normalize_dot extension: Dot product of vectors that need to be normalize with a single square root.
{
	using namespace gtx::fast_square_root;

	/// \addtogroup gtx_normalize_dot
	/// @{

	//! Normalize parameters and returns the dot product of x and y.
	//! It's faster that dot(normalize(x), normalize(y)).
	//! From GLM_GTX_normalize_dot extension.
	template <typename genType> 
	typename genType::value_type normalizeDot(
		genType const & x, 
		genType const & y);

	//! Normalize parameters and returns the dot product of x and y.
	//! Faster that dot(fastNormalize(x), fastNormalize(y)).
	//! From GLM_GTX_normalize_dot extension.
	template <typename genType> 
	typename genType::value_type fastNormalizeDot(
		genType const & x, 
		genType const & y);

	/// @}
}//namespace normalize_dot
}//namespace gtx
}//namespace glm

#include "normalize_dot.inl"

namespace glm{using namespace gtx::normalize_dot;}

#endif//glm_gtx_normalize_dot