0.9.9 API documenation
intersect.hpp
Go to the documentation of this file.
1 
14 #pragma once
15 
16 // Dependency:
17 #include <cfloat>
18 #include <limits>
19 #include "../glm.hpp"
20 #include "../geometric.hpp"
21 #include "../gtx/closest_point.hpp"
22 #include "../gtx/vector_query.hpp"
23 
24 #ifndef GLM_ENABLE_EXPERIMENTAL
25 # error "GLM: GLM_GTX_closest_point is an experimetal extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it."
26 #endif
27 
28 #if GLM_MESSAGES == GLM_MESSAGES_ENABLED && !defined(GLM_EXT_INCLUDED)
29 # pragma message("GLM: GLM_GTX_closest_point extension included")
30 #endif
31 
32 namespace glm
33 {
36 
40  template <typename genType>
41  GLM_FUNC_DECL bool intersectRayPlane(
42  genType const & orig, genType const & dir,
43  genType const & planeOrig, genType const & planeNormal,
44  typename genType::value_type & intersectionDistance);
45 
48  template <typename genType>
49  GLM_FUNC_DECL bool intersectRayTriangle(
50  genType const & orig, genType const & dir,
51  genType const & vert0, genType const & vert1, genType const & vert2,
52  genType & baryPosition);
53 
56  template <typename genType>
57  GLM_FUNC_DECL bool intersectLineTriangle(
58  genType const & orig, genType const & dir,
59  genType const & vert0, genType const & vert1, genType const & vert2,
60  genType & position);
61 
65  template <typename genType>
66  GLM_FUNC_DECL bool intersectRaySphere(
67  genType const & rayStarting, genType const & rayNormalizedDirection,
68  genType const & sphereCenter, typename genType::value_type const sphereRadiusSquered,
69  typename genType::value_type & intersectionDistance);
70 
73  template <typename genType>
74  GLM_FUNC_DECL bool intersectRaySphere(
75  genType const & rayStarting, genType const & rayNormalizedDirection,
76  genType const & sphereCenter, const typename genType::value_type sphereRadius,
77  genType & intersectionPosition, genType & intersectionNormal);
78 
81  template <typename genType>
82  GLM_FUNC_DECL bool intersectLineSphere(
83  genType const & point0, genType const & point1,
84  genType const & sphereCenter, typename genType::value_type sphereRadius,
85  genType & intersectionPosition1, genType & intersectionNormal1,
86  genType & intersectionPosition2 = genType(), genType & intersectionNormal2 = genType());
87 
89 }//namespace glm
90 
91 #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 plane.
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:11
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.