summaryrefslogtreecommitdiff
path: root/src/glm/gtx/projection.inl
blob: 51eb4c5d1ea0365f97cf5d840701be83a4cf6ef0 (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
///////////////////////////////////////////////////////////////////////////////////////////////////
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
///////////////////////////////////////////////////////////////////////////////////////////////////
// Created : 2005-12-21
// Updated : 2009-03-06
// Licence : This source is under MIT License
// File    : glm/gtx/projection.inl
///////////////////////////////////////////////////////////////////////////////////////////////////

namespace glm{
namespace gtx{
namespace projection{

template <typename T> 
GLM_FUNC_QUALIFIER detail::tvec2<T> proj(
	detail::tvec2<T> const & x, 
	detail::tvec2<T> const & Normal)
{
	return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
}

template <typename T> 
GLM_FUNC_QUALIFIER detail::tvec3<T> proj(
	detail::tvec3<T> const & x, 
	detail::tvec3<T> const & Normal)
{
	return dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
}

template <typename T> 
GLM_FUNC_QUALIFIER detail::tvec4<T> proj(
	detail::tvec4<T> const & x, 
	detail::tvec4<T> const & Normal)
{
	return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
}

}//namespace projection
}//namespace gtx
}//namespace glm