#include <Ray.hh>

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::Vector & | Start () const |
| const Math::Vector & | Direction () 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) |
| Render::Ray::Ray | ( | const Math::Vector & | S, | |
| const Math::Vector & | D | |||
| ) | [inline] |
| 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().


| Ray Render::Ray::Reflect | ( | const Math::Vector & | Normal, | |
| const Math::Vector & | Point | |||
| ) | const |
Create reflected ray.
| 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().


| Ray Render::Ray::Refract | ( | const Math::Vector & | Normal, | |
| const Math::Vector & | Point, | |||
| Double | FromN, | |||
| Double | IntoN | |||
| ) | const |
Create refracted ray.
| 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().


| 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<<().

| 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().

| 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.
Referenced by Testcases::Scene(), and Render::Raytracer::Trace().

| std::ostream& operator<< | ( | std::ostream & | os, | |
| const Ray & | R | |||
| ) | [friend] |
Math::Vector Render::Ray::S [private] |
Math::Vector Render::Ray::D [private] |
Ray direction vector
Definition at line 44 of file Ray.hh.
Referenced by Direction(), GetPoint(), Reflect(), and Refract().
1.5.5