Class

SpotLight

SpotLight()

A spotlight

Constructor

new SpotLight()

Constructor

View Source Lights/SpotLight.js, line 9

Extends

Methods

getAmbientColor() → {Color}

Get ambient color
Inherited From:

View Source Lights/Light.js, line 104

A color instance
Color

getDiffuseColor() → {Color}

Get diffuse color
Inherited From:

View Source Lights/Light.js, line 113

A color instance
Color

getDirection() → {Array.<number>}

Get direction

View Source Lights/SpotLight.js, line 104

A vector with values for each axis
Array.<number>

getSpecularColor() → {Color}

Get specular color
Inherited From:

View Source Lights/Light.js, line 122

A color instance
Color

getValues() → {Array.<number>}

Get values

View Source Lights/SpotLight.js, line 113

An array with constant, linear and quadratic values
Array.<number>

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
Inherited From:

View Source Lights/Light.js, line 65

A reference to the instance
Light

setCutoff(value) → {SpotLight}

Set cut off
Parameters:
Name Type Description
value number The cutoff value

View Source Lights/SpotLight.js, line 77

A reference to the instance
SpotLight

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
Inherited From:

View Source Lights/Light.js, line 79

A reference to the instance
Light

setDirection(x, y, z) → {SpotLight}

Set direction
Parameters:
Name Type Description
x number Direction on X
y number Direction on Y
z number Direction on Z

View Source Lights/SpotLight.js, line 65

A reference to the instance
SpotLight

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
Inherited From:

View Source Lights/Light.js, line 93

A reference to the instance
Light

setValues(constant, linear, quadratic) → {SpotLight}

Set point light's values
Parameters:
Name Type Description
constant number The constant value
linear number The linear value
quadratic number The quadratic value

View Source Lights/SpotLight.js, line 91

A reference to the instance
SpotLight

visit(renderTarget) → {boolean}

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

View Source Lights/Light.js, line 48

True if visit was successful, otherwise false
boolean