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 namespace gtx{
00027 namespace intersect     
00028 {
00031 
00034         template <typename genType>
00035         bool intersectRayTriangle(
00036                 genType const & orig, genType const & dir,
00037                 genType const & vert0, genType const & vert1, genType const & vert2,
00038                 genType & baryPosition);
00039 
00042         template <typename genType>
00043         bool intersectLineTriangle(
00044                 genType const & orig, genType const & dir,
00045                 genType const & vert0, genType const & vert1, genType const & vert2,
00046                 genType & position);
00047 
00050         template <typename genType>
00051         bool intersectRaySphere(
00052                 genType const & orig, genType const & dir,
00053                 genType const & center, typename genType::value_type radius,
00054                 genType & position, genType & normal);
00055 
00058         template <typename genType>
00059         bool intersectLineSphere(
00060                 genType const & point0, genType const & point1,
00061                 genType const & center, typename genType::value_type radius,
00062                 genType & position, genType & normal);
00063 
00065 }//namespace intersect
00066 }//namespace gtx
00067 }//namespace glm
00068 
00069 #include "intersect.inl"
00070 
00071 namespace glm{using namespace gtx::intersect;}
00072 
00073 #endif//glm_gtx_intersect