GLM  0.9.5
intersect.hpp
Go to the documentation of this file.
1 
39 #ifndef GLM_GTX_intersect
40 #define GLM_GTX_intersect
41 
42 // Dependency:
43 #include "../glm.hpp"
44 #include "../gtx/closest_point.hpp"
45 
46 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
47 # pragma message("GLM: GLM_GTX_closest_point extension included")
48 #endif
49 
50 namespace glm
51 {
54 
58  template <typename genType>
59  bool intersectRayPlane(
60  genType const & orig, genType const & dir,
61  genType const & planeOrig, genType const & planeNormal,
62  typename genType::value_type & intersectionDistance);
63 
66  template <typename genType>
68  genType const & orig, genType const & dir,
69  genType const & vert0, genType const & vert1, genType const & vert2,
70  genType & baryPosition);
71 
74  template <typename genType>
76  genType const & orig, genType const & dir,
77  genType const & vert0, genType const & vert1, genType const & vert2,
78  genType & position);
79 
83  template <typename genType>
84  bool intersectRaySphere(
85  genType const & rayStarting, genType const & rayNormalizedDirection,
86  genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered,
87  typename genType::value_type & intersectionDistance);
88 
91  template <typename genType>
92  bool intersectRaySphere(
93  genType const & rayStarting, genType const & rayNormalizedDirection,
94  genType const & sphereCenter, const typename genType::value_type sphereRadius,
95  genType & intersectionPosition, genType & intersectionNormal);
96 
99  template <typename genType>
100  bool intersectLineSphere(
101  genType const & point0, genType const & point1,
102  genType const & sphereCenter, typename genType::value_type sphereRadius,
103  genType & intersectionPosition1, genType & intersectionNormal1,
104  genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType());
105 
107 }//namespace glm
108 
109 #include "intersect.inl"
110 
111 #endif//GLM_GTX_intersect
bool intersectLineTriangle(genType const &orig, genType const &dir, genType const &vert0, genType const &vert1, genType const &vert2, genType &position)
Compute the intersection of a line and a triangle.
bool intersectRayPlane(genType const &orig, genType const &dir, genType const &planeOrig, genType const &planeNormal, typename genType::value_type &intersectionDistance)
Compute the intersection of a ray and a triangle.
bool intersectRaySphere(genType const &rayStarting, genType const &rayNormalizedDirection, genType const &sphereCenter, typename genType::value_type const sphereRadiusSquered, typename genType::value_type &intersectionDistance)
Compute the intersection distance of a ray and a sphere.
bool intersectLineSphere(genType const &point0, genType const &point1, genType const &sphereCenter, typename genType::value_type sphereRadius, genType &intersectionPosition1, genType &intersectionNormal1, genType &intersectionPosition2=genType(), genType &intersectionNormal2=genType())
Compute the intersection of a line and a sphere.
bool intersectRayTriangle(genType const &orig, genType const &dir, genType const &vert0, genType const &vert1, genType const &vert2, genType &baryPosition)
Compute the intersection of a ray and a triangle.