|  | overview |  | wiki |  | api reference |  | download

- Main Page
- Classes

- Class List
- Class Index
- Class Hierarchy
- Class Members

All Classes Functions Variables Typedefs Enumerations Enumerator
Classes | Public Types | Public Member Functions | Static Public Member Functions
gameplay::Light Class Reference

`#include <Light.h>`

Inheritance diagram for gameplay::Light:

List of all members.

## 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)

## Detailed Description

Defines a light.

There are 3 types of lights that can be created directional, point and spot lights.

## Member Enumeration Documentation

enum gameplay::Light::Type

Defines the supported light types.

## Constructor & Destructor Documentation

virtual gameplay::Light::~Light | ( |  | ) | `[virtual]`

Destructor.

## Member Function Documentation

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.

Parameters:

  properties | The properties definition of the Light.

Returns:
  The new Light.

static Light* gameplay::Light::createDirectional | ( | const Vector3 & | color | ) | `[static]`

Creates a directional light.

Parameters:

  color | Color of the light.

Returns:
  The new directional light.

static Light* gameplay::Light::createDirectional | ( | float | red,
|  | float | green,
|  | float | blue
| ) |  | `[static]`

Creates a directional light.

Parameters:

  red | The red channel.
  green | The green channel.
  blue | The blue channel.

Returns:
  The new directional light.

static Light* gameplay::Light::createPoint | ( | const Vector3 & | color,
|  | float | range
| ) |  | `[static]`

Creates a point light.

Parameters:

  color | The light's color.
  range | The light's range.

Returns:
  The new point light.

static Light* gameplay::Light::createPoint | ( | float | red,
|  | float | green,
|  | float | blue,
|  | float | range
| ) |  | `[static]`

Creates a point light.

Parameters:

  red | The red channel.
  green | The green channel.
  blue | The blue channel.
  range | The light's range.

Returns:
  The new point light.

static Light* gameplay::Light::createSpot | ( | const Vector3 & | color,
|  | float | range,
|  | float | innerAngle,
|  | float | outerAngle
| ) |  | `[static]`

Creates a spot light.

Parameters:

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

Returns:
  The new spot light.

static Light* gameplay::Light::createSpot | ( | float | red,
|  | float | green,
|  | float | blue,
|  | float | range,
|  | float | innerAngle,
|  | float | outerAngle
| ) |  | `[static]`

Creates a spot light.

Parameters:

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

Returns:
  The new spot light.

const Vector3& gameplay::Light::getColor | ( |  | ) | const

Gets the light color.

Returns:
  The light color.

float gameplay::Light::getInnerAngle | ( |  | ) | const

Returns the inner angle the spot light (in radians).

Returns:
  The inner angle of the spot light (in radians).

float gameplay::Light::getInnerAngleCos | ( |  | ) | const

Returns the cosine of the inner angle of spot light.

Returns:
  The cosine of the inner angle of spot light.

Type gameplay::Light::getLightType | ( |  | ) | const

Returns the light type.

Returns:
  The light type.

Node* gameplay::Light::getNode | ( |  | ) | const

Returns the node associated with this light.

Returns:
  The node associated with this light.

float gameplay::Light::getOuterAngle | ( |  | ) | const

Returns the outer angle of the spot light (in radians).

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.

Returns:
  The cosine of the outer angle of spot light.

float gameplay::Light::getRange | ( |  | ) | const

Returns the Range of the point or spot light.

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.

Returns:
  The range of the point or spot light.

Light& gameplay::Light::operator= | ( | const Light & |  | ) |

Hidden copy assignment operator.

void gameplay::Light::setColor | ( | const Vector3 & | color | ) |

Sets the light color.

Parameters:

  color | The light color to set.

void gameplay::Light::setColor | ( | float | red,
|  | float | green,
|  | float | blue
| ) |  |

Sets the light color.

Parameters:

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

Parameters:

  innerAngle | The angle of spot light (in radians).

void gameplay::Light::setOuterAngle | ( | float | outerAngle | ) |

Sets the outer angle of a spot light (in radians).

Parameters:

  outerAngle | The angle of spot light (in radians).

void gameplay::Light::setRange | ( | float | range | ) |

Sets the range of point or spot light.

Parameters:

  range | The range of point or spot light.

## Member Data Documentation

Directional* gameplay::Light::_directional

Point* gameplay::Light::_point

Spot* gameplay::Light::_spot

All Classes Functions Variables Typedefs Enumerations Enumerator