|
FEAT 3
Finite Element Analysis Toolbox
|
Intersection tests between Rays and primitives. More...
#include <raycast.hpp>
Public Types | |
| using | DataType = DT_ |
| Data type. More... | |
| using | IntersectionDataType = IntersectionData< DataType > |
| Intersection data type. More... | |
| using | IntersectionResultType = std::optional< IntersectionDataType > |
| Intersection result type. More... | |
| using | Vector2D = Tiny::Vector< DataType, 2 > |
| 2D vector/point type More... | |
| using | Vector3D = Tiny::Vector< DataType, 3 > |
| 3D vector/point type More... | |
Static Public Member Functions | |
| static IntersectionResultType | ray_segment_intersection (const Ray< Vector2D > &r, const Vector2D &a, const Vector2D &b) |
| 2D ray-segment intersection More... | |
| static IntersectionResultType | ray_triangle_intersection (const Ray< Vector3D > &r, const Vector3D &a, const Vector3D &b, const Vector3D &c) |
Static Public Attributes | |
| static constexpr DataType | eps = Math::eps<DataType>() |
| Precision. More... | |
Static Protected Member Functions | |
| static DataType | cross (const Vector2D &a, const Vector2D &b) |
| static Vector3D | cross (const Vector3D &a, const Vector3D &b) |
Intersection tests between Rays and primitives.
| DT_ | Data type |
This class contains intersection test between rays and primitives in various dimensions. Each test is self-contained and implemented as a static member function. The class serves mainly as a container of commonly used types, to keep method signatures neat.
Definition at line 136 of file raycast.hpp.
| using FEAT::Geometry::RayIntersectionPrimitives< DT_ >::DataType = DT_ |
Data type.
Definition at line 140 of file raycast.hpp.
| using FEAT::Geometry::RayIntersectionPrimitives< DT_ >::IntersectionDataType = IntersectionData<DataType> |
Intersection data type.
Definition at line 143 of file raycast.hpp.
| using FEAT::Geometry::RayIntersectionPrimitives< DT_ >::IntersectionResultType = std::optional<IntersectionDataType> |
Intersection result type.
Definition at line 146 of file raycast.hpp.
| using FEAT::Geometry::RayIntersectionPrimitives< DT_ >::Vector2D = Tiny::Vector<DataType, 2> |
2D vector/point type
Definition at line 149 of file raycast.hpp.
| using FEAT::Geometry::RayIntersectionPrimitives< DT_ >::Vector3D = Tiny::Vector<DataType, 3> |
3D vector/point type
Definition at line 152 of file raycast.hpp.
|
inlinestaticprotected |
Definition at line 379 of file raycast.hpp.
|
inlinestaticprotected |
Definition at line 384 of file raycast.hpp.
|
inlinestatic |
2D ray-segment intersection
| [in] | r | Ray |
| [in] | a | First point of segment |
| [in] | b | Second point of segment |
Determine intersection between ray r and segment a, b.
Correctly detects overlap betweeen colinear rays and segments.
Definition at line 170 of file raycast.hpp.
References FEAT::Math::abs(), FEAT::Geometry::Ray< Vector_ >::direction, FEAT::Tiny::dot(), FEAT::Geometry::RayIntersectionPrimitives< DT_ >::eps, FEAT::Math::max(), and FEAT::Geometry::Ray< Vector_ >::origin.
Referenced by FEAT::Geometry::RayIntersectionPrimitives< DT_ >::ray_triangle_intersection().
|
inlinestatic |
Ray-Triangle intersection
| [in] | r | Ray |
| [in] | a | First vertex of triangle |
| [in] | b | Second vertex of triangle |
| [in] | c | Third vertex of triangle |
Implementation based on: Tomas Moeller, Ben Trumbore Fast, minimum storage ray-triangle intersection https://doi.org/10.1145/1198555.1198746
Definition at line 267 of file raycast.hpp.
References FEAT::Math::abs(), FEAT::Geometry::Ray< Vector_ >::direction, FEAT::Tiny::dot(), FEAT::Geometry::RayIntersectionPrimitives< DT_ >::eps, FEAT::Math::max(), FEAT::Geometry::merge(), FEAT::Math::min(), FEAT::normal, FEAT::Geometry::Ray< Vector_ >::origin, and FEAT::Geometry::RayIntersectionPrimitives< DT_ >::ray_segment_intersection().
|
staticconstexpr |
Precision.
Definition at line 155 of file raycast.hpp.
Referenced by FEAT::Geometry::RayIntersectionPrimitives< DT_ >::ray_segment_intersection(), and FEAT::Geometry::RayIntersectionPrimitives< DT_ >::ray_triangle_intersection().