Class GLGE.Light
Extends
GLGE.Animatable, GLGE.Placeable.
Creates a new light source to be added to a scene
Defined in: glge.js.
Constructor Attributes | Constructor Name and Description |
---|---|
GLGE.Light(type)
|
Field Attributes | Field Name and Description |
---|---|
<static> |
GLGE.Light.diffuse
Dose this light source effect diffuse shading
|
<static> |
GLGE.Light.specular
Dose this light source effect specular shading
|
Method Attributes | Method Name and Description |
---|---|
getAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
|
|
getColor()
Gets the current color of the light source
|
|
Gets the spot light cut off
|
|
Gets the spot light exponent
|
|
getType()
Gets the type of the light
|
|
setAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
|
|
setAttenuationConstant(value)
Sets the light sources constant attenuation
|
|
setAttenuationLinear(value)
Sets the light sources linear attenuation
|
|
setAttenuationQuadratic(value)
Sets the light sources quadratic attenuation
|
|
setColor(r, g, b)
Sets the color of the light source
|
|
setColorB(value)
Sets the blue color of the light source
|
|
setColorG(value)
Sets the green color of the light source
|
|
setColorR(value)
Sets the red color of the light source
|
|
setSpotCosCutOff(value)
Sets the spot light cut off
|
|
setSpotExponent(value)
Sets the spot light exponent
|
|
setType(type)
Sets the type of the light
|
- Methods borrowed from class GLGE.Animatable:
- animate, getAnimation, getFrameRate, setAnimation, setFrameRate
- Methods borrowed from class GLGE.Placeable:
- getDLocX, getDLocY, getDLocZ, getDRotX, getDRotY, getDRotZ, getDScaleX, getDScaleY, getDScaleZ, getLocX, getLocY, getLocZ, getModelMatrix, getPosition, getRotation, getRotMatrix, getRotX, getRotY, getRotZ, getSacleY, getScale, getScaleX, getScaleZ, setDLoc, setDLocX, setDLocY, setDLocZ, setDRot, setDRotX, setDRotY, setDRotZ, setDScale, setDScaleX, setDScaleY, setDScaleZ, setLoc, setLocX, setLocY, setLocZ, setRot, setRotX, setRotY, setRotZ, setScale, setScaleX, setScaleY, setScaleZ
Field Detail
<static>
{Boolean}
GLGE.Light.diffuse
Dose this light source effect diffuse shading
<static>
{Boolean}
GLGE.Light.specular
Dose this light source effect specular shading
Method Detail
{Object}
getAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
- Parameters:
- constant
- linear
- quadratic
- Returns:
- {Object} The components of the light sources attenuation
{[r|g|b]}
getColor()
Gets the current color of the light source
- Returns:
- {[r|g|b]} The current position
{number}
getSpotCosCutOff()
Gets the spot light cut off
- Returns:
- {number} The cos of the limiting angle
{number}
getSpotExponent()
Gets the spot light exponent
- Returns:
- {number} The exponent of the spot light
{Number}
getType()
Gets the type of the light
- Returns:
- {Number} The type of the light source eg GLGE.L_POINT
setAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
- Parameters:
- {Number} constant
- The constant part of the attenuation
- {Number} linear
- The linear part of the attenuation
- {Number} quadratic
- The quadratic part of the attenuation
setAttenuationConstant(value)
Sets the light sources constant attenuation
- Parameters:
- {Number} value
- The constant part of the attenuation
setAttenuationLinear(value)
Sets the light sources linear attenuation
- Parameters:
- {Number} value
- The linear part of the attenuation
setAttenuationQuadratic(value)
Sets the light sources quadratic attenuation
- Parameters:
- {Number} value
- The quadratic part of the attenuation
setColor(r, g, b)
Sets the color of the light source
- Parameters:
- {Number} r
- The new red level 0-1
- {Number} g
- The new green level 0-1
- {Number} b
- The new blue level 0-1
setColorB(value)
Sets the blue color of the light source
- Parameters:
- {Number} value
- The new blue level 0-1
setColorG(value)
Sets the green color of the light source
- Parameters:
- {Number} value
- The new green level 0-1
setColorR(value)
Sets the red color of the light source
- Parameters:
- {Number} value
- The new red level 0-1
setSpotCosCutOff(value)
Sets the spot light cut off
- Parameters:
- {number} value
- The cos of the angle to limit
setSpotExponent(value)
Sets the spot light exponent
- Parameters:
- {number} value
- The spot lights exponent
setType(type)
Sets the type of the light
- Parameters:
- {Number} type
- The type of the light source eg GLGE.L_POINT