CLASSES
TagsA - Z

DirectionalLight

NodeLight

Description

class DirectionalLight extends Light

A directional light is defined by a direction.

The light is emitted from everywhere with a specific direction and has an infinite range.

Constructor

new DirectionalLight(name, direction, scene)

Creates a DirectionalLight object

Parameters

Name Type Description
name string The name of the object
direction Vector3 The direction of the light
scene Scene The scene to create the light into

Members

position : Vector3

The position of the light, used to calculate shadows

direction : Vector3

The direction of the light

transformedPosition : Vector3

shadowOrthoScale : number

autoUpdateExtends : boolean

Methods

getAbsolutePosition() → Vector3

setDirectionToTarget(target) → Vector3

Returns the normalized vector of the substraction between the given vector and the position of this light

Parameters

Name Type Description
target Vector3 The given target

setShadowProjectionMatrix(matrix, viewMatrix, renderList) → void

Parameters

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

supportsVSM() → boolean

needRefreshPerFrame() → boolean

needCube() → boolean

getShadowDirection(faceIndex) → Vector3

Parameters

Name Type Description
optional faceIndex number

computeTransformedPosition() → boolean

transferToEffect(effect, directionUniformName) → void

Parameters

Name Type Description
effect Effect The given effect
directionUniformName string The uniform name

getTypeID() → number