Nori  24
TRay< _PointType, _VectorType > Struct Template Reference

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.
 

Detailed Description

template<typename _PointType, typename _VectorType>
struct TRay< _PointType, _VectorType >

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.

Remarks
Important: be careful when changing the ray direction. You must call update() to compute the componentwise reciprocals as well, or Nori's ray-triangle intersection code will go haywire.

Definition at line 38 of file ray.h.


The documentation for this struct was generated from the following files: