|
Celeritas 0.7-develop+8dfc575
|
A triangle defined by three vertices. More...
#include <Tri.hh>
Public Types | |
Type aliases | |
| using | real_type = T |
| using | Real3 = Array< real_type, 3 > |
| using | Vertices = Array< Real3, 3 > |
| using | Edges = Array< Real3, 2 > |
| using | StorageSpan = Span< real_type const, 3 > |
Public Member Functions | |
| Tri (Vertices const &verts) | |
| Construct from 3 vertices. | |
| template<class R > | |
| Tri (Span< R, StorageSpan::extent >) | |
| Construct from raw data. | |
| Real3 const & | vertex () const |
| The base vertex of the triangle. | |
| Edges const & | edges () const |
| The two edges connected to the triangle. | |
| real_type | calc_intersections (Real3 const &pos, Real3 const &dir, SurfaceState on_surface) const |
| Calculate the intersection point. | |
A triangle defined by three vertices.
On construction, the triangle will be updated to a CCW orientation.
The triangle cannot be degenerate with zero area:
The ray-triangle intersection utilizes the Moller-Trumbore algorithm. https://en.wikipedia.org/wiki/M%C3%B6ller%E2%80%93Trumbore_intersection_algorithm
|
inline |
Calculate the intersection point.
This is an implementation of the Moller-Trumbore intersection algorithm.