Render::Ray Class Reference

#include <Ray.hh>

Collaboration diagram for Render::Ray:

Collaboration graph
[legend]

List of all members.


Detailed Description

Contains ray data + basic operations.

Class is supposed to abstract a light ray shot from an eye or from the light into the scene. Can calculate reflected and refracted rays given normal, and collision point.

Definition at line 38 of file Ray.hh.


Public Member Functions

 Ray (const Math::Vector &S, const Math::Vector &D)
Ray Reflect (const Math::Vector &Normal, const Math::Vector &Point) const
Ray Refract (const Math::Vector &Normal, const Math::Vector &Point, Double FromN, Double IntoN) const
const Math::VectorStart () const
const Math::VectorDirection () const
Math::Vector GetPoint (Double Loc) const

Static Public Member Functions

static Ray RayFromPoints (const Math::Vector &Start, const Math::Vector &Destination)

Private Attributes

Math::Vector S
Math::Vector D

Friends

std::ostream & operator<< (std::ostream &os, const Ray &R)

Constructor & Destructor Documentation

Render::Ray::Ray ( const Math::Vector S,
const Math::Vector D 
) [inline]

Current ray color Create new ray

Parameters:
S Ray start vector
D Ray direction vector

Definition at line 54 of file Ray.hh.

Referenced by RayFromPoints(), Reflect(), and Refract().

Here is the caller graph for this function:


Member Function Documentation

Ray Render::Ray::RayFromPoints ( const Math::Vector Start,
const Math::Vector Destination 
) [static]

Create a ray starting at 'Start' point and directed into 'Destination'

Definition at line 20 of file Ray.cc.

References Ray().

Referenced by Render::Raytracer::TraceLights().

Here is the call graph for this function:

Here is the caller graph for this function:

Ray Render::Ray::Reflect ( const Math::Vector Normal,
const Math::Vector Point 
) const

Create reflected ray.

Parameters:
Normal normal at collision point
Point Point of ray collision

tmp = 2 * (Normal . Direction) New Direction = ||Direction - (Normal * tmp1)||

Definition at line 27 of file Ray.cc.

References D, Math::Vector::Dot(), and Ray().

Referenced by Render::Raytracer::Trace().

Here is the call graph for this function:

Here is the caller graph for this function:

Ray Render::Ray::Refract ( const Math::Vector Normal,
const Math::Vector Point,
Double  FromN,
Double  IntoN 
) const

Create refracted ray.

Parameters:
Normal normal at collision point
Point Point of ray collision
FromN N coeff of ray environment.
IntoN N coeff of refracted ray environment.

Definition at line 38 of file Ray.cc.

References D, Math::Vector::Dot(), and Ray().

Referenced by Render::Raytracer::Trace().

Here is the call graph for this function:

Here is the caller graph for this function:

const Math::Vector& Render::Ray::Start (  )  const [inline]

Start vector accessor

Definition at line 81 of file Ray.hh.

References S.

Referenced by World::Sphere::Collide(), World::Plane::Collide(), and Render::operator<<().

Here is the caller graph for this function:

const Math::Vector& Render::Ray::Direction (  )  const [inline]

Direction vector accessor

Definition at line 87 of file Ray.hh.

References D.

Referenced by World::Sphere::Collide(), World::Plane::Collide(), Render::operator<<(), and Render::Raytracer::TraceLights().

Here is the caller graph for this function:

Math::Vector Render::Ray::GetPoint ( Double  Loc  )  const [inline]

Return point in space on the Ray at position Loc given by the equation: RayStart + Direction * Loc

Definition at line 94 of file Ray.hh.

References D, and S.

Referenced by Testcases::Scene(), and Render::Raytracer::Trace().

Here is the caller graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Ray R 
) [friend]

Pretty-printer

Definition at line 50 of file Ray.cc.


Member Data Documentation

Ray start vector

Definition at line 41 of file Ray.hh.

Referenced by GetPoint(), and Start().

Ray direction vector

Definition at line 44 of file Ray.hh.

Referenced by Direction(), GetPoint(), Reflect(), and Refract().


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

Generated on Wed Mar 12 00:35:52 2008 for blaRAY by  doxygen 1.5.5