Class

Light

Light()

A light

Constructor

new Light()

Constructor

View Source Lights/Light.js, line 10

Extends

Methods

enable(value) → {Node}

Set node's state
Parameters:
Name Type Description
value boolean True to enable, false to disable
Inherited From:

View Source Scene/Node.js, line 115

A reference to the instance
Node

findChild(name) → (nullable) {Node}

Find the child with the given name
Parameters:
Name Type Description
name string A string
Inherited From:

View Source Scene/Node.js, line 127

A Node instance of null
Node

getAmbientColor() → {Color}

Get ambient color

View Source Lights/Light.js, line 104

A color instance
Color

getBoundingBox() → {Box}

Return Node's bounding Box
Inherited From:

View Source Scene/Node.js, line 202

A Box instance
Box

getChildren() → {Array.<Node>}

Return Node's children
Inherited From:

View Source Scene/Node.js, line 211

An array of Node
Array.<Node>

getDiffuseColor() → {Color}

Get diffuse color

View Source Lights/Light.js, line 113

A color instance
Color

getSpecularColor() → {Color}

Get specular color

View Source Lights/Light.js, line 122

A color instance
Color

isEnabled() → {boolean}

Get state
Inherited From:

View Source Scene/Node.js, line 220

True if the node is enabled, otherwise false
boolean

isRoot() → {boolean}

Indicates if the current node is the scene's root
Inherited From:

View Source Scene/Node.js, line 229

True if it's the root node, otherwise false
boolean

removeChild(node) → {boolean}

Remove a child from the node
Parameters:
Name Type Description
node Node A Node instance
Inherited From:

View Source Scene/Node.js, line 147

True if the operation is a success
boolean

setAmbientColor(r, g, b) → {Light}

Set ambient color
Parameters:
Name Type Description
r number Red value in the range 0 to 255
g number Green value in the range 0 to 255
b number Blue value in the range 0 to 255

View Source Lights/Light.js, line 65

A reference to the instance
Light

setChildren(nodes)

Force add children without setting parent node, carefully use this one.
Parameters:
Name Type Description
nodes Array.<Node> An array of nodes
Inherited From:

View Source Scene/Node.js, line 105

setDiffuseColor(r, g, b) → {Light}

Set diffuse color
Parameters:
Name Type Description
r number Red value in the range 0 to 255
g number Green value in the range 0 to 255
b number Blue value in the range 0 to 255

View Source Lights/Light.js, line 79

A reference to the instance
Light

setName(name) → {Node}

Set the name to easily retrieve it later
Parameters:
Name Type Description
name string A string
Inherited From:

View Source Scene/Node.js, line 165

A reference to the instance
Node

setSpecularColor(r, g, b) → {Light}

Set specular color
Parameters:
Name Type Description
r number Red value in the range 0 to 255
g number Green value in the range 0 to 255
b number Blue value in the range 0 to 255

View Source Lights/Light.js, line 93

A reference to the instance
Light

update(deltaTime, forceUpdatenullable) → {boolean}

Update the node and his children
Parameters:
Name Type Attributes Default Description
deltaTime number A floating value representing time elapsed between two frames
forceUpdate boolean <nullable>
false Set to true to force an update
Inherited From:

View Source Scene/Node.js, line 178

True if the node has been updated
boolean

visit(renderTarget) → {boolean}

Visit the node and his children
Parameters:
Name Type Description
renderTarget RenderTarget Renderer who called this method
Overrides:

View Source Lights/Light.js, line 48

True if visit was successful, otherwise false
boolean