cpe::ray Class Reference

Straight ray (initial position + direction) used for ray-tracing algorithm. More...

+ Collaboration diagram for cpe::ray:

Public Member Functions

 ray (const vec3 &x0=vec3(), const vec3 &u=vec3())
 direct constructor (position+direction) More...
 
vec3 operator() (float t) const
 evaluate 3D position at x0+t*u More...
 
void offset (const double &epsilon=1e-3)
 offset the ray by epsilon in the direction of the normal More...
 

Public Attributes

vec3 x0
 internal initial position of the ray More...
 
vec3 u
 internal direction of the ray More...
 

Detailed Description

Straight ray (initial position + direction) used for ray-tracing algorithm.

Constructor & Destructor Documentation

cpe::ray::ray ( const vec3 x0 = vec3(),
const vec3 u = vec3() 
)

direct constructor (position+direction)

References cpe::vec3::norm2(), cpe::vec3::normalized(), and u.

+ Here is the call graph for this function:

Member Function Documentation

void cpe::ray::offset ( const double &  epsilon = 1e-3)

offset the ray by epsilon in the direction of the normal

References u, and x0.

vec3 cpe::ray::operator() ( float  t) const

evaluate 3D position at x0+t*u

References u, and x0.

Member Data Documentation

vec3 cpe::ray::u

internal direction of the ray

Referenced by cpe::plane::intersect(), cpe::sphere::intersect(), offset(), operator()(), cpe::operator<<(), and ray().

vec3 cpe::ray::x0

internal initial position of the ray

Referenced by cpe::plane::intersect(), cpe::sphere::intersect(), offset(), operator()(), and cpe::operator<<().


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