From 5323b5e78c5198ff4bb9d4c09b47c468adb2749f Mon Sep 17 00:00:00 2001 From: Samuel Rigaud <46346622+s-rigaud@users.noreply.github.com> Date: Mon, 24 Feb 2025 09:21:38 -0500 Subject: [PATCH] Docs: typos (#30602) Co-authored-by: Samuel Rigaud --- examples/webgpu_volume_lighting.html | 4 ++-- examples/webgpu_volume_lighting_rectarea.html | 4 ++-- src/audio/AudioListener.js | 2 +- src/cameras/Camera.js | 4 ++-- src/core/Object3D.js | 10 +++++----- src/extras/ShapeUtils.js | 4 ++-- src/extras/core/Curve.js | 4 ++-- src/extras/core/Interpolations.js | 4 ++-- src/extras/core/Shape.js | 2 +- src/helpers/ArrowHelper.js | 2 +- src/helpers/CameraHelper.js | 2 +- src/loaders/Loader.js | 2 +- src/math/Euler.js | 2 +- src/math/Frustum.js | 4 ++-- src/math/Matrix3.js | 2 +- src/math/Matrix4.js | 6 +++--- src/math/Quaternion.js | 2 +- src/math/Triangle.js | 4 ++-- src/nodes/functions/VolumetricLightingModel.js | 8 ++++---- src/nodes/pmrem/PMREMNode.js | 2 +- src/textures/Texture.js | 2 +- 21 files changed, 38 insertions(+), 38 deletions(-) diff --git a/examples/webgpu_volume_lighting.html b/examples/webgpu_volume_lighting.html index 6fe4ff9ff42716..36729666602d80 100644 --- a/examples/webgpu_volume_lighting.html +++ b/examples/webgpu_volume_lighting.html @@ -196,7 +196,7 @@ //sunLight.add( new THREE.Mesh( new THREE.SphereGeometry( 0.1, 16, 16 ), new THREE.MeshBasicMaterial( { color: 0xffffff } ) ) ); scene.add( spotLight ); - // Post-Proccessing + // Post-Processing postProcessing = new THREE.PostProcessing( renderer ); @@ -213,7 +213,7 @@ const scenePass = pass( scene, camera ); const sceneLinearDepth = scenePass.getTextureNode( 'depth' ); - // Material - Apply oclussion depth of volumetric lighting based on the scene depth + // Material - Apply occlusion depth of volumetric lighting based on the scene depth volumetricMaterial.depthNode = sceneLinearDepth.sample( screenUV ); diff --git a/examples/webgpu_volume_lighting_rectarea.html b/examples/webgpu_volume_lighting_rectarea.html index 0c6c31e77a4aab..3bbd6c8735f957 100644 --- a/examples/webgpu_volume_lighting_rectarea.html +++ b/examples/webgpu_volume_lighting_rectarea.html @@ -217,7 +217,7 @@ controls.target.copy( meshKnot.position ); controls.update(); - // Post-Proccessing + // Post-Processing postProcessing = new THREE.PostProcessing( renderer ); @@ -234,7 +234,7 @@ const scenePass = pass( scene, camera ); const sceneLinearDepth = scenePass.getTextureNode( 'depth' ); - // Material - Apply oclussion depth of volumetric lighting based on the scene depth + // Material - Apply occlusion depth of volumetric lighting based on the scene depth volumetricMaterial.depthNode = sceneLinearDepth.sample( screenUV ); diff --git a/src/audio/AudioListener.js b/src/audio/AudioListener.js index e0a60c9a310a78..1bb2e84e7cbcf3 100644 --- a/src/audio/AudioListener.js +++ b/src/audio/AudioListener.js @@ -10,7 +10,7 @@ const _scale = /*@__PURE__*/ new Vector3(); const _orientation = /*@__PURE__*/ new Vector3(); /** - * The class represents a virtual listern of the all positional and non-positional audio effects + * The class represents a virtual listener of the all positional and non-positional audio effects * in the scene. A three.js application usually creates a single listener. It is a mandatory * constructor parameter for audios entities like {@link Audio} and {@link PositionalAudio}. * diff --git a/src/cameras/Camera.js b/src/cameras/Camera.js index 785b1fb70da633..fd9ff20877aba0 100644 --- a/src/cameras/Camera.js +++ b/src/cameras/Camera.js @@ -44,14 +44,14 @@ class Camera extends Object3D { this.projectionMatrix = new Matrix4(); /** - * The inverse of the camera's prjection matrix. + * The inverse of the camera's projection matrix. * * @type {Matrix4} */ this.projectionMatrixInverse = new Matrix4(); /** - * The coordinate system in which the camrea is used. + * The coordinate system in which the camera is used. * * @type {(WebGLCoordinateSystem|WebGPUCoordinateSystem)} */ diff --git a/src/core/Object3D.js b/src/core/Object3D.js index 1e65443d60e5df..1145a019143ad0 100644 --- a/src/core/Object3D.js +++ b/src/core/Object3D.js @@ -182,7 +182,7 @@ class Object3D extends EventDispatcher { value: rotation }, /** - * Represents the object's local rotation as Quaterions. + * Represents the object's local rotation as Quaternions. * * @name Object3D#quaternion * @type {Quaternion} @@ -409,7 +409,7 @@ class Object3D extends EventDispatcher { /** * Applies a rotation represented by given the quaternion to the 3D object. * - * @param {Quaternion} q - The quaterion. + * @param {Quaternion} q - The quaternion. * @return {Object3D} A reference to this instance. */ applyQuaternion( q ) { @@ -460,9 +460,9 @@ class Object3D extends EventDispatcher { } /** - * Sets the given rotation represented as a Quanterion to the 3D object. + * Sets the given rotation represented as a Quaternion to the 3D object. * - * @param {Quaternion} q - The Quanterion + * @param {Quaternion} q - The Quaternion */ setRotationFromQuaternion( q ) { @@ -1079,7 +1079,7 @@ class Object3D extends EventDispatcher { /** * Updates the transformation matrix in local space by computing it from the current - * positon, rotation and scale values. + * position, rotation and scale values. */ updateMatrix() { diff --git a/src/extras/ShapeUtils.js b/src/extras/ShapeUtils.js index e36ef7e8af17c7..683c0382e95945 100644 --- a/src/extras/ShapeUtils.js +++ b/src/extras/ShapeUtils.js @@ -31,7 +31,7 @@ class ShapeUtils { /** * Returns `true` if the given contour uses a clockwise winding order. * - * @param {Array} pts - An array of 2D points defining a polyong. + * @param {Array} pts - An array of 2D points defining a polygon. * @return {boolean} Whether the given contour uses a clockwise winding order or not. */ static isClockWise( pts ) { @@ -41,7 +41,7 @@ class ShapeUtils { } /** - * Triangluates the given shape definition. + * Triangulates the given shape definition. * * @param {Array} contour - An array of 2D points defining the contour. * @param {Array>} holes - An array that holds arrays of 2D points defining the holes. diff --git a/src/extras/core/Curve.js b/src/extras/core/Curve.js index 348bc83eddf00f..1c3e23fbe4e36e 100644 --- a/src/extras/core/Curve.js +++ b/src/extras/core/Curve.js @@ -287,7 +287,7 @@ class Curve { * * @param {number} t - The interpolation factor. * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to. - * @return {(Vector2|Vector3)} The tagent vector. + * @return {(Vector2|Vector3)} The tangent vector. */ getTangent( t, optionalTarget ) { @@ -316,7 +316,7 @@ class Curve { * * @param {number} u - The interpolation factor. * @param {(Vector2|Vector3)} [optionalTarget] - The optional target vector the result is written to. - * @return {(Vector2|Vector3)} The tagent vector. + * @return {(Vector2|Vector3)} The tangent vector. * @see {@link Curve#getPointAt} */ getTangentAt( u, optionalTarget ) { diff --git a/src/extras/core/Interpolations.js b/src/extras/core/Interpolations.js index e7f8ffca05b642..cfc97d0edcfc45 100644 --- a/src/extras/core/Interpolations.js +++ b/src/extras/core/Interpolations.js @@ -1,14 +1,14 @@ // Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve /** - * Computes a point on a Camtull-Rom spline. + * Computes a point on a Catmull-Rom spline. * * @param {number} t - The interpolation factor. * @param {number} p0 - The first control point. * @param {number} p1 - The second control point. * @param {number} p2 - The third control point. * @param {number} p3 - The fourth control point. - * @return {number} The calculated point on a Camtull-Rom spline. + * @return {number} The calculated point on a Catmull-Rom spline. */ function CatmullRom( t, p0, p1, p2, p3 ) { diff --git a/src/extras/core/Shape.js b/src/extras/core/Shape.js index a59114d2355025..66f4e96b4d9cb8 100644 --- a/src/extras/core/Shape.js +++ b/src/extras/core/Shape.js @@ -54,7 +54,7 @@ class Shape extends Path { this.type = 'Shape'; /** - * Defines the holes in the shape. Hole defnitions must use the + * Defines the holes in the shape. Hole definitions must use the * opposite winding order (CW/CCW) than the outer shape. * * @type {Array} diff --git a/src/helpers/ArrowHelper.js b/src/helpers/ArrowHelper.js index d7bf25059c8b3a..bc1f192f048803 100644 --- a/src/helpers/ArrowHelper.js +++ b/src/helpers/ArrowHelper.js @@ -33,7 +33,7 @@ let _lineGeometry, _coneGeometry; class ArrowHelper extends Object3D { /** - * Constructs a new arror helper. + * Constructs a new arrow helper. * * @param {Vector3} [dir=(0, 0, 1)] - The (normalized) direction vector. * @param {Vector3} [origin=(0, 0, 0)] - Point at which the arrow starts. diff --git a/src/helpers/CameraHelper.js b/src/helpers/CameraHelper.js index ffce1b9b5fb5db..bad2310da126c9 100644 --- a/src/helpers/CameraHelper.js +++ b/src/helpers/CameraHelper.js @@ -29,7 +29,7 @@ const _camera = /*@__PURE__*/ new Camera(); class CameraHelper extends LineSegments { /** - * Constructs a new arror helper. + * Constructs a new arrow helper. * * @param {Camera} camera - The camera to visualize. */ diff --git a/src/loaders/Loader.js b/src/loaders/Loader.js index 9ac8f52cadca43..426a64bdb2ea71 100644 --- a/src/loaders/Loader.js +++ b/src/loaders/Loader.js @@ -186,7 +186,7 @@ class Loader { * * * @callback onErrorCallback - * @param {Error} error - The error which occured during the loading process. + * @param {Error} error - The error which occurred during the loading process. */ /** diff --git a/src/math/Euler.js b/src/math/Euler.js index 5f0e155bccf5f5..6b5dd09d858843 100644 --- a/src/math/Euler.js +++ b/src/math/Euler.js @@ -377,7 +377,7 @@ class Euler { /** * Sets this Euler instance's components to values from the given array. The first three - * entries of the array are assign to the x,y and z components. An optinal fourth entry + * entries of the array are assign to the x,y and z components. An optional fourth entry * defines the Euler order. * * @param {Array} array - An array holding the Euler component values. diff --git a/src/math/Frustum.js b/src/math/Frustum.js index b33598ae3d7b04..3bbf9ef5aec9dc 100644 --- a/src/math/Frustum.js +++ b/src/math/Frustum.js @@ -37,7 +37,7 @@ class Frustum { } /** - * Sets the frustum planens by copying the given planes. + * Sets the frustum planes by copying the given planes. * * @param {Plane} [p0] - The first plane that encloses the frustum. * @param {Plane} [p1] - The second plane that encloses the frustum. @@ -232,7 +232,7 @@ class Frustum { * Returns `true` if the given point lies within the frustum. * * @param {Vector3} point - The point to test. - * @return {boolean} Whether the point liest within this frustum or not. + * @return {boolean} Whether the point lies within this frustum or not. */ containsPoint( point ) { diff --git a/src/math/Matrix3.js b/src/math/Matrix3.js index e7d29496bf4bf2..11dc982c311608 100644 --- a/src/math/Matrix3.js +++ b/src/math/Matrix3.js @@ -352,7 +352,7 @@ class Matrix3 { /** * Transposes this matrix into the supplied array, and returns itself unchanged. * - * @param {Array} r - An arry to store the transposed matrix elements. + * @param {Array} r - An array to store the transposed matrix elements. * @return {Matrix3} A reference to this matrix. */ transposeIntoArray( r ) { diff --git a/src/math/Matrix4.js b/src/math/Matrix4.js index 2e1eebfdf77029..f9aba57ccee9e9 100644 --- a/src/math/Matrix4.js +++ b/src/math/Matrix4.js @@ -680,7 +680,7 @@ class Matrix4 { * Sets the position component for this matrix from the given vector, * without affecting the rest of the matrix. * - * @param {number|Vector3} x - The x component of the vector or alternativley the vector object. + * @param {number|Vector3} x - The x component of the vector or alternatively the vector object. * @param {number} y - The y component of the vector. * @param {number} z - The z component of the vector. * @return {Matrix4} A reference to this matrix. @@ -782,7 +782,7 @@ class Matrix4 { /** * Gets the maximum scale value of the three axes. * - * @return {number} The maxium scale. + * @return {number} The maximum scale. */ getMaxScaleOnAxis() { @@ -1035,7 +1035,7 @@ class Matrix4 { } /** - * Decomposes this matrix into its positon, rotation and scale components + * Decomposes this matrix into its position, rotation and scale components * and provides the result in the given objects. * * Note: Not all matrices are decomposable in this way. For example, if an diff --git a/src/math/Quaternion.js b/src/math/Quaternion.js index 11a1424f56eb7c..04766a421eb9f1 100644 --- a/src/math/Quaternion.js +++ b/src/math/Quaternion.js @@ -532,7 +532,7 @@ class Quaternion { } /** - * Rotates this quaternion by a given angular step to the given quaterion. + * Rotates this quaternion by a given angular step to the given quaternion. * The method ensures that the final quaternion will not overshoot `q`. * * @param {Quaternion} q - The target quaternion. diff --git a/src/math/Triangle.js b/src/math/Triangle.js index b9af2747463ae2..d568d443686b88 100644 --- a/src/math/Triangle.js +++ b/src/math/Triangle.js @@ -81,7 +81,7 @@ class Triangle { } /** - * Copmutes a barycentric coordinates from the given vector. + * Computes a barycentric coordinates from the given vector. * Returns `null` if the triangle is degenerate. * * @param {Vector3} point - A point in 3D space. @@ -366,7 +366,7 @@ class Triangle { } /** - * Copmutes a barycentric coordinates from the given vector. + * Computes a barycentric coordinates from the given vector. * Returns `null` if the triangle is degenerate. * * @param {Vector3} point - A point in 3D space. diff --git a/src/nodes/functions/VolumetricLightingModel.js b/src/nodes/functions/VolumetricLightingModel.js index c8b8615cc764bc..afe372147ace52 100644 --- a/src/nodes/functions/VolumetricLightingModel.js +++ b/src/nodes/functions/VolumetricLightingModel.js @@ -122,7 +122,7 @@ class VolumetricLightingModel extends LightingModel { } - scaterringLight( lightColor, builder ) { + scatteringLight( lightColor, builder ) { const sceneDepthNode = builder.context.sceneDepthNode; @@ -148,12 +148,12 @@ class VolumetricLightingModel extends LightingModel { if ( lightNode.light.distance === undefined ) return; - // TODO: We need a viewportOpaque*() ( output, depth ) to fit with modern rendering approches + // TODO: We need a viewportOpaque*() ( output, depth ) to fit with modern rendering approaches const directLight = lightColor.xyz.toVar(); directLight.mulAssign( lightNode.shadowNode ); // it no should be necessary if used in the same render pass - this.scaterringLight( directLight, builder ); + this.scatteringLight( directLight, builder ); } @@ -168,7 +168,7 @@ class VolumetricLightingModel extends LightingModel { const directLight = lightColor.xyz.mul( LTC_Evaluate_Volume( { P, p0, p1, p2, p3 } ) ).pow( 1.5 ); - this.scaterringLight( directLight, builder ); + this.scatteringLight( directLight, builder ); } diff --git a/src/nodes/pmrem/PMREMNode.js b/src/nodes/pmrem/PMREMNode.js index 7c6979e7b0ea93..191f995683b393 100644 --- a/src/nodes/pmrem/PMREMNode.js +++ b/src/nodes/pmrem/PMREMNode.js @@ -90,7 +90,7 @@ function _getPMREMFromTexture( texture, renderer, generator ) { /** * Returns a cache that stores generated PMREMs for the respective textures. - * A cache must be maintaned per renderer since PMREMs are render target textures + * A cache must be maintained per renderer since PMREMs are render target textures * which can't be shared across render contexts. * * @private diff --git a/src/textures/Texture.js b/src/textures/Texture.js index ea69d31c2efade..d1a18233afa831 100644 --- a/src/textures/Texture.js +++ b/src/textures/Texture.js @@ -36,7 +36,7 @@ class Texture extends EventDispatcher { * @param {number} [wrapT=ClampToEdgeWrapping] - The wrapT value. * @param {number} [magFilter=LinearFilter] - The mag filter value. * @param {number} [minFilter=LinearFilter] - The min filter value. - * @param {number} [format=RGABFormat] - The min filter value. + * @param {number} [format=RGBAFormat] - The min filter value. * @param {number} [type=UnsignedByteType] - The min filter value. * @param {number} [anisotropy=Texture.DEFAULT_ANISOTROPY] - The min filter value. * @param {string} [colorSpace=NoColorSpace] - The min filter value.