Skip to content

Commit 2ec2102

Browse files
authored
Helpers: Clarify the usage of update(). (#32717)
1 parent 81563d4 commit 2ec2102

File tree

4 files changed

+13
-1
lines changed

4 files changed

+13
-1
lines changed

src/helpers/CameraHelper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ const _camera = /*@__PURE__*/ new Camera();
1818
*
1919
* `CameraHelper` must be a child of the scene.
2020
*
21+
* When the camera is transformed or its projection matrix is changed, it's necessary
22+
* to call the `update()` method of the respective helper.
23+
*
2124
* ```js
2225
* const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
2326
* const helper = new THREE.CameraHelper( camera );

src/helpers/DirectionalLightHelper.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,12 @@ const _v3 = /*@__PURE__*/ new Vector3();
1111

1212
/**
1313
* Helper object to assist with visualizing a {@link DirectionalLight}'s
14-
* effect on the scene. This consists of plane and a line representing the
14+
* effect on the scene. This consists of a plane and a line representing the
1515
* light's position and direction.
1616
*
17+
* When the directional light or its target are transformed or light properties
18+
* are changed, it's necessary to call the `update()` method of the respective helper.
19+
*
1720
* ```js
1821
* const light = new THREE.DirectionalLight( 0xFFFFFF );
1922
* scene.add( light );

src/helpers/HemisphereLightHelper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,9 @@ const _color2 = /*@__PURE__*/ new Color();
1414
* Creates a visual aid consisting of a spherical mesh for a
1515
* given {@link HemisphereLight}.
1616
*
17+
* When the hemisphere light is transformed or its light properties are changed,
18+
* it's necessary to call the `update()` method of the respective helper.
19+
*
1720
* ```js
1821
* const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
1922
* const helper = new THREE.HemisphereLightHelper( light, 5 );

src/helpers/SpotLightHelper.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ const _vector = /*@__PURE__*/ new Vector3();
1010
/**
1111
* This displays a cone shaped helper object for a {@link SpotLight}.
1212
*
13+
* When the spot light or its target are transformed or light properties are
14+
* changed, it's necessary to call the `update()` method of the respective helper.
15+
*
1316
* ```js
1417
* const spotLight = new THREE.SpotLight( 0xffffff );
1518
* spotLight.position.set( 10, 10, 10 );

0 commit comments

Comments
 (0)