overview wiki api reference download
 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:
gameplay::Ref

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 ()
Lightoperator= (const Light &)
Type getLightType () const
const Vector3getColor () const
void setColor (const Vector3 &color)
void setColor (float red, float green, float blue)
NodegetNode () 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 LightcreateDirectional (const Vector3 &color)
static LightcreateDirectional (float red, float green, float blue)
static LightcreatePoint (const Vector3 &color, float range)
static LightcreatePoint (float red, float green, float blue, float range)
static LightcreateSpot (const Vector3 &color, float range, float innerAngle, float outerAngle)
static LightcreateSpot (float red, float green, float blue, float range, float innerAngle, float outerAngle)
static Lightcreate (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

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:
propertiesThe properties definition of the Light.
Returns:
The new Light.
static Light* gameplay::Light::createDirectional ( const Vector3 color) [static]

Creates a directional light.

Parameters:
colorColor 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:
redThe red channel.
greenThe green channel.
blueThe blue channel.
Returns:
The new directional light.
static Light* gameplay::Light::createPoint ( const Vector3 color,
float  range 
) [static]

Creates a point light.

Parameters:
colorThe light's color.
rangeThe 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:
redThe red channel.
greenThe green channel.
blueThe blue channel.
rangeThe 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:
colorThe light's color.
rangeThe light's range.
innerAngleThe light's inner angle (in radians).
outerAngleThe 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:
redThe red channel.
greenThe green channel.
blueThe blue channel.
rangeThe light's range.
innerAngleThe light's inner angle (in radians).
outerAngleThe light's outer angle (in radians).
Returns:
The new spot light.

Gets the light color.

Returns:
The light color.

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

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

Returns the cosine of the inner angle of spot light.

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

Returns the light type.

Returns:
The light type.

Returns the node associated with this light.

Returns:
The node associated with this light.

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

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

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.

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:
colorThe light color to set.
void gameplay::Light::setColor ( float  red,
float  green,
float  blue 
)

Sets the light color.

Parameters:
redThe red channel.
greenThe green channel.
blueThe blue channel.
void gameplay::Light::setInnerAngle ( float  innerAngle)

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

Parameters:
innerAngleThe angle of spot light (in radians).
void gameplay::Light::setOuterAngle ( float  outerAngle)

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

Parameters:
outerAngleThe angle of spot light (in radians).
void gameplay::Light::setRange ( float  range)

Sets the range of point or spot light.

Parameters:
rangeThe range of point or spot light.

Member Data Documentation

 All Classes Functions Variables Typedefs Enumerations Enumerator