API Documentation

for 0.0.1
Show:

Light Class

Light will enable object to be seen in space. Camera and Light are requiered for a basic scene.

Constructor

Light

(
  • params
)

Parameters:

  • params Object

    parameters object

    • [type:"point"] String optional

      one of "point", "directional", "ambient", "spot"

    • [intensity=1] Number optional
    • [distance=1000] Number optional

      distance is taken in account only for point lights

    • [color=Color.white] Color optional

Methods

getAngle

() Number

getAngle

Returns:

Number:

the angle

getColor

() Color

getColor

Returns:

Color:

color

getDistance

() Number

Gets the light's distance factor

Returns:

Number:

the light distance factor

getIntensity

(
  • val
)

Gets the light's intensity

Parameters:

  • val Object

getVisible

() Boolean

getVisible

Returns:

Boolean:

value true or false

setAngle

(
  • angle
)

Maximum extent of the spotlight, in radians, from its direction. Should be no more than Math.PI/2. The default is Math.PI/3.

Parameters:

  • angle Number

    the spot angle

setCastShadow

(
  • enabled
)

setCastShadow

Parameters:

  • enabled Boolean

setColor

(
  • color
)

setColor

Parameters:

setDistance

(
  • val
)

Sets the light's distance factor

Parameters:

  • val Number

setIntensity

(
  • val
)

Sets the light's intensity

Parameters:

  • val Object

setPenumbra

(
  • val
)

Smoothness of the spot impact shape (makes the light circle blurry)

Parameters:

  • val Object

    between 0 and 1

setShadowDistance

(
  • near
  • far
)

setShadowDistance

Parameters:

  • near Number

    min shadow distance

  • far Number

    max shadow distance

setShadowSize

(
  • width
  • height
)

set the Shadow map Size

Parameters:

  • width Number
  • height Number

setTargetPosition

(
  • x
  • y
  • z
)

Position in space to where the spot light points

Parameters:

  • x Object
  • y Object
  • z Object

setVisible

(
  • value
)

setVisible

Parameters:

  • value Boolean

    true or false to enable this light or not