Class Index | File Index

Classes


Class c3dl.PositionalLight


Extends c3dl.Light.
A PositionalLight inherits from Light. Unlike DirectionalLight, a PositionalLight can have an attenuation factor.
Defined in: positionallight.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
Get the attenuation factors of this light.
 
Get the position of the light.
 
setAttenuation(attenuation)
Set the attenuation factors of this light.
 
setPosition(Position)
Set the position of this light.
Methods borrowed from class c3dl.Light:
getAmbient, getDiffuse, getName, getSpecular, getType, isOn, setAmbient, setDiffuse, setName, setOn, setSpecular
Class Detail
c3dl.PositionalLight()
See:
c3dl.Light
Method Detail
{Array} getAttenuation()
Get the attenuation factors of this light. This is an array of three values which include constant attenuation, linear attenuation and quadratic attenuation.
Returns:
{Array} The attenuation factors

{Array} getPosition()
Get the position of the light.
Returns:
{Array} the position of the light.

setAttenuation(attenuation)
Set the attenuation factors of this light. the attenuation factor is calculated: attenuation factor = 1 / (C + L*D + Q*D^2)
C = constant attenuation, 0th element
L = linear attenuation, 1st element
Q = quadratic attenuation, 2nd element
D = distance between light and vertex.
Parameters:
{Array} attenuation

setPosition(Position)
Set the position of this light.
Parameters:
{Array} Position
of the light relative to world space.

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