|
Ray Tracer
2020
|
Light emitted from afar in a particular Direction. More...
#include <DirectionalLightSource.h>
Public Member Functions | |
| DirectionalLightSource (const Colour &colour, const Direction &direction) | |
| DirectionalLightSource constructor. More... | |
| DirectionalLightSource (const DirectionalLightSource &lightSource) | |
| DirectionalLightSource copy constructor. More... | |
| ~DirectionalLightSource () | |
| DirectionalLightSource destructor. More... | |
| DirectionalLightSource & | operator= (const DirectionalLightSource &lightSource) |
| DirectionalLightSource assignment operator. More... | |
| Colour | getIlluminationAt (const Point &point) const |
| Determine how much light reaches a Point from this DirectionalLightSource. More... | |
| double | getDistanceToLight (const Point &point) const |
| Determine how far away the light source is from a given Point. More... | |
| Direction | getLightDirection (const Point &point) const |
| Direction from light source to a point. More... | |
Private Attributes | |
| Direction | direction_ |
| The Direction that this light source sheds light in. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from LightSource | |
| LightSource (const Colour &colour) | |
| LightSource constructor. More... | |
| LightSource (const LightSource &lightSource) | |
| LightSource copy constructor. More... | |
| virtual | ~LightSource () |
| LightSource destructor. More... | |
| LightSource & | operator= (const LightSource &lightSource) |
| LightSource assignment operator. More... | |
Protected Attributes inherited from LightSource | |
| Colour | colour_ |
| The Colour of this LightSource's illumination. More... | |
Light emitted from afar in a particular Direction.
A DirectionaLightSource represents parallel light rays from a given Direction. This is often used to represent a 'Sun' light source - a strong light source at a very large (practically infinite) distance.
| DirectionalLightSource::DirectionalLightSource | ( | const Colour & | colour, |
| const Direction & | direction | ||
| ) |
DirectionalLightSource constructor.
This creates a LightSource with a specified Colour coming from a particular Direction
| colour | The Colour of the DirectionalLightSource |
| direction | The Direction of the DirectionalLightSource |
| DirectionalLightSource::DirectionalLightSource | ( | const DirectionalLightSource & | lightSource | ) |
DirectionalLightSource copy constructor.
| lightSource | The DirectionalLightSource to copy to this. |
| DirectionalLightSource::~DirectionalLightSource | ( | ) |
DirectionalLightSource destructor.
|
virtual |
Determine how far away the light source is from a given Point.
Since DirectionalLightSources have no real location, they are essentially at infinity.
infinity Implements LightSource.
Determine how much light reaches a Point from this DirectionalLightSource.
The illumination from a DirectionalLightSource doesn't decay with distance.
| point | The Point at which light is measured. |
Implements LightSource.
Direction from light source to a point.
Return a Direction pointing from the given point towards the light source.
| point | The point where the ray is being computed. |
Implements LightSource.
| DirectionalLightSource & DirectionalLightSource::operator= | ( | const DirectionalLightSource & | lightSource | ) |
DirectionalLightSource assignment operator.
| lightSource | The DirectionalLightSource to copy to this. |
this to allow for chaining of assignment.
|
private |
The Direction that this light source sheds light in.