summaryrefslogtreecommitdiff
path: root/src/glm/gtx/intersect.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/glm/gtx/intersect.hpp')
-rw-r--r--src/glm/gtx/intersect.hpp73
1 files changed, 73 insertions, 0 deletions
diff --git a/src/glm/gtx/intersect.hpp b/src/glm/gtx/intersect.hpp
new file mode 100644
index 0000000..df5e083
--- /dev/null
+++ b/src/glm/gtx/intersect.hpp
@@ -0,0 +1,73 @@
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Created : 2007-04-03
+// Updated : 2009-01-20
+// Licence : This source is under MIT License
+// File : glm/gtx/intersect.hpp
+///////////////////////////////////////////////////////////////////////////////////////////////////
+// Dependency:
+// - GLM core
+// - GLM_GTX_closest_point
+///////////////////////////////////////////////////////////////////////////////////////////////////
+
+#ifndef glm_gtx_intersect
+#define glm_gtx_intersect
+
+// Dependency:
+#include "../glm.hpp"
+#include "../gtx/closest_point.hpp"
+
+#if(defined(GLM_MESSAGES) && !defined(glm_ext))
+# pragma message("GLM: GLM_GTX_closest_point extension included")
+#endif
+
+namespace glm{
+namespace gtx{
+namespace intersect ///< GLM_GTX_intersect extension: Add intersection functions
+{
+ /// \addtogroup gtx_intersect
+ /// @{
+
+ //! Compute the intersection of a ray and a triangle.
+ //! From GLM_GTX_intersect extension.
+ template <typename genType>
+ bool intersectRayTriangle(
+ genType const & orig, genType const & dir,
+ genType const & vert0, genType const & vert1, genType const & vert2,
+ genType & baryPosition);
+
+ //! Compute the intersection of a line and a triangle.
+ //! From GLM_GTX_intersect extension.
+ template <typename genType>
+ bool intersectLineTriangle(
+ genType const & orig, genType const & dir,
+ genType const & vert0, genType const & vert1, genType const & vert2,
+ genType & position);
+
+ //! Compute the intersection of a ray and a sphere.
+ //! From GLM_GTX_intersect extension.
+ template <typename genType>
+ bool intersectRaySphere(
+ genType const & orig, genType const & dir,
+ genType const & center, typename genType::value_type radius,
+ genType & position, genType & normal);
+
+ //! Compute the intersection of a line and a sphere.
+ //! From GLM_GTX_intersect extension
+ template <typename genType>
+ bool intersectLineSphere(
+ genType const & point0, genType const & point1,
+ genType const & center, typename genType::value_type radius,
+ genType & position, genType & normal);
+
+ /// @}
+}//namespace intersect
+}//namespace gtx
+}//namespace glm
+
+#include "intersect.inl"
+
+namespace glm{using namespace gtx::intersect;}
+
+#endif//glm_gtx_intersect