Simple n-dimensional ray segment data structure. More...
#include <ray.h>
Public Types | |
typedef _PointType | PointType |
typedef _VectorType | VectorType |
typedef PointType::Scalar | Scalar |
Public Member Functions | |
TRay () | |
Construct a new ray. | |
TRay (const PointType &o, const VectorType &d) | |
Construct a new ray. | |
TRay (const PointType &o, const VectorType &d, Scalar mint, Scalar maxt) | |
Construct a new ray. | |
TRay (const TRay &ray) | |
Copy constructor. | |
TRay (const TRay &ray, Scalar mint, Scalar maxt) | |
Copy a ray, but change the covered segment of the copy. | |
void | update () |
Update the reciprocal ray directions after changing 'd'. | |
PointType | operator() (Scalar t) const |
Return the position of a point along the ray. | |
TRay | reverse () const |
Return a ray that points into the opposite direction. | |
std::string | toString () const |
Return a human-readable string summary of this ray. | |
Public Attributes | |
PointType | o |
Ray origin. | |
VectorType | d |
Ray direction. | |
VectorType | dRcp |
Componentwise reciprocals of the ray direction. | |
Scalar | mint |
Minimum position on the ray segment. | |
Scalar | maxt |
Maximum position on the ray segment. | |
Simple n-dimensional ray segment data structure.
Along with the ray origin and direction, this data structure additionally stores a ray segment mint, maxt, as well as the componentwise reciprocals of the ray direction. That is just done for convenience, as these values are frequently required.