Ray Tracer Common Project
Image rendering program based on the ray tracing technique.
Public Member Functions | Static Public Member Functions | List of all members
rt::ray Class Reference

Light ray. More...

#include <ray.hpp>

Inheritance diagram for rt::ray:
rt::euclidian

Public Member Functions

 ray (const vector &origin, const vector &u, int life_time=10)
 Create a new light ray. More...
 
rt::hit hit (const Scene *scene, const Object *except=0) const
 Get all informations about the collision between this ray and an object in a scene. More...
 
photon trace (const Scene *scene, int flags, double *depth=0) const
 
- Public Member Functions inherited from rt::euclidian
 euclidian (const vector &origin, const vector &u)
 Constructor. More...
 
const vectordirection () const
 The direction vector.
 
const vectoru () const
 The direction vector (alias for euclidian::direction())
 
const vectororigin () const
 The position vector.
 

Static Public Member Functions

static int ambientLightSampleSize ()
 
static void setAmbientLightSampleSize (int ss)
 

Detailed Description

Light ray.

A ray is an euclidian representing a light ray through the scene. You can know if a ray hit some Object, or trace the ray to compute its photon.

Constructor & Destructor Documentation

◆ ray()

rt::ray::ray ( const vector origin,
const vector u,
int  life_time = 10 
)

Create a new light ray.

Parameters
originPosition of the ray origin
uDirection of the ray
life_timeMaximum reflexions count

Member Function Documentation

◆ hit()

rt::hit rt::ray::hit ( const Scene scene,
const Object except = 0 
) const

Get all informations about the collision between this ray and an object in a scene.

Parameters
scene
Returns
A hit with a scene object. If the ray hit nothing, the date of the hit is set to infinity.

◆ trace()

photon rt::ray::trace ( const Scene scene,
int  flags,
double *  depth = 0 
) const

the ray through a scene.

Parameters
scene
depthA pointer to a double. If this pointer is not null, its value will be set to the depth value of the ray. If the ray hit nothing, this value will be infinity
Returns
The photon of the ray in the scene.

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