Просмотр исходного кода

Helpers: Clarify the usage of `update()`. (#32717)

Michael Herzog 1 месяц назад
Родитель
Сommit
2ec2102b2d

+ 3 - 0
src/helpers/CameraHelper.js

@@ -18,6 +18,9 @@ const _camera = /*@__PURE__*/ new Camera();
  *
  * `CameraHelper` must be a child of the scene.
  *
+ * When the camera is transformed or its projection matrix is changed, it's necessary
+ * to call the `update()` method of the respective helper.
+ *
  * ```js
  * const camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
  * const helper = new THREE.CameraHelper( camera );

+ 4 - 1
src/helpers/DirectionalLightHelper.js

@@ -11,9 +11,12 @@ const _v3 = /*@__PURE__*/ new Vector3();
 
 /**
  * Helper object to assist with visualizing a {@link DirectionalLight}'s
- * effect on the scene. This consists of plane and a line representing the
+ * effect on the scene. This consists of a plane and a line representing the
  * light's position and direction.
  *
+ * When the directional light or its target are transformed or light properties
+ * are changed, it's necessary to call the `update()` method of the respective helper.
+ *
  * ```js
  * const light = new THREE.DirectionalLight( 0xFFFFFF );
  * scene.add( light );

+ 3 - 0
src/helpers/HemisphereLightHelper.js

@@ -14,6 +14,9 @@ const _color2 = /*@__PURE__*/ new Color();
  * Creates a visual aid consisting of a spherical mesh for a
  * given {@link HemisphereLight}.
  *
+ * When the hemisphere light is transformed or its light properties are changed,
+ * it's necessary to call the `update()` method of the respective helper.
+ *
  * ```js
  * const light = new THREE.HemisphereLight( 0xffffbb, 0x080820, 1 );
  * const helper = new THREE.HemisphereLightHelper( light, 5 );

+ 3 - 0
src/helpers/SpotLightHelper.js

@@ -10,6 +10,9 @@ const _vector = /*@__PURE__*/ new Vector3();
 /**
  * This displays a cone shaped helper object for a {@link 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.
+ *
  * ```js
  * const spotLight = new THREE.SpotLight( 0xffffff );
  * spotLight.position.set( 10, 10, 10 );

粤ICP备19079148号