0.9.6
intersect.hpp
Go to the documentation of this file.
1 
43 #pragma once
44 
45 // Dependency:
46 #include "../glm.hpp"
47 #include "../gtx/closest_point.hpp"
48 
49 #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
50 # pragma message("GLM: GLM_GTX_closest_point extension included")
51 #endif
52 
53 namespace glm
54 {
57 
61  template <typename genType>
62  GLM_FUNC_DECL bool intersectRayPlane(
63  genType const & orig, genType const & dir,
64  genType const & planeOrig, genType const & planeNormal,
65  typename genType::value_type & intersectionDistance);
66 
69  template <typename genType>
70  GLM_FUNC_DECL bool intersectRayTriangle(
71  genType const & orig, genType const & dir,
72  genType const & vert0, genType const & vert1, genType const & vert2,
73  genType & baryPosition);
74 
77  template <typename genType>
78  GLM_FUNC_DECL bool intersectLineTriangle(
79  genType const & orig, genType const & dir,
80  genType const & vert0, genType const & vert1, genType const & vert2,
81  genType & position);
82 
86  template <typename genType>
87  GLM_FUNC_DECL bool intersectRaySphere(
88  genType const & rayStarting, genType const & rayNormalizedDirection,
89  genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered,
90  typename genType::value_type & intersectionDistance);
91 
94  template <typename genType>
95  GLM_FUNC_DECL bool intersectRaySphere(
96  genType const & rayStarting, genType const & rayNormalizedDirection,
97  genType const & sphereCenter, const typename genType::value_type sphereRadius,
98  genType & intersectionPosition, genType & intersectionNormal);
99 
102  template <typename genType>
103  GLM_FUNC_DECL bool intersectLineSphere(
104  genType const & point0, genType const & point1,
105  genType const & sphereCenter, typename genType::value_type sphereRadius,
106  genType & intersectionPosition1, genType & intersectionNormal1,
107  genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType());
108 
110 }//namespace glm
111 
112 #include "intersect.inl"
GLM_FUNC_DECL bool intersectRaySphere(genType const &rayStarting, genType const &rayNormalizedDirection, genType const &sphereCenter, const typename genType::value_type sphereRadius, genType &intersectionPosition, genType &intersectionNormal)
Compute the intersection of a ray and a sphere.
GLM_FUNC_DECL 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.
GLM_FUNC_DECL 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.
GLM_FUNC_DECL 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.
Definition: _noise.hpp:39
GLM_FUNC_DECL 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.