CLASSES
TagsA - Z

SpotLight

NodeLight

Description

class SpotLight extends Light

A spot light is defined by a position, a direction, an angle and an exponent.

These values define a cone of light starting from the position toward the direction.

A tutorial about lights can be found here : https://doc.babylonjs.com/tutorials/lights

Constructor

new SpotLight(name, position, direction, angle, exponent, scene)

Creates a new SpotLight object

Parameters

Name Type Description
name string The name of the object
position Vector3 The position of the light in the scene
direction Vector3 The initial direction of the light
angle number The initial angle of the light
exponent number The initial exponent of the light

Members

position : Vector3

The position of the emitting point

direction : Vector3

The direction of the light

angle : number

The size of the spotlight beam

exponent : number

The speed of the decay of the light with distance

transformedPosition : Vector3

Methods

getAbsolutePosition() → Vector3

setShadowProjectionMatrix(matrix, viewMatrix, renderList) → void

Parameters

Name Type Description
matrix Matrix
viewMatrix Matrix
renderList Array<AbstractMesh>

needCube() → boolean

supportsVSM() → boolean

needRefreshPerFrame() → boolean

getShadowDirection(faceIndex) → Vector3

Parameters

Name Type Description
optional faceIndex number

setDirectionToTarget(target) → Vector3

Changes the light diretion to point to the given point

Parameters

Name Type Description
target Vector3 The given point

computeTransformedPosition() → boolean

transferToEffect(effect, positionUniformName, directionUniformName) → void

Parameters

Name Type Description
effect Effect The given effect
positionUniformName string The uniform name
directionUniformName string The direction of the uniform

getTypeID() → number

getRotation() → Vector3