Couch
Public Member Functions | Protected Attributes | List of all members
Light Class Reference

#include <Light.h>

Inheritance diagram for Light:
Inheritance graph
[legend]
Collaboration diagram for Light:
Collaboration graph
[legend]

Public Member Functions

Vector3 GetColor ()
 
void SetColor (Vector3 color)
 
float GetAmbient ()
 
void SetAmbient (float ambient)
 
float GetDiffuse ()
 
void SetDiffuse (float diffuse)
 
float GetSpecular ()
 
void SetSpecular (float specular)
 
virtual LightCreate ()
 
virtual LightDuplicate ()
 
virtual LightInstance ()
 
virtual Name GetType () const
 
- Public Member Functions inherited from Spatial
Transform GetTransform ()
 
void SetTransform (Transform transform)
 
Transform GetGlobalTransform ()
 
void SetGlobalTransform (Transform globalTransform)
 
virtual void Translate (Vector3 offset)
 
void RotateX (float phi)
 
void RotateY (float phi)
 
void RotateZ (float phi)
 
void UniformScale (float scale)
 
- Public Member Functions inherited from Node
 Node (bool isPrefab)
 
bool IsPrefab ()
 
NodeList GetChildren ()
 
void AddChild (Node *child)
 
NodeGetParent ()
 
void QueueFree ()
 
void DoFree ()
 

Protected Attributes

Vector3 color
 
float ambient
 
float diffuse
 
float specular
 

Additional Inherited Members

- Static Public Member Functions inherited from Node
static NodeGetRoot ()
 

Detailed Description

All lights have color as well as ambient, diffuse, and specular properties. In the future, light properties might be a color, but for now they are strength modulations on the main light color.

Member Function Documentation

◆ Create()

Light * Light::Create ( )
virtual

Allocates a new "default" version of this node.

Returns
A reference to the node.

Reimplemented from Spatial.

Reimplemented in PointLight, and DirectionalLight.

◆ Duplicate()

Light * Light::Duplicate ( )
virtual

Copies the properties of this node to a newly allocated node, created via Create. Subclasses should override this to copy additional class attributes

Returns
A reference to the duplicate

Reimplemented from Spatial.

Reimplemented in PointLight, and DirectionalLight.

◆ GetAmbient()

float Light::GetAmbient ( )

Ambient light is how much light is emitted from an object illuminated by this light with no accounting for incidence angle or the location of the observer.

Returns
The ambient intensity

◆ GetColor()

Vector3 Light::GetColor ( )

Get the color property of this light

Returns
The color property

◆ GetDiffuse()

float Light::GetDiffuse ( )

Diffuse light is how much light is reflected by an object illuminated by this light, accounting for incidence angle of the light but not the location of the observer.

Returns
The diffuse intensity.

◆ GetSpecular()

float Light::GetSpecular ( )

Specular light is how much light is reflected by an object illuminated by this light, taking into account both the incidence angle of the light as well as the location of the observer. This is what creates the "Specular Artifact", the shiny bit on a 3D sphere.

Returns
The specular intensity

◆ Instance()

Light * Light::Instance ( )
virtual

Creates an instanced version of this node, by calling Duplicate. Subclasses should override this to perform neccesary tasks for instantiation, i.e. adding a physic object to the physics world. Any children of this node will also be instanced.

Returns
an instanced version of this node.

Reimplemented from Spatial.

Reimplemented in PointLight, and DirectionalLight.

◆ SetAmbient()

void Light::SetAmbient ( float  ambient)

Set the ambient light intensity.

Parameters
ambientThe desired ambient intensity for this light.

◆ SetColor()

void Light::SetColor ( Vector3  color)

Set the color property of this light

Parameters
colorThe desired color.

◆ SetDiffuse()

void Light::SetDiffuse ( float  diffuse)

Set the diffuse intensity.

Parameters
diffuseThe desired diffuse intensity for this light

◆ SetSpecular()

void Light::SetSpecular ( float  specular)

Set the specular intensity.

Parameters
specularThe desired specular intensity for this light.

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