Object3D →
SpotLightHelper
This displays a cone shaped helper object for a SpotLight.
Code Example
const spotLight = new THREE.SpotLight( 0xffffff ); spotLight.position.set( 10,
10, 10 ); scene.add( spotLight ); const spotLightHelper = new
THREE.SpotLightHelper( spotLight ); scene.add( spotLightHelper );
Examples
[example:webgl_lights_spotlights WebGL/ lights / spotlights ]
Constructor
SpotLightHelper
function SpotLightHelper( light: SpotLight, color: Hex ): void;
light -- The SpotLight to be visualized.
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.
cone
cone: LineSegments;
LineSegments used to visualize the light.
light
light: SpotLight;
Reference to the SpotLight being visualized.
matrix
matrix: Object;
Reference to the spotLight's matrixWorld.
matrixAutoUpdate
matrixAutoUpdate: Object;
See Object3D.matrixAutoUpdate. Set to false here as the helper is using
the spotLight'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 methods.
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 light helper.