Class Index | File Index

Classes


Class c3dl.DirectionalLight


Extends c3dl.Light.
A DirectionalLight inherits from Light. It does not have a position such as a PositionalLight. It only has a direction. Think if a directional light as being infinately far from the scene, but its light rays travelling in the direction specified. Since it has no position, it will always light a side of an object.

When specifying the direction, you are specifying where the light rays are going towards.

A DirectionalLight is useful when a scene contains an 2D array of objects aligned in a square. If all the objects are to be light the same way, a directional light would be a good choice to add to the scene.
Defined in: directionallight.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
Get the direction of this light.
 
Set the direction of this light.
Methods borrowed from class c3dl.Light:
getAmbient, getDiffuse, getName, getSpecular, getType, isOn, setAmbient, setDiffuse, setName, setOn, setSpecular
Class Detail
c3dl.DirectionalLight()
Method Detail
{Array} getDirection()
Get the direction of this light. The default direction of the light is [0,0,1].
Returns:
{Array} the direction of the light which will be unit length.

setDirection(dir)
Set the direction of this light. The 'dir' argument will be scaled to a unit vector before being assigned if not already unit length.
Parameters:
{Array} dir
Will be scaled to a unit vector before being assigned if not already unit length.

Documentation generated by JsDoc Toolkit 2.1.0 on Fri Feb 19 2010 17:58:40 GMT-0500 (EST)