|
mal-math
C++20 mathematics library.
|
Represents the data of a ray's intersection with an object. More...
#include "intersection.hpp"
Public Member Functions | |
| constexpr | Intersection ()=default |
| constexpr | Intersection (Intersection const &)=default |
| constexpr Intersection & | operator= (Intersection const &)=default |
| constexpr | Intersection (Intersection &&)=default |
| constexpr Intersection & | operator= (Intersection &&)=default |
| constexpr void | reset () |
| Resets the intersection data. | |
| bool | exists () const |
Determines if the intersection exists based on the value of t. | |
Static Public Member Functions | |
| static constexpr Intersection | infinite () |
Creates and returns an intersection with t set to infinity. | |
Public Attributes | |
| float | t |
| The intersection parameter. | |
| vec3 | point |
| The 3D point of intersection. | |
| vec3 | normal |
| The 3D normal at the point of intersection. | |
Represents the data of a ray's intersection with an object.
The Intersection structure encapsulates details of an intersection point, such as the intersection parameter t, the intersection point itself, and the normal at the intersection.
Definition at line 52 of file intersection.hpp.
|
constexprdefault |
|
constexprdefault |
|
constexprdefault |
|
inline |
Determines if the intersection exists based on the value of t.
t is finite, indicating an intersection exists. Definition at line 77 of file intersection.hpp.
|
inlinestaticconstexpr |
Creates and returns an intersection with t set to infinity.
Definition at line 84 of file intersection.hpp.
|
constexprdefault |
|
constexprdefault |
|
inlineconstexpr |
Resets the intersection data.
The intersection parameter t is set to infinity.
Definition at line 69 of file intersection.hpp.
| vec3 mal_math::Intersection::normal |
The 3D normal at the point of intersection.
Definition at line 56 of file intersection.hpp.
| vec3 mal_math::Intersection::point |
The 3D point of intersection.
Definition at line 55 of file intersection.hpp.
| float mal_math::Intersection::t |
The intersection parameter.
Definition at line 54 of file intersection.hpp.