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

Doc: fix some errors (#30632)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud 10 месяцев назад
Родитель
Сommit
628fc0d0bb
55 измененных файлов с 77 добавлено и 77 удалено
  1. 1 1
      examples/jsm/geometries/ParametricGeometries.js
  2. 2 2
      src/animation/PropertyBinding.js
  3. 1 1
      src/materials/LineBasicMaterial.js
  4. 1 1
      src/materials/LineDashedMaterial.js
  5. 1 1
      src/materials/Material.js
  6. 1 1
      src/materials/MeshBasicMaterial.js
  7. 1 1
      src/materials/MeshDepthMaterial.js
  8. 1 1
      src/materials/MeshDistanceMaterial.js
  9. 1 1
      src/materials/MeshLambertMaterial.js
  10. 1 1
      src/materials/MeshMatcapMaterial.js
  11. 1 1
      src/materials/MeshNormalMaterial.js
  12. 1 1
      src/materials/MeshPhongMaterial.js
  13. 3 3
      src/materials/MeshPhysicalMaterial.js
  14. 1 1
      src/materials/MeshStandardMaterial.js
  15. 1 1
      src/materials/MeshToonMaterial.js
  16. 1 1
      src/materials/PointsMaterial.js
  17. 1 1
      src/materials/RawShaderMaterial.js
  18. 2 2
      src/materials/ShaderMaterial.js
  19. 1 1
      src/materials/ShadowMaterial.js
  20. 1 1
      src/materials/SpriteMaterial.js
  21. 1 1
      src/materials/nodes/Line2NodeMaterial.js
  22. 1 1
      src/materials/nodes/LineBasicNodeMaterial.js
  23. 1 1
      src/materials/nodes/LineDashedNodeMaterial.js
  24. 1 1
      src/materials/nodes/MeshBasicNodeMaterial.js
  25. 1 1
      src/materials/nodes/MeshLambertNodeMaterial.js
  26. 1 1
      src/materials/nodes/MeshMatcapNodeMaterial.js
  27. 1 1
      src/materials/nodes/MeshNormalNodeMaterial.js
  28. 1 1
      src/materials/nodes/MeshPhongNodeMaterial.js
  29. 1 1
      src/materials/nodes/MeshPhysicalNodeMaterial.js
  30. 1 1
      src/materials/nodes/MeshSSSNodeMaterial.js
  31. 1 1
      src/materials/nodes/MeshStandardNodeMaterial.js
  32. 1 1
      src/materials/nodes/MeshToonNodeMaterial.js
  33. 1 1
      src/materials/nodes/ShadowNodeMaterial.js
  34. 1 1
      src/materials/nodes/VolumeNodeMaterial.js
  35. 4 4
      src/nodes/accessors/InstanceNode.js
  36. 2 2
      src/nodes/accessors/ReferenceBaseNode.js
  37. 1 1
      src/nodes/accessors/StorageBufferNode.js
  38. 1 1
      src/nodes/core/AttributeNode.js
  39. 2 2
      src/nodes/core/NodeBuilder.js
  40. 1 1
      src/nodes/core/StructNode.js
  41. 2 2
      src/nodes/core/StructTypeNode.js
  42. 2 2
      src/nodes/core/VarNode.js
  43. 1 1
      src/nodes/gpgpu/ComputeNode.js
  44. 1 1
      src/nodes/pmrem/PMREMNode.js
  45. 1 1
      src/nodes/utils/CubeMapNode.js
  46. 2 2
      src/nodes/utils/ReflectorNode.js
  47. 2 2
      src/nodes/utils/TriplanarTexturesNode.js
  48. 1 1
      src/renderers/common/Animation.js
  49. 1 1
      src/renderers/common/Attributes.js
  50. 2 2
      src/renderers/common/RenderList.js
  51. 1 1
      src/renderers/common/RenderObject.js
  52. 2 2
      src/renderers/common/RenderObjects.js
  53. 6 6
      src/renderers/common/Renderer.js
  54. 3 3
      src/renderers/common/nodes/NodeBuilderState.js
  55. 1 1
      src/renderers/webgl-fallback/utils/WebGLUtils.js

+ 1 - 1
examples/jsm/geometries/ParametricGeometries.js

@@ -98,7 +98,7 @@ class ParametricTorusKnotGeometry extends ParametricTubeGeometry {
 		const radiusSegments = segmentsR;
 		const extrudePath = new TorusKnotCurve();
 
-		super( extrudePath, segments, tube, radiusSegments, true, false );
+		super( extrudePath, segments, tube, radiusSegments, true );
 
 		this.radius = radius;
 		this.tube = tube;

+ 2 - 2
src/animation/PropertyBinding.js

@@ -133,7 +133,7 @@ class PropertyBinding {
 		/**
 		 * The object owns the animated property.
 		 *
-		 * @type {Object}
+		 * @type {?Object}
 		 */
 		this.node = PropertyBinding.findNode( rootNode, this.parsedPath.nodeName );
 
@@ -259,7 +259,7 @@ class PropertyBinding {
 	 *
 	 * @static
 	 * @param {Object} root - The root object.
-	 * @param {string} nodeName - The name of the node.
+	 * @param {string|number} nodeName - The name of the node.
 	 * @return {?Object} The found node. Returns `null` if no object was found.
 	 */
 	static findNode( root, nodeName ) {

+ 1 - 1
src/materials/LineBasicMaterial.js

@@ -17,7 +17,7 @@ class LineBasicMaterial extends Material {
 	/**
 	 * Constructs a new line basic material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/LineDashedMaterial.js

@@ -21,7 +21,7 @@ class LineDashedMaterial extends LineBasicMaterial {
 	/**
 	 * Constructs a new line dashed material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/Material.js

@@ -541,7 +541,7 @@ class Material extends EventDispatcher {
 	 * It is a generic implementation so it can be used with different types
 	 * of materials.
 	 *
-	 * @param {Object} values - The material values to set.
+	 * @param {Object} [values] - The material values to set.
 	 */
 	setValues( values ) {
 

+ 1 - 1
src/materials/MeshBasicMaterial.js

@@ -15,7 +15,7 @@ class MeshBasicMaterial extends Material {
 	/**
 	 * Constructs a new mesh basic material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshDepthMaterial.js

@@ -12,7 +12,7 @@ class MeshDepthMaterial extends Material {
 	/**
 	 * Constructs a new mesh depth material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshDistanceMaterial.js

@@ -16,7 +16,7 @@ class MeshDistanceMaterial extends Material {
 	/**
 	 * Constructs a new mesh distance material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshLambertMaterial.js

@@ -25,7 +25,7 @@ class MeshLambertMaterial extends Material {
 	/**
 	 * Constructs a new mesh lambert material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshMatcapMaterial.js

@@ -19,7 +19,7 @@ class MeshMatcapMaterial extends Material {
 	/**
 	 * Constructs a new mesh matcap material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshNormalMaterial.js

@@ -12,7 +12,7 @@ class MeshNormalMaterial extends Material {
 	/**
 	 * Constructs a new mesh normal material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshPhongMaterial.js

@@ -23,7 +23,7 @@ class MeshPhongMaterial extends Material {
 	/**
 	 * Constructs a new mesh phong material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 3 - 3
src/materials/MeshPhysicalMaterial.js

@@ -33,7 +33,7 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 	/**
 	 * Constructs a new mesh physical material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted
@@ -111,8 +111,8 @@ class MeshPhysicalMaterial extends MeshStandardMaterial {
 		 * How much `clearcoatNormalMap` affects the clear coat layer, from
 		 * `(0,0)` to `(1,1)`.
 		 *
-		 * @type {number}
-		 * @default 0
+		 * @type {Vector2}
+		 * @default (1,1)
 		 */
 		this.clearcoatNormalScale = new Vector2( 1, 1 );
 

+ 1 - 1
src/materials/MeshStandardMaterial.js

@@ -42,7 +42,7 @@ class MeshStandardMaterial extends Material {
 	/**
 	 * Constructs a new mesh standard material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/MeshToonMaterial.js

@@ -13,7 +13,7 @@ class MeshToonMaterial extends Material {
 	/**
 	 * Constructs a new mesh toon material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/PointsMaterial.js

@@ -31,7 +31,7 @@ class PointsMaterial extends Material {
 	/**
 	 * Constructs a new points material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/RawShaderMaterial.js

@@ -14,7 +14,7 @@ class RawShaderMaterial extends ShaderMaterial {
 	/**
 	 * Constructs a new raw shader material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 2 - 2
src/materials/ShaderMaterial.js

@@ -41,7 +41,7 @@ class ShaderMaterial extends Material {
 	/**
 	 * Constructs a new shader material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted
@@ -226,7 +226,7 @@ class ShaderMaterial extends Material {
 		 * If set, this calls [gl.bindAttribLocation]{@link https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/bindAttribLocation}
 		 * to bind a generic vertex index to an attribute variable.
 		 *
-		 * @type {?string}
+		 * @type {string|undefined}
 		 * @default undefined
 		 */
 		this.index0AttributeName = undefined;

+ 1 - 1
src/materials/ShadowMaterial.js

@@ -24,7 +24,7 @@ class ShadowMaterial extends Material {
 	/**
 	 * Constructs a new shadow material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/SpriteMaterial.js

@@ -20,7 +20,7 @@ class SpriteMaterial extends Material {
 	/**
 	 * Constructs a new sprite material.
 	 *
-	 * @param {Object} parameters - An object with one or more properties
+	 * @param {Object} [parameters] - An object with one or more properties
 	 * defining the material's appearance. Any property of the material
 	 * (including any property from inherited materials) can be passed
 	 * in here. Color values can be passed any type of value accepted

+ 1 - 1
src/materials/nodes/Line2NodeMaterial.js

@@ -33,7 +33,7 @@ class Line2NodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new node material for wide line rendering.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters={}] - The configuration parameter.
 	 */
 	constructor( parameters = {} ) {
 

+ 1 - 1
src/materials/nodes/LineBasicNodeMaterial.js

@@ -20,7 +20,7 @@ class LineBasicNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new line basic node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/LineDashedNodeMaterial.js

@@ -24,7 +24,7 @@ class LineDashedNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new line dashed node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshBasicNodeMaterial.js

@@ -26,7 +26,7 @@ class MeshBasicNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh basic node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshLambertNodeMaterial.js

@@ -22,7 +22,7 @@ class MeshLambertNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh lambert node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshMatcapNodeMaterial.js

@@ -25,7 +25,7 @@ class MeshMatcapNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh normal node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshNormalNodeMaterial.js

@@ -27,7 +27,7 @@ class MeshNormalNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh normal node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshPhongNodeMaterial.js

@@ -25,7 +25,7 @@ class MeshPhongNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh lambert node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshPhysicalNodeMaterial.js

@@ -27,7 +27,7 @@ class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial {
 	/**
 	 * Constructs a new mesh physical node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshSSSNodeMaterial.js

@@ -83,7 +83,7 @@ class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial {
 	/**
 	 * Constructs a new mesh SSS node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshStandardNodeMaterial.js

@@ -27,7 +27,7 @@ class MeshStandardNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh standard node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/MeshToonNodeMaterial.js

@@ -21,7 +21,7 @@ class MeshToonNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new mesh toon node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/ShadowNodeMaterial.js

@@ -21,7 +21,7 @@ class ShadowNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new shadow node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 1 - 1
src/materials/nodes/VolumeNodeMaterial.js

@@ -18,7 +18,7 @@ class VolumeNodeMaterial extends NodeMaterial {
 	/**
 	 * Constructs a new volume node material.
 	 *
-	 * @param {?Object} parameters - The configuration parameter.
+	 * @param {Object} [parameters] - The configuration parameter.
 	 */
 	constructor( parameters ) {
 

+ 4 - 4
src/nodes/accessors/InstanceNode.js

@@ -63,14 +63,14 @@ class InstanceNode extends Node {
 		/**
 		 * The node that represents the instance matrix data.
 		 *
-		 * @type {Node}
+		 * @type {?Node}
 		 */
 		this.instanceMatrixNode = null;
 
 		/**
 		 * The node that represents the instance color data.
 		 *
-		 * @type {Node}
+		 * @type {?Node}
 		 */
 		this.instanceColorNode = null;
 
@@ -86,14 +86,14 @@ class InstanceNode extends Node {
 		/**
 		 * A reference to a buffer that is used by `instanceMatrixNode`.
 		 *
-		 * @type {InstancedInterleavedBuffer}
+		 * @type {?InstancedInterleavedBuffer}
 		 */
 		this.buffer = null;
 
 		/**
 		 * A reference to a buffer that is used by `instanceColorNode`.
 		 *
-		 * @type {InstancedBufferAttribute}
+		 * @type {?InstancedBufferAttribute}
 		 */
 		this.bufferColor = null;
 

+ 2 - 2
src/nodes/accessors/ReferenceBaseNode.js

@@ -24,7 +24,7 @@ class ReferenceElementNode extends ArrayElementNode {
 	/**
 	 * Constructs a new reference element node.
 	 *
-	 * @param {?ReferenceBaseNode} referenceNode - The reference node.
+	 * @param {ReferenceBaseNode} referenceNode - The reference node.
 	 * @param {Node} indexNode - The index node that defines the element access.
 	 */
 	constructor( referenceNode, indexNode ) {
@@ -351,7 +351,7 @@ export const reference = ( name, type, object ) => nodeObject( new ReferenceBase
  * @param {string} name - The name of the property the node refers to.
  * @param {string} type - The uniform type that should be used to represent the property value.
  * @param {number} count - The number of value inside the array-like object.
- * @param {Object} object - An array-like object the property belongs to.
+ * @param {Object} [object] - An array-like object the property belongs to.
  * @returns {ReferenceBaseNode}
  */
 export const referenceBuffer = ( name, type, count, object ) => nodeObject( new ReferenceBaseNode( name, type, object, count ) );

+ 1 - 1
src/nodes/accessors/StorageBufferNode.js

@@ -86,7 +86,7 @@ class StorageBufferNode extends BufferNode {
 		/**
 		 * The buffer struct type.
 		 *
-		 * @type {?structTypeNode}
+		 * @type {?StructTypeNode}
 		 * @default null
 		 */
 		this.structTypeNode = structTypeNode;

+ 1 - 1
src/nodes/core/AttributeNode.js

@@ -161,7 +161,7 @@ export default AttributeNode;
  * @tsl
  * @function
  * @param {string} name - The name of the attribute.
- * @param {?string} nodeType - The node type.
+ * @param {string} [nodeType] - The node type.
  * @returns {AttributeNode}
  */
 export const attribute = ( name, nodeType ) => nodeObject( new AttributeNode( name, nodeType ) );

+ 2 - 2
src/nodes/core/NodeBuilder.js

@@ -946,7 +946,7 @@ class NodeBuilder {
 	 * Only relevant for WebGL and its `WEBGL_multi_draw` extension.
 	 *
 	 * @abstract
-	 * @return {string} The drawIndex shader string.
+	 * @return {?string} The drawIndex shader string.
 	 */
 	getDrawIndex() {
 
@@ -2166,7 +2166,7 @@ class NodeBuilder {
 	 *
 	 * @abstract
 	 * @param {string} op - The operator name to resolve.
-	 * @return {string} The resolved operator name.
+	 * @return {?string} The resolved operator name.
 	 */
 	getFunctionOperator( /* op */ ) {
 

+ 1 - 1
src/nodes/core/StructNode.js

@@ -75,7 +75,7 @@ export default StructNode;
  * @tsl
  * @function
  * @param {Object} membersLayout - The layout of the struct members.
- * @param {string} [name=null] - The name of the struct.
+ * @param {?string} [name=null] - The name of the struct.
  * @returns {Function} The struct function.
  */
 export const struct = ( membersLayout, name = null ) => {

+ 2 - 2
src/nodes/core/StructTypeNode.js

@@ -46,7 +46,7 @@ class StructTypeNode extends Node {
 	 * Creates an instance of StructTypeNode.
 	 *
 	 * @param {Object} membersLayout - The layout of the members for the struct.
-	 * @param {string} [name=null] - The optional name of the struct.
+	 * @param {?string} [name=null] - The optional name of the struct.
 	 */
 	constructor( membersLayout, name = null ) {
 
@@ -62,7 +62,7 @@ class StructTypeNode extends Node {
 		/**
 		 * The name of the struct.
 		 *
-		 * @type {string}
+		 * @type {?string}
 		 * @default null
 		 */
 		this.name = name;

+ 2 - 2
src/nodes/core/VarNode.js

@@ -23,8 +23,8 @@ class VarNode extends Node {
 	 * Constructs a new variable node.
 	 *
 	 * @param {Node} node - The node for which a variable should be created.
-	 * @param {?string} name - The name of the variable in the shader.
-	 * @param {?boolean} readOnly - The read-only flag.
+	 * @param {?string} [name=null] - The name of the variable in the shader.
+	 * @param {boolean} [readOnly=false] - The read-only flag.
 	 */
 	constructor( node, name = null, readOnly = false ) {
 

+ 1 - 1
src/nodes/gpgpu/ComputeNode.js

@@ -91,7 +91,7 @@ class ComputeNode extends Node {
 		/**
 		 * TODO
 		 *
-		 * @type {Function}
+		 * @type {?Function}
 		 */
 		this.onInitFunction = null;
 

+ 1 - 1
src/nodes/pmrem/PMREMNode.js

@@ -348,7 +348,7 @@ export default PMREMNode;
  * Returns `true` if the given cube map image has been fully loaded.
  *
  * @private
- * @param {Array<(Image|Object)>} image - The cube map image.
+ * @param {?Array<(Image|Object)>} [image] - The cube map image.
  * @return {boolean} Whether the given cube map is ready or not.
  */
 function isCubeMapReady( image ) {

+ 1 - 1
src/nodes/utils/CubeMapNode.js

@@ -42,7 +42,7 @@ class CubeMapNode extends TempNode {
 		 * A reference to the internal cube texture.
 		 *
 		 * @private
-		 * @type {CubeTexture}
+		 * @type {?CubeTexture}
 		 * @default null
 		 */
 		this._cubeTexture = null;

+ 2 - 2
src/nodes/utils/ReflectorNode.js

@@ -76,8 +76,8 @@ class ReflectorNode extends TextureNode {
 		 * A reference to the internal reflector base node which holds the actual implementation.
 		 *
 		 * @private
-		 * @type {?ReflectorBaseNode}
-		 * @default null
+		 * @type {ReflectorBaseNode}
+		 * @default ReflectorBaseNode
 		 */
 		this._reflectorBaseNode = parameters.reflector || new ReflectorBaseNode( this, parameters );
 

+ 2 - 2
src/nodes/utils/TriplanarTexturesNode.js

@@ -46,7 +46,7 @@ class TriplanarTexturesNode extends Node {
 		/**
 		 * Second texture node. When not set, the shader will sample from `textureXNode` instead.
 		 *
-		 * @type {Node}
+		 * @type {?Node}
 		 * @default null
 		 */
 		this.textureYNode = textureYNode;
@@ -54,7 +54,7 @@ class TriplanarTexturesNode extends Node {
 		/**
 		 * Third texture node. When not set, the shader will sample from `textureXNode` instead.
 		 *
-		 * @type {Node}
+		 * @type {?Node}
 		 * @default null
 		 */
 		this.textureZNode = textureZNode;

+ 1 - 1
src/renderers/common/Animation.js

@@ -92,7 +92,7 @@ class Animation {
 	/**
 	 * Returns the user-level animation loop.
 	 *
-	 * @return {Function} The animation loop.
+	 * @return {?Function} The animation loop.
 	 */
 	getAnimationLoop() {
 

+ 1 - 1
src/renderers/common/Attributes.js

@@ -33,7 +33,7 @@ class Attributes extends DataMap {
 	 * Deletes the data for the given attribute.
 	 *
 	 * @param {BufferAttribute} attribute - The attribute.
-	 * @return {Object} The deleted attribute data.
+	 * @return {Object|null} The deleted attribute data.
 	 */
 	delete( attribute ) {
 

+ 2 - 2
src/renderers/common/RenderList.js

@@ -356,8 +356,8 @@ class RenderList {
 	/**
 	 * Sorts the internal render lists.
 	 *
-	 * @param {function(any, any): number} customOpaqueSort - A custom sort function for opaque objects.
-	 * @param {function(any, any): number} customTransparentSort -  A custom sort function for transparent objects.
+	 * @param {?function(any, any): number} customOpaqueSort - A custom sort function for opaque objects.
+	 * @param {?function(any, any): number} customTransparentSort -  A custom sort function for transparent objects.
 	 */
 	sort( customOpaqueSort, customTransparentSort ) {
 

+ 1 - 1
src/renderers/common/RenderObject.js

@@ -494,7 +494,7 @@ class RenderObject {
 	/**
 	 * Returns the draw parameters for the render object.
 	 *
-	 * @return {{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters.
+	 * @return {?{vertexCount: number, firstVertex: number, instanceCount: number, firstInstance: number}} The draw parameters.
 	 */
 	getDrawParameters() {
 

+ 2 - 2
src/renderers/common/RenderObjects.js

@@ -84,7 +84,7 @@ class RenderObjects {
 	 * @param {LightsNode} lightsNode - The lights node.
 	 * @param {RenderContext} renderContext - The render context.
 	 * @param {ClippingContext} clippingContext - The clipping context.
-	 * @param {?string} passId - An optional ID for identifying the pass.
+	 * @param {string} [passId] - An optional ID for identifying the pass.
 	 * @return {RenderObject} The render object.
 	 */
 	get( object, material, scene, camera, lightsNode, renderContext, clippingContext, passId ) {
@@ -173,7 +173,7 @@ class RenderObjects {
 	 * @param {LightsNode} lightsNode - The lights node.
 	 * @param {RenderContext} renderContext - The render context.
 	 * @param {ClippingContext} clippingContext - The clipping context.
-	 * @param {?string} passId - An optional ID for identifying the pass.
+	 * @param {string} [passId] - An optional ID for identifying the pass.
 	 * @return {RenderObject} The render object.
 	 */
 	createRenderObject( nodes, geometries, renderer, object, material, scene, camera, lightsNode, renderContext, clippingContext, passId ) {

+ 6 - 6
src/renderers/common/Renderer.js

@@ -247,7 +247,7 @@ class Renderer {
 		 * This callback function can be used to provide a fallback backend, if the primary backend can't be targeted.
 		 *
 		 * @private
-		 * @type {Function}
+		 * @type {?Function}
 		 */
 		this._getFallback = getFallback;
 
@@ -675,7 +675,7 @@ class Renderer {
 		 * Debug configuration.
 		 * @typedef {Object} DebugConfig
 		 * @property {boolean} checkShaderErrors - Whether shader errors should be checked or not.
-		 * @property {Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
+		 * @property {?Function} onShaderError - A callback function that is executed when a shader error happens. Only supported with WebGL 2 right now.
 		 * @property {Function} getShaderAsync - Allows the get the raw shader code for the given scene, camera and 3D object.
 		 */
 
@@ -814,8 +814,8 @@ class Renderer {
 	 * @async
 	 * @param {Object3D} scene - The scene or 3D object to precompile.
 	 * @param {Camera} camera - The camera that is used to render the scene.
-	 * @param {Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
-	 * @return {Promise<Array>} A Promise that resolves when the compile has been finished.
+	 * @param {?Scene} targetScene - If the first argument is a 3D object, this parameter must represent the scene the 3D object is going to be added.
+	 * @return {Promise<Array|undefined>} A Promise that resolves when the compile has been finished.
 	 */
 	async compileAsync( scene, camera, targetScene = null ) {
 
@@ -2394,7 +2394,7 @@ class Renderer {
 	 * Copies the current bound framebuffer into the given texture.
 	 *
 	 * @param {FramebufferTexture} framebufferTexture - The texture.
-	 * @param {Vector2|Vector4} rectangle - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
+	 * @param {?Vector2|Vector4} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied.
 	 */
 	copyFramebufferToTexture( framebufferTexture, rectangle = null ) {
 
@@ -2722,7 +2722,7 @@ class Renderer {
 	 * @param {Material} material - The object's material.
 	 * @param {?Object} group - Only relevant for objects using multiple materials. This represents a group entry from the respective `BufferGeometry`.
 	 * @param {LightsNode} lightsNode - The current lights node.
-	 * @param {ClippingContext} clippingContext - The clipping context.
+	 * @param {?ClippingContext} clippingContext - The clipping context.
 	 * @param {?string} [passId=null] - An optional ID for identifying the pass.
 	 */
 	renderObject( object, scene, camera, geometry, material, group, lightsNode, clippingContext = null, passId = null ) {

+ 3 - 3
src/renderers/common/nodes/NodeBuilderState.js

@@ -14,9 +14,9 @@ class NodeBuilderState {
 	/**
 	 * Constructs a new node builder state.
 	 *
-	 * @param {?string} vertexShader - The native vertex shader code.
-	 * @param {?string} fragmentShader - The native fragment shader code.
-	 * @param {?string} computeShader - The native compute shader code.
+	 * @param {string} vertexShader - The native vertex shader code.
+	 * @param {string} fragmentShader - The native fragment shader code.
+	 * @param {string} computeShader - The native compute shader code.
 	 * @param {Array<NodeAttribute>} nodeAttributes - An array of node attributes.
 	 * @param {Array<BindGroup>} bindings - An array of bind groups.
 	 * @param {Array<Node>} updateNodes - An array of nodes that implement their `update()` method.

+ 1 - 1
src/renderers/webgl-fallback/utils/WebGLUtils.js

@@ -45,7 +45,7 @@ class WebGLUtils {
 	 *
 	 * @param {number} p - The three.js constant.
 	 * @param {string} [colorSpace=NoColorSpace] - The color space.
-	 * @return {number} The corresponding WebGL constant.
+	 * @return {?number} The corresponding WebGL constant.
 	 */
 	convert( p, colorSpace = NoColorSpace ) {
 

粤ICP备19079148号