Docs for Version: 1.0a
Show:
Extends MObject
Module: Light

Constructor

Light

(
  • tableOptions
)

Parameters:

  • tableOptions Dict

    light 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

(
  • mobject
)

Inherited from MObject:

Sets parent on MObject and unbinds current parent in RenderTree

Parameters:

  • mobject MObject

    mobject object to add as a child to RenderTree

fGI

(
  • sun
)
static

Parameters:

  • sun Boolean

    if true sun will be drawn

remove

()

Inherited from MObject:

Removes MObject from RenderTree

set Shadow

(
  • shadow
)

sets shadow for light system( 1 shadowmap per system allowed now )

Parameters:

setParent

(
  • parent
)

Inherited from MObject:

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:

Example:

world = new Scene() gshader = new basicShader() someMaterial = new Material({}) gshader.setParent(world) someMaterial.setParent(world)