Light Class
Constructor
Light
-
tableOptions
Parameters:
-
tableOptions
Dictlight options
Example:
light = new Light({ lightPosition: new Vector(1.3,4.0,-2.0), attenuation: 40.0, intensity: 1.33, lightType:1.0, color: [0.8,1.0,1.0] }) Example 2:
light = new Light([ { lightPosition: new Vector(1.3,4.0,-2.0), attenuation: 400.0, intensity: 1.2, color: [0.8,1.0,1.0] }, { lightPosition: new Vector(0.1,2.0,3.0), attenuation: 100.0, intensity: .33, color: [0.8,0.2,1.0] }, { lightPosition: new Vector(-1.3,4.0,-2.0), attenuation: 140.0, intensity: 1.33, color: [0.8,1.0,1.0] } ]) Example 3 creating ambient light:
light = new Light([ { intensity: 1.2, lightType:2.0, color: [0.8,1.0,1.0] }, ])
Item Index
Methods
- addChilds
- fGI static
- remove
- set Shadow
- setParent
Methods
addChilds
-
mobject
Sets parent on MObject and unbinds current parent in RenderTree
Parameters:
-
mobject
MObjectmobject object to add as a child to RenderTree
fGI
-
sun
Parameters:
-
sun
Booleanif true sun will be drawn
remove
()
Removes MObject from RenderTree
set Shadow
-
shadow
sets shadow for light system( 1 shadowmap per system allowed now )
Parameters:
-
shadow
Shadow
setParent
-
parent
Sets parent on MObject and unbinds current parent in RenderTree. Usually this is done inside GameObject, but you have also possibility to construct RenderTree by yourself.
Parameters:
-
parent
MObjectparent object
Example:
world = new Scene() gshader = new basicShader() someMaterial = new Material({}) gshader.setParent(world) someMaterial.setParent(world)