Repository

Light

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

Constructor Summary

Public Constructor
public

Member Summary

Public Members
public

color: *

public
public
public

target: *

public
public

type: *

Private Members
private

_light: *

Method Summary

Public Methods
public

getAngle

public

getColor

public

Gets the light's distance factor

public

Gets the light's intensity

public
public
public

setAngle(angle: Number)

Maximum extent of the spotlight, in radians, from its direction.

public

setCastShadow

public

setColor(color: Color)

setColor

public

Sets the light's distance factor

public

Sets the light's intensity

public

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

public

setShadowDistance

public

setShadowSize(width: Number, height: Number)

set the Shadow map Size

public

Position in space to where the spot light points

public

Public Constructors

public constructor(params: Object) source

Params:

NameTypeAttributeDescription
paramsObject

Parameters object, given by the constructor.

params.typeString
  • optional
  • default: "point"

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

params.intensityNumber
  • optional
  • default: 1
params.distanceNumber
  • optional
  • default: 1000

distance is taken in account only for point lights

params.colorColor
  • optional
  • default: Color.white

Public Members

public color: * source

public distance: * source

public intensity: * source

public target: * source

public transform: * source

public type: * source

Private Members

private _light: * source

Public Methods

public getAngle(): Number source

getAngle

Return:

Number

the angle

public getColor(): Color source

getColor

Return:

Color

color

public getDistance(): Number source

Gets the light's distance factor

Return:

Number

the light distance factor

public getIntensity(val: Object): * source

Gets the light's intensity

Params:

NameTypeAttributeDescription
valObject

Return:

*

public getNativeObject(): * source

Return:

*

the Three.js native object used in this class

public getVisible(): Boolean source

Return:

Boolean

value true or false

public setAngle(angle: Number) source

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

Params:

NameTypeAttributeDescription
angleNumber

the spot angle

public setCastShadow(enabled: Boolean) source

setCastShadow

Params:

NameTypeAttributeDescription
enabledBoolean

public setColor(color: Color) source

setColor

Params:

NameTypeAttributeDescription
colorColor

public setDistance(val: Number) source

Sets the light's distance factor

Params:

NameTypeAttributeDescription
valNumber

public setIntensity(val: Object) source

Sets the light's intensity

Params:

NameTypeAttributeDescription
valObject

public setPenumbra(val: Object) source

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

Params:

NameTypeAttributeDescription
valObject

between 0 and 1

public setShadowDistance(near: Number, far: Number) source

setShadowDistance

Params:

NameTypeAttributeDescription
nearNumber

min shadow distance

farNumber

max shadow distance

public setShadowSize(width: Number, height: Number) source

set the Shadow map Size

Params:

NameTypeAttributeDescription
widthNumber
heightNumber

public setTargetPosition(x: Object, y: Object, z: Object) source

Position in space to where the spot light points

Params:

NameTypeAttributeDescription
xObject
yObject
zObject

public setVisible(value: Boolean) source

Params:

NameTypeAttributeDescription
valueBoolean

true or false to enable this light or not