PointLight

NodeLight

Description

class PointLight extends ShadowLight

Constructor

new PointLight(name, position, scene)

Creates a PointLight object from the passed name and position (Vector3) and adds it in the scene.

A PointLight emits the light in every direction.

It can cast shadows.

If the scene camera is already defined and you want to set your PointLight at the camera position, just set it :


var pointLight = new BABYLON.[PointLight](/classes/3.1/PointLight)("pl", camera.position, scene);

Documentation : http://doc.babylonjs.com/tutorials/lights

Parameters

Name Type Description
name string
position Vector3
scene Scene

Members

shadowAngle : number

Getter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback

This specifies what angle the shadow will use to be created.

     * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.

Setter: In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback

This specifies what angle the shadow will use to be created.

     * It default to 90 degrees to work nicely with the cube texture generation for point lights shadow maps.

direction : Vector3

In case of direction provided, the shadow will not use a cube texture but simulate a spot shadow as a fallback

Methods

getClassName() string

Returns the string "PointLight"

getTypeID() number

Returns the integer 0.

needCube() boolean

Specifies wether or not the shadowmap should be a cube texture.

getShadowDirection(faceIndex) Vector3

Returns a new Vector3 aligned with the PointLight cube system according to the passed cube face index (integer).

Parameters

Name Type Description
optional faceIndex number

transferToEffect(effect, lightIndex) PointLight

Sets the passed Effect "effect" with the PointLight transformed position (or position, if none) and passed name (string).

Returns the PointLight.

Parameters

Name Type Description
effect Effect
lightIndex string