Couch
Public Member Functions | List of all members
DirectionalLight Class Reference

#include <Light.h>

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

Public Member Functions

 DirectionalLight (Vector3 direction, Vector3 color, float ambient, float diffuse, float specular)
 
Vector3 GetDirection ()
 
void SetDirection (Vector3 direction)
 
virtual Name GetType () const
 
virtual DirectionalLightCreate ()
 
virtual DirectionalLightDuplicate ()
 
virtual DirectionalLightInstance ()
 
- Public Member Functions inherited from Light
Vector3 GetColor ()
 
void SetColor (Vector3 color)
 
float GetAmbient ()
 
void SetAmbient (float ambient)
 
float GetDiffuse ()
 
void SetDiffuse (float diffuse)
 
float GetSpecular ()
 
void SetSpecular (float specular)
 
- 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 ()
 

Additional Inherited Members

- Static Public Member Functions inherited from Node
static NodeGetRoot ()
 
- Protected Attributes inherited from Light
Vector3 color
 
float ambient
 
float diffuse
 
float specular
 

Detailed Description

Directional lights are infinitely far away lights that illuminate the whole world.

Member Function Documentation

◆ Create()

DirectionalLight * DirectionalLight::Create ( )
virtual

Allocates a new "default" version of this node.

Returns
A reference to the node.

Reimplemented from Light.

◆ Duplicate()

DirectionalLight * DirectionalLight::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 Light.

◆ GetDirection()

Vector3 DirectionalLight::GetDirection ( )

The direction from which this light is coming.

Returns
The direction of the light.

◆ Instance()

DirectionalLight * DirectionalLight::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 Light.

◆ SetDirection()

void DirectionalLight::SetDirection ( Vector3  direction)

Set the direction from which the light is coming.

Parameters
directionThe desired light direction

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