Fork me on GitHub

API Documentation


Extends GLGE.Animatable, GLGE.JSONLoader, GLGE.Placeable, GLGE.QuickNotation.
Creates a new light source to be added to a scene
Defined in: glge_light.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
GLGE.Light(uid)
Field Summary
Field Attributes Field Name and Description
 
Dose this light source effect diffuse shading
 
Dose this light source effect specular shading
Method Summary
Method Attributes Method Name and Description
 
 
 
getAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
 
Gets the shadow buffer width
 
Gets the shadow buffer width
 
Gets the number of cascade levels to use for directional shadows
 
Gets the shadow casting flag
 
Gets the current color of the light source
 
Gets the shadow casting distance
 
getNegative(negative)
Gets negative shadow flag
 
Gets the shadow bias
 
Gets the number of samples for this shadow
 
Gets the spot light cut off
 
Gets the spot light cut off flag
 
Gets the spot light exponent
 
Gets the spotlights blur distance in pixels
 
Gets the softness of the spot shadow
 
Gets the type of the light
 
setAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
 
Sets the light sources constant attenuation
 
Sets the light sources linear attenuation
 
Sets the light sources quadratic attenuation
 
Sets the shadow buffer width
 
Sets the shadow buffer width
 
setCascadeLevels(cascadeLevels)
Sets the number of cascade levels for directions shadows
 
Sets the shadow casting flag
 
setColor(color)
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
 
setDistance(distance)
Sets the shadow casting flag
 
Sets negative shadow flag
 
Sets the shadow bias
 
Sets the number of samples for this shadow
 
Sets the shadow softness
 
Sets the spot light cut off
 
Sets the spot light cut off true results in circle spot light otherwise square
 
Sets the spot light exponent
 
setSpotSoftDistance(spotSoftnessDistance)
Sets the spotlights variance cutoff used to reduce light bleed
 
setSpotSoftness(spotSoftness)
Sets the softness of the spot shadow
 
setType(type)
Sets the type of the light
Methods borrowed from class GLGE.Animatable:
animate, blendTo, getAnimation, getBlendFunction, getFrameNumber, getFrameRate, getLoop, getName, getPaused, isLooping, setAnimation, setBlendFunction, setFrameRate, setLoop, setName, setPaused, setStartFrame, togglePaused
Methods borrowed from class GLGE.Events:
addEventListener, fireEvent, removeEventListener
Methods borrowed from class GLGE.Placeable:
clearStaticMatrix, getDLocX, getDLocY, getDLocZ, getDRotX, getDRotY, getDRotZ, getDScaleX, getDScaleY, getDScaleZ, getId, getInverseModelMatrix, getLocalMatrix, getLocX, getLocY, getLocZ, getLookat, getModelMatrix, getPosition, getQuatW, getQuatX, getQuatY, getQuatZ, getRef, getRoot, getRotation, getRotMatrix, getRotOrder, getRotX, getRotY, getRotZ, getScale, getScaleMatrix, getScaleX, getScaleY, getScaleZ, getTranslateMatrix, getTransposeInverseModelMatrix, getTransposeModelMatrix, getUpAxis, Lookat, move, setDLoc, setDLocX, setDLocY, setDLocZ, setDRot, setDRotX, setDRotY, setDRotZ, setDScale, setDScaleX, setDScaleY, setDScaleZ, setId, setLoc, setLocX, setLocY, setLocZ, setLookat, setQuat, setQuatW, setQuatX, setQuatY, setQuatZ, setRot, setRotMatrix, setRotOrder, setRotX, setRotY, setRotZ, setScale, setScaleX, setScaleY, setScaleZ, setStaticMatrix, setTransformMode, setUpAxis
Methods borrowed from class GLGE.QuickNotation:
_
Methods borrowed from class GLGE.JSONLoader:
getDownloadPriority, setDownloadPriority, setJSONSrc, setJSONString
Event Summary
Event Attributes Event Name and Description
 
Events borrowed from class GLGE.Animatable:
animFinished
Events borrowed from class GLGE.Placeable:
appened, childMatrixUpdate, matrixUpdate, removed
Class Detail
GLGE.Light(uid)
Parameters:
uid
Field Detail
{Boolean} diffuse
Dose this light source effect diffuse shading

{Boolean} specular
Dose this light source effect specular shading
Method Detail
disableLight()

enableLight()

{Object} getAttenuation(constant, linear, quadratic)
Sets the light sources Attenuation
Parameters:
constant
linear
quadratic
Returns:
{Object} The components of the light sources attenuation

{number} getBufferHeight()
Gets the shadow buffer width
Returns:
{number} The shadow buffer width

{number} getBufferWidth()
Gets the shadow buffer width
Returns:
{number} The shadow buffer width

{number} getCascadeLevels()
Gets the number of cascade levels to use for directional shadows
Returns:
{number} the number of cascades

{number} getCastShadows()
Gets the shadow casting flag
Returns:
{number} true if casts shadows

{[r|g|b]} getColor()
Gets the current color of the light source
Returns:
{[r|g|b]} The current position

{number} getDistance()
Gets the shadow casting distance
Returns:
{number} distance

getNegative(negative)
Gets negative shadow flag
Parameters:
{boolean} negative
shadow

{number} getShadowBias()
Gets the shadow bias
Returns:
{number} The shadow buffer bias

{number} getShadowSamples()
Gets the number of samples for this shadow
Returns:
{number} The number of samples

{number} getSpotCosCutOff()
Gets the spot light cut off
Returns:
{number} The cos of the limiting angle

{number} getSpotCutOff()
Gets the spot light cut off flag
Returns:
{number} The spot cutoff flag

{number} getSpotExponent()
Gets the spot light exponent
Returns:
{number} The exponent of the spot light

{Number} getSpotSoftDistance()
Gets the spotlights blur distance in pixels
Returns:
{Number} The blur distance for spot lights

{Number} getSpotSoftness()
Gets the softness of the spot shadow
Returns:
{Number} The type of the light source eg GLGE.L_POINT

{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

setBufferHeight(value)
Sets the shadow buffer width
Parameters:
{number} value
The shadow buffer width

setBufferWidth(value)
Sets the shadow buffer width
Parameters:
{number} value
The shadow buffer width

setCascadeLevels(cascadeLevels)
Sets the number of cascade levels for directions shadows
Parameters:
{number} cascadeLevels
The number of cascade levels(higher slower better quailty)

setCastShadows(value)
Sets the shadow casting flag
Parameters:
{number} value
should cast shadows?

setColor(color)
Sets the color of the light source
Parameters:
{string} color
The color of the light

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

setDistance(distance)
Sets the shadow casting flag
Parameters:
{number} distance

setNegativeShadow(negative)
Sets negative shadow flag
Parameters:
{boolean} negative
shadow

setShadowBias(value)
Sets the shadow bias
Parameters:
{number} value
The shadow bias

setShadowSamples(value)
Sets the number of samples for this shadow
Parameters:
{number} value
The number of samples to perform

setShadowSoftness(value)
Sets the shadow softness
Parameters:
{number} value
The number of samples to perform

setSpotCosCutOff(value)
Sets the spot light cut off
Parameters:
{number} value
The cos of the angle to limit

setSpotCutOff(value)
Sets the spot light cut off true results in circle spot light otherwise square
Parameters:
{number} value
The spot cutoff flag

setSpotExponent(value)
Sets the spot light exponent
Parameters:
{number} value
The spot lights exponent

setSpotSoftDistance(spotSoftnessDistance)
Sets the spotlights variance cutoff used to reduce light bleed
Parameters:
{Number} spotSoftnessDistance
the spotlights variance cutoff

setSpotSoftness(spotSoftness)
Sets the softness of the spot shadow
Parameters:
{Number} spotSoftness
The type of the light source eg GLGE.L_POINT

setType(type)
Sets the type of the light
Parameters:
{Number} type
The type of the light source eg GLGE.L_POINT
Event Detail
shaderupdate(data)
Parameters:
{object} data

Documentation generated by JsDoc Toolkit 2.4.0 on Sun Feb 12 2012 14:20:23 GMT+0000 (GMT)