#include <Light.h>
Classes | |
class | Directional |
class | Point |
class | Spot |
Public Types | |
enum | Type { DIRECTIONAL = 1, POINT = 2, SPOT = 3 } |
Public Member Functions | |
virtual | ~Light () |
Light & | operator= (const Light &) |
Type | getLightType () const |
const Vector3 & | getColor () const |
void | setColor (const Vector3 &color) |
void | setColor (float red, float green, float blue) |
Node * | getNode () const |
float | getRange () const |
void | setRange (float range) |
float | getRangeInverse () const |
float | getInnerAngle () const |
void | setInnerAngle (float innerAngle) |
float | getOuterAngle () const |
void | setOuterAngle (float outerAngle) |
float | getInnerAngleCos () const |
float | getOuterAngleCos () const |
Static Public Member Functions | |
static Light * | createDirectional (const Vector3 &color) |
static Light * | createDirectional (float red, float green, float blue) |
static Light * | createPoint (const Vector3 &color, float range) |
static Light * | createPoint (float red, float green, float blue, float range) |
static Light * | createSpot (const Vector3 &color, float range, float innerAngle, float outerAngle) |
static Light * | createSpot (float red, float green, float blue, float range, float innerAngle, float outerAngle) |
static Light * | create (Properties *properties) |
Defines a light.
There are 3 types of lights that can be created directional, point and spot lights.
Defines the supported light types.
virtual gameplay::Light::~Light | ( | ) | [virtual] |
Destructor.
static Light* gameplay::Light::create | ( | Properties * | properties | ) | [static] |
Creates a light from a properties definition.
The properties object must contain a "type" parameter, specifying one of the supported Light::Type values. In addition, values must be supplied for all parameters of the corresponding light-specific creation method.
properties | The properties definition of the Light. |
static Light* gameplay::Light::createDirectional | ( | const Vector3 & | color | ) | [static] |
Creates a directional light.
color | Color of the light. |
static Light* gameplay::Light::createDirectional | ( | float | red, |
float | green, | ||
float | blue | ||
) | [static] |
Creates a directional light.
red | The red channel. |
green | The green channel. |
blue | The blue channel. |
static Light* gameplay::Light::createPoint | ( | const Vector3 & | color, |
float | range | ||
) | [static] |
Creates a point light.
color | The light's color. |
range | The light's range. |
static Light* gameplay::Light::createPoint | ( | float | red, |
float | green, | ||
float | blue, | ||
float | range | ||
) | [static] |
Creates a point light.
red | The red channel. |
green | The green channel. |
blue | The blue channel. |
range | The light's range. |
static Light* gameplay::Light::createSpot | ( | const Vector3 & | color, |
float | range, | ||
float | innerAngle, | ||
float | outerAngle | ||
) | [static] |
Creates a spot light.
color | The light's color. |
range | The light's range. |
innerAngle | The light's inner angle (in radians). |
outerAngle | The light's outer angle (in radians). |
static Light* gameplay::Light::createSpot | ( | float | red, |
float | green, | ||
float | blue, | ||
float | range, | ||
float | innerAngle, | ||
float | outerAngle | ||
) | [static] |
Creates a spot light.
red | The red channel. |
green | The green channel. |
blue | The blue channel. |
range | The light's range. |
innerAngle | The light's inner angle (in radians). |
outerAngle | The light's outer angle (in radians). |
const Vector3& gameplay::Light::getColor | ( | ) | const |
Gets the light color.
float gameplay::Light::getInnerAngle | ( | ) | const |
Returns the inner angle the spot light (in radians).
float gameplay::Light::getInnerAngleCos | ( | ) | const |
Returns the cosine of the inner angle of spot light.
Type gameplay::Light::getLightType | ( | ) | const |
Returns the light type.
Node* gameplay::Light::getNode | ( | ) | const |
Returns the node associated with this light.
float gameplay::Light::getOuterAngle | ( | ) | const |
Returns the outer angle of the spot light (in radians).
float gameplay::Light::getOuterAngleCos | ( | ) | const |
Returns the cosine of the outer angle of spot light.
float gameplay::Light::getRange | ( | ) | const |
Returns the Range of the point or spot light.
float gameplay::Light::getRangeInverse | ( | ) | const |
Returns the inverse of the range of point or spot light.
void gameplay::Light::setColor | ( | const Vector3 & | color | ) |
Sets the light color.
color | The light color to set. |
void gameplay::Light::setColor | ( | float | red, |
float | green, | ||
float | blue | ||
) |
Sets the light color.
red | The red channel. |
green | The green channel. |
blue | The blue channel. |
void gameplay::Light::setInnerAngle | ( | float | innerAngle | ) |
Sets the inner angle of a spot light (in radians).
innerAngle | The angle of spot light (in radians). |
void gameplay::Light::setOuterAngle | ( | float | outerAngle | ) |
Sets the outer angle of a spot light (in radians).
outerAngle | The angle of spot light (in radians). |
void gameplay::Light::setRange | ( | float | range | ) |
Sets the range of point or spot light.
range | The range of point or spot light. |
Directional* gameplay::Light::_directional |
Point* gameplay::Light::_point |
Spot* gameplay::Light::_spot |