Ray Class Reference

Classic ray, with an origin and direction. More...

#include <ray.h>

Collaboration diagram for Ray:

Collaboration graph
[legend]
List of all members.

Public Member Functions

const Vectordirection () const
bool is_normalized ()
void normalize ()
 Normalize the direction vector with the origin.
Point3D origin () const
 Ray (const Ray &other)
 Ray (Point3D origin, Point3D direction)
 Ray ()
std::string to_string ()
 ~Ray ()

Protected Attributes

Vector _direction
bool _is_normalized
Point3D _origin

Detailed Description

Classic ray, with an origin and direction.

Definition at line 12 of file ray.h.


Constructor & Destructor Documentation

Ray::Ray (  )  [inline]

Definition at line 20 of file ray.h.

Ray::Ray ( Point3D  origin,
Point3D  direction 
) [inline]

Definition at line 22 of file ray.h.

References normalize().

Here is the call graph for this function:

Ray::Ray ( const Ray other  )  [inline]

Definition at line 30 of file ray.h.

References _is_normalized, and normalize().

Here is the call graph for this function:

Ray::~Ray (  )  [inline]

Definition at line 40 of file ray.h.


Member Function Documentation

const Vector& Ray::direction (  )  const [inline]

Get the direction of the ray.

Returns:
the direction

Definition at line 53 of file ray.h.

References _direction.

Referenced by Polygon::add_vertex(), Sphere::collides_with(), Polygon::collides_with(), Plane::collides_with(), ImageMap::get_color(), Renderable::get_color_contribution(), Polygon::get_normal(), Plane::get_normal(), operator==(), RippleBumpMap::perturb_normal(), ConcentricBumpMap::perturb_normal(), Plane::Plane(), and trace_ray().

Here is the caller graph for this function:

bool Ray::is_normalized (  )  [inline]

Definition at line 45 of file ray.h.

References _is_normalized.

void Ray::normalize (  )  [inline]

Normalize the direction vector with the origin.

Definition at line 67 of file ray.h.

References _direction, Point3D::x, Point3D::y, and Point3D::z.

Referenced by Ray().

Here is the caller graph for this function:

Point3D Ray::origin (  )  const [inline]

Returns the origin

Returns:
the origin

Definition at line 49 of file ray.h.

References _origin.

Referenced by Sphere::collides_with(), Polygon::collides_with(), Plane::collides_with(), operator==(), RippleBumpMap::perturb_normal(), ConcentricBumpMap::perturb_normal(), and trace_ray().

Here is the caller graph for this function:

std::string Ray::to_string (  )  [inline]

Convert the ray to a printable representation

Returns:
string that describes the ray

Definition at line 57 of file ray.h.

References _direction, _origin, and Point3D::to_string().

Here is the call graph for this function:


Member Data Documentation

Vector Ray::_direction [protected]

Definition at line 17 of file ray.h.

Referenced by direction(), normalize(), and to_string().

bool Ray::_is_normalized [protected]

Definition at line 14 of file ray.h.

Referenced by is_normalized(), and Ray().

Point3D Ray::_origin [protected]

Definition at line 16 of file ray.h.

Referenced by origin(), and to_string().


The documentation for this class was generated from the following file:
Generated on Tue Oct 30 22:12:23 2007 for mbrt by  doxygen 1.5.2