intersect.hpp

00001 
00002 // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
00004 // Created : 2007-04-03
00005 // Updated : 2009-01-20
00006 // Licence : This source is under MIT License
00007 // File    : glm/gtx/intersect.hpp
00009 // Dependency:
00010 // - GLM core
00011 // - GLM_GTX_closest_point
00013 
00014 #ifndef glm_gtx_intersect
00015 #define glm_gtx_intersect
00016 
00017 // Dependency:
00018 #include "../glm.hpp"
00019 #include "../gtx/closest_point.hpp"
00020 
00021 #if(defined(GLM_MESSAGES) && !defined(glm_ext))
00022 #       pragma message("GLM: GLM_GTX_closest_point extension included")
00023 #endif
00024 
00025 namespace glm
00026 {
00027         namespace test{
00028                 void main_gtx_intesect();
00029         }//namespace test
00030 
00031         namespace gtx{
00033         namespace intersect
00034         {
00037 
00040                 template <typename genType>
00041                 bool intersectRayTriangle(
00042                         genType const & orig, genType const & dir,
00043                         genType const & vert0, genType const & vert1, genType const & vert2,
00044                         genType & baryPosition);
00045 
00048                 template <typename genType>
00049                 bool intersectLineTriangle(
00050                         genType const & orig, genType const & dir,
00051                         genType const & vert0, genType const & vert1, genType const & vert2,
00052                         genType & position);
00053 
00056                 template <typename genType>
00057                 bool intersectRaySphere(
00058                         genType const & orig, genType const & dir,
00059                         genType const & center, typename genType::value_type radius,
00060                         genType & position, genType & normal);
00061 
00064                 template <typename genType>
00065                 bool intersectLineSphere(
00066                         genType const & point0, genType const & point1,
00067                         genType const & center, typename genType::value_type radius,
00068                         genType & position, genType & normal);
00069 
00071 
00072         }//namespace intersect
00073 }//namespace gtx
00074 }//namespace glm
00075 
00076 #include "intersect.inl"
00077 
00078 namespace glm{using namespace gtx::intersect;}
00079 
00080 #endif//glm_gtx_intersect