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

Light source class representation. More...

#include <light.hpp>

Inheritance diagram for rt::Light:
rt::Entity rt::OmniLight

Public Types

enum  Type { Constant, Sinus, Quadratic }
 

Public Member Functions

 Light (const vector &pos, Type type=Quadratic)
 Let there be light ! More...
 
virtual double distance (const vector &from) const =0
 Global distance between the light and a position. More...
 
virtual const rt::photonphoton (const vector &from) const =0
 Get a photon from a global space location.
 
double energy (double distance) const
 
- Public Member Functions inherited from rt::Entity
 Entity (Entity *parent=0)
 Default entity constructor. More...
 
 Entity (const vector &pos, Entity *parent=0)
 Make a new entity from its position and parent. More...
 
 Entity (double x, double y, double z, Entity *parent=0)
 Make a new entity from its position coordinates and parent. More...
 
virtual ~Entity ()=0
 Destructor. More...
 
void soil ()
 Make an entity dirty. More...
 
bool isDirty () const
 
virtual void update ()
 Update the global matrix of the entity and its children.
 
const matrixglobalMatrix () const
 The global matrix of the entity. More...
 
const matrixinvertedGlobalMatrix () const
 The invert of the global matrix of the entity. More...
 
vector globalPosition () const
 Global position of the entity. More...
 
const vectorposition () const
 Entity location.
 
const vectorrotation () const
 Entity rotation.
 
void setPosition (const vector &pos)
 Set the entity position. More...
 
void setRotation (const vector &rot)
 Set the entity rotation. More...
 
Entityparent () const
 The parent entity. More...
 
void setParent (Entity *)
 Set the parent entity. More...
 
Scenescene () const
 The scene of the entity.
 
void setScene (Scene *)
 Set the scene of the entity. More...
 
const std::unordered_set< Entity * > & children () const
 Entity children.
 
void addChild (Entity *)
 Add a child. More...
 
void removeChild (Entity *)
 Remove a child. More...
 
template<class T >
void queryAll (std::list< const T *> &list) const
 Get the list of a specific type of entity. More...
 

Detailed Description

Light source class representation.

This class describes a light source in a scene that deliver photons at each position in space.

Constructor & Destructor Documentation

◆ Light()

rt::Light::Light ( const vector pos,
Type  type = Quadratic 
)

Let there be light !

Parameters
posThe location of the light.

Member Function Documentation

◆ distance()

virtual double rt::Light::distance ( const vector from) const
pure virtual

Global distance between the light and a position.

Parameters
froma location vector described in global space. Note that this distance can be ‘infinity’ (for a sun light for exemple).

Implemented in rt::OmniLight.


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