Capítulo 147 de 859
This displays a cone shaped helper object for a SpotLight.
When the spot light or its target are transformed or light properties are changed, it's necessary to call the update() method of the respective helper.
const spotLight = new THREE.SpotLight( 0xffffff );
spotLight.position.set( 10, 10, 10 );
scene.add( spotLight );
const spotLightHelper = new THREE.SpotLightHelper( spotLight );
scene.add( spotLightHelper );
Constructor
| Signature |
|---|
| `new SpotLightHelper( light : HemisphereLight, color : number |
Properties
| Property | Description |
|---|---|
| `.color : number | Color |
.light : SpotLight | The light being visualized. |
Methods
| Method | Description |
|---|---|
.dispose() | Frees the GPU-related resources allocated by this instance. Call this method whenever this instance is no longer used in your app. |
.update() | Updates the helper to match the position and direction of the light being visualized. |