Table Of Contents

Previous topic

21.26. The Light Object

Next topic

21.28. The LoadingScreen Object

This Page

21.27. The LightInstance Object

A LightInstance has a reference to a Light object and is usually attached to a SceneNode.

Required scripts

The Light object requires:

/*{{ javascript("jslib/light.js") }}*/

21.27.1. Constructor

21.27.1.1. create

Summary

Creates and returns a LightInstance object with passed in light.

Syntax

var lightInstance = LightInstance.create(light);
node.addLightInstance(lightInstance);
light
A Light object.

21.27.2. Methods

21.27.2.1. clone

Summary

Creates a LightInstance by cloning an existing LightInstance.

Syntax

var newLightInstance = lightInstance.clone();

21.27.2.2. getWorldExtents

Summary

Get the world extents of the LightInstance.

This is only valid when attached to a SceneNode and the node has been updated.

Syntax

var extents = lightInstance.getWorldExtents();

Returns an extents array.

21.27.2.3. getNode

Summary

Get the SceneNode the LightInstance is attached to.

Syntax

var node = lightInstance.getNode();

Returns a SceneNode.