Object3D →
DirectionalLightHelper
Helper object to assist with visualizing a DirectionalLight's effect on the scene. This consists of plane and a line representing the light's position and direction.
Code Example
const light = new THREE.DirectionalLight( 0xFFFFFF ); const helper = new
THREE.DirectionalLightHelper( light, 5 ); scene.add( helper );
Constructor
DirectionalLightHelper
function DirectionalLightHelper( light: DirectionalLight, size: Number, color:
Hex ): void;
light-- The light to be visualized.
size -- (optional) dimensions of the plane. Default is 1.
color -- (optional) if this is not the set the helper will take the color of the light.
Properties
See the base Object3D class for common properties.
lightPlane
lightPlane: Line;
Contains the line mesh showing the location of the directional light.
light
light: DirectionalLight;
Reference to the directionalLight being visualized.
matrix
matrix: Object;
Reference to the light's matrixWorld.
matrixAutoUpdate
matrixAutoUpdate: Object;
See Object3D.matrixAutoUpdate. Set to false here as the helper is using
the light's matrixWorld.
color
color: hex;
The color parameter passed in the constructor. Default is undefined. If this
is changed, the helper's color will update the next time .update is
called.
Methods
See the base Object3D class for common properties.
dispose
function dispose( ): undefined;
Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app.
update
function update( ): undefined;
Updates the helper to match the position and direction of the .light being visualized.