summaryrefslogtreecommitdiff
path: root/src/glm/gtx/projection.inl
diff options
context:
space:
mode:
Diffstat (limited to 'src/glm/gtx/projection.inl')
-rw-r--r--src/glm/gtx/projection.inl40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/glm/gtx/projection.inl b/src/glm/gtx/projection.inl
new file mode 100644
index 0000000..51eb4c5
--- /dev/null
+++ b/src/glm/gtx/projection.inl
@@ -0,0 +1,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