Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs: Do not capitalize primitive types. #30461

Merged
merged 1 commit into from
Feb 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/jsm/animation/CCDIKSolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ class CCDIKHelper extends Object3D {
/**
* Updates IK bones visualization.
*
* @param {Boolean} force
* @param {boolean} force
*/
updateMatrixWorld( force ) {

Expand Down
68 changes: 34 additions & 34 deletions examples/jsm/controls/ArcballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -1045,8 +1045,8 @@ class ArcballControls extends Controls {

/**
* Set _center's x/y coordinates
* @param {Number} clientX
* @param {Number} clientY
* @param {number} clientX
* @param {number} clientY
*/
setCenter( clientX, clientY ) {

Expand Down Expand Up @@ -1078,7 +1078,7 @@ class ArcballControls extends Controls {
* Compare two mouse actions
* @param {Object} action1
* @param {Object} action2
* @returns {Boolean} True if action1 and action 2 are the same mouse action, false otherwise
* @returns {boolean} True if action1 and action 2 are the same mouse action, false otherwise
*/
compareMouseAction( action1, action2 ) {

Expand Down Expand Up @@ -1107,7 +1107,7 @@ class ArcballControls extends Controls {
* @param {'PAN'|'ROTATE'|'ZOOM'|'FOV'} operation The operation to be performed ('PAN', 'ROTATE', 'ZOOM', 'FOV')
* @param {0|1|2|'WHEEL'} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
* @param {'CTRL'|'SHIFT'|null} [key=null] The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed
* @returns {Boolean} True if the mouse action has been successfully added, false otherwise
* @returns {boolean} True if the mouse action has been successfully added, false otherwise
*/
setMouseAction( operation, mouse, key = null ) {

Expand Down Expand Up @@ -1187,7 +1187,7 @@ class ArcballControls extends Controls {
* Remove a mouse action by specifying its mouse/key combination
* @param {0|1|2|'WHEEL'} mouse A mouse button (0, 1, 2) or 'WHEEL' for wheel notches
* @param {'CTRL'|'SHIFT'|null} key The keyboard modifier ('CTRL', 'SHIFT') or null if key is not needed
* @returns {Boolean} True if the operation has been successfully removed, false otherwise
* @returns {boolean} True if the operation has been successfully removed, false otherwise
*/
unsetMouseAction( mouse, key = null ) {

Expand Down Expand Up @@ -1290,7 +1290,7 @@ class ArcballControls extends Controls {
* Calculate the angle between two pointers
* @param {PointerEvent} p1
* @param {PointerEvent} p2
* @returns {Number} The angle between two pointers in degrees
* @returns {number} The angle between two pointers in degrees
*/
getAngle( p1, p2 ) {

Expand Down Expand Up @@ -1407,11 +1407,11 @@ class ArcballControls extends Controls {
/**
* Calculate the angular speed
*
* @param {Number} p0 Position at t0
* @param {Number} p1 Position at t1
* @param {Number} t0 Initial time in milliseconds
* @param {Number} t1 Ending time in milliseconds
* @returns {Number}
* @param {number} p0 Position at t0
* @param {number} p1 Position at t1
* @param {number} t0 Initial time in milliseconds
* @param {number} t1 Ending time in milliseconds
* @returns {number}
*/
calculateAngularSpeed( p0, p1, t0, t1 ) {

Expand Down Expand Up @@ -1458,7 +1458,7 @@ class ArcballControls extends Controls {
/**
* Calculate the trackball radius so that gizmo's diameter will be 2/3 of the minimum side of the camera frustum
* @param {Camera} camera
* @returns {Number} The trackball radius
* @returns {number} The trackball radius
*/
calculateTbRadius( camera ) {

Expand All @@ -1481,8 +1481,8 @@ class ArcballControls extends Controls {
/**
* Focus operation consist of positioning the point of interest in front of the camera and a slightly zoom in
* @param {Vector3} point The point of interest
* @param {Number} size Scale factor
* @param {Number} [amount=1] Amount of operation to be completed (used for focus animations, default is complete full operation)
* @param {number} size Scale factor
* @param {number} [amount=1] Amount of operation to be completed (used for focus animations, default is complete full operation)
*/
focus( point, size, amount = 1 ) {

Expand Down Expand Up @@ -1596,8 +1596,8 @@ class ArcballControls extends Controls {

/**
* Compute the easing out cubic function for ease out effect in animation
* @param {Number} t The absolute progress of the animation in the bound of 0 (beginning of the) and 1 (ending of animation)
* @returns {Number} Result of easing out cubic at time t
* @param {number} t The absolute progress of the animation in the bound of 0 (beginning of the) and 1 (ending of animation)
* @returns {number} Result of easing out cubic at time t
*/
easeOutCubic( t ) {

Expand All @@ -1607,7 +1607,7 @@ class ArcballControls extends Controls {

/**
* Make rotation gizmos more or less visible
* @param {Boolean} isActive If true, make gizmos more visible
* @param {boolean} isActive If true, make gizmos more visible
*/
activateGizmos( isActive ) {

Expand Down Expand Up @@ -1651,8 +1651,8 @@ class ArcballControls extends Controls {
/**
* Calculate the cursor position inside the canvas x/y coordinates with the origin being in the center of the canvas
*
* @param {Number} cursorX Cursor horizontal coordinate within the canvas
* @param {Number} cursorY Cursor vertical coordinate within the canvas
* @param {number} cursorX Cursor horizontal coordinate within the canvas
* @param {number} cursorY Cursor vertical coordinate within the canvas
* @param {HTMLElement} canvas The canvas where the renderer draws its output
* @returns {Vector2} Cursor position inside the canvas
*/
Expand Down Expand Up @@ -1710,7 +1710,7 @@ class ArcballControls extends Controls {

/**
* Set gizmos visibility
* @param {Boolean} value Value of gizmos visibility
* @param {boolean} value Value of gizmos visibility
*/
setGizmosVisible( value ) {

Expand All @@ -1721,7 +1721,7 @@ class ArcballControls extends Controls {

/**
* Set gizmos radius factor and redraws gizmos
* @param {Number} value Value of radius factor
* @param {number} value Value of radius factor
*/
setTbRadius( value ) {

Expand Down Expand Up @@ -1815,7 +1815,7 @@ class ArcballControls extends Controls {

/**
* Perform animation for focus operation
* @param {Number} time Instant in which this function is called as performance.now()
* @param {number} time Instant in which this function is called as performance.now()
* @param {Vector3} point Point of interest for focus operation
* @param {Matrix4} cameraMatrix Camera matrix
* @param {Matrix4} gizmoMatrix Gizmos matrix
Expand Down Expand Up @@ -1881,7 +1881,7 @@ class ArcballControls extends Controls {

/**
* Perform animation for rotation operation
* @param {Number} time Instant in which this function is called as performance.now()
* @param {number} time Instant in which this function is called as performance.now()
* @param {Vector3} rotationAxis Rotation axis
* @param {number} w0 Initial angular velocity
*/
Expand Down Expand Up @@ -1951,7 +1951,7 @@ class ArcballControls extends Controls {
*
* @param {Vector3} p0 Initial point
* @param {Vector3} p1 Ending point
* @param {Boolean} [adjust=false] If movement should be adjusted considering camera distance (Perspective only)
* @param {boolean} [adjust=false] If movement should be adjusted considering camera distance (Perspective only)
* @returns {Object}
*/
pan( p0, p1, adjust = false ) {
Expand Down Expand Up @@ -2113,9 +2113,9 @@ class ArcballControls extends Controls {

/**
* Perform uniform scale operation around a given point
* @param {Number} size Scale factor
* @param {number} size Scale factor
* @param {Vector3} point Point around which scale
* @param {Boolean} scaleGizmos If gizmos should be scaled (Perspective only)
* @param {boolean} scaleGizmos If gizmos should be scaled (Perspective only)
* @returns {Object} Object with 'camera' and 'gizmo' fields containing transformation matrices resulting from the operation to be applied to the camera and gizmos
*/
scale( size, point, scaleGizmos = true ) {
Expand Down Expand Up @@ -2229,7 +2229,7 @@ class ArcballControls extends Controls {

/**
* Set camera fov
* @param {Number} value fov to be set
* @param {number} value fov to be set
*/
setFov( value ) {

Expand Down Expand Up @@ -2292,7 +2292,7 @@ class ArcballControls extends Controls {
* Rotate camera around its direction axis passing by a given point by a given angle
*
* @param {Vector3} point The point where the rotation axis is passing trough
* @param {Number} angle Angle in radians
* @param {number} angle Angle in radians
* @returns {Object} The computed transformation matrix
*/
zRotate( point, angle ) {
Expand Down Expand Up @@ -2356,8 +2356,8 @@ class ArcballControls extends Controls {
/**
* Unproject the cursor on the trackball surface
* @param {Camera} camera The virtual camera
* @param {Number} cursorX Cursor horizontal coordinate on screen
* @param {Number} cursorY Cursor vertical coordinate on screen
* @param {number} cursorX Cursor horizontal coordinate on screen
* @param {number} cursorY Cursor vertical coordinate on screen
* @param {HTMLElement} canvas The canvas where the renderer draws its output
* @param {number} tbRadius The trackball radius
* @returns {Vector3} The unprojected point on the trackball surface
Expand Down Expand Up @@ -2486,10 +2486,10 @@ class ArcballControls extends Controls {
/**
* Unproject the cursor on the plane passing through the center of the trackball orthogonal to the camera
* @param {Camera} camera The virtual camera
* @param {Number} cursorX Cursor horizontal coordinate on screen
* @param {Number} cursorY Cursor vertical coordinate on screen
* @param {number} cursorX Cursor horizontal coordinate on screen
* @param {number} cursorY Cursor vertical coordinate on screen
* @param {HTMLElement} canvas The canvas where the renderer draws its output
* @param {Boolean} [initialDistance=false] If initial distance between camera and gizmos should be used for calculations instead of current (Perspective only)
* @param {boolean} [initialDistance=false] If initial distance between camera and gizmos should be used for calculations instead of current (Perspective only)
* @returns {Vector3} The unprojected point on the trackball plane
*/
unprojectOnTbPlane( camera, cursorX, cursorY, canvas, initialDistance = false ) {
Expand Down Expand Up @@ -2589,7 +2589,7 @@ class ArcballControls extends Controls {
/**
* Update the trackball FSA
* @param {STATE} newState New state of the FSA
* @param {Boolean} updateMatrices If matrices state should be updated
* @param {boolean} updateMatrices If matrices state should be updated
*/
updateTbState( newState, updateMatrices ) {

Expand Down
42 changes: 21 additions & 21 deletions examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ const GLB_CHUNK_TYPE_BIN = 0x004E4942;
* Compare two arrays
* @param {Array} array1 Array 1 to compare
* @param {Array} array2 Array 2 to compare
* @return {Boolean} Returns true if both arrays are equal
* @return {boolean} Returns true if both arrays are equal
*/
function equalArray( array1, array2 ) {

Expand All @@ -333,7 +333,7 @@ function stringToArrayBuffer( text ) {
* Is identity matrix
*
* @param {Matrix4} matrix
* @returns {Boolean} Returns true, if parameter is identity matrix
* @returns {boolean} Returns true, if parameter is identity matrix
*/
function isIdentityMatrix( matrix ) {

Expand All @@ -345,8 +345,8 @@ function isIdentityMatrix( matrix ) {
* Get the min and max vectors from the given attribute
*
* @param {BufferAttribute} attribute Attribute to find the min/max in range from start to start + count
* @param {Number} start Start index
* @param {Number} count Range to cover
* @param {number} start Start index
* @param {number} count Range to cover
* @return {Object} Object containing the `min` and `max` values (As an array of attribute.itemSize components)
*/
function getMinMax( attribute, start, count ) {
Expand Down Expand Up @@ -400,8 +400,8 @@ function getMinMax( attribute, start, count ) {
* Get the required size + padding for a buffer, rounded to the next 4-byte boundary.
* https://github.com/KhronosGroup/glTF/tree/master/specification/2.0#data-alignment
*
* @param {Number} bufferSize The size the original buffer. Should be an integer.
* @returns {Number} new buffer size with required padding as an integer.
* @param {number} bufferSize The size the original buffer. Should be an integer.
* @returns {number} new buffer size with required padding as an integer.
*
*/
function getPaddedBufferSize( bufferSize ) {
Expand All @@ -414,7 +414,7 @@ function getPaddedBufferSize( bufferSize ) {
* Returns a buffer aligned to 4-byte boundary.
*
* @param {ArrayBuffer} arrayBuffer Buffer to pad
* @param {Number} [paddingByte=0] Should be an integer
* @param {number} [paddingByte=0] Should be an integer
* @returns {ArrayBuffer} The same buffer if it's already aligned to 4-byte boundary or a new buffer
*/
function getPaddedArrayBuffer( arrayBuffer, paddingByte = 0 ) {
Expand Down Expand Up @@ -715,7 +715,7 @@ class GLTFWriter {
*
* @param {Object} attribute
* @param {boolean} [isRelativeCopy=false]
* @return {Number} An integer
* @return {number} An integer
*/
getUID( attribute, isRelativeCopy = false ) {

Expand All @@ -740,7 +740,7 @@ class GLTFWriter {
* Checks if normal attribute values are normalized.
*
* @param {BufferAttribute} normal
* @returns {Boolean}
* @returns {boolean}
*/
isNormalizedNormalAttribute( normal ) {

Expand Down Expand Up @@ -1145,7 +1145,7 @@ class GLTFWriter {
/**
* Process and generate a BufferView from an image Blob.
* @param {Blob} blob
* @return {Promise<Number>} An integer
* @return {Promise<number>} An integer
*/
processBufferViewImage( blob ) {

Expand Down Expand Up @@ -1181,9 +1181,9 @@ class GLTFWriter {
* Process attribute to generate an accessor
* @param {BufferAttribute} attribute Attribute to process
* @param {THREE.BufferGeometry?} geometry Geometry used for truncated draw range
* @param {Number} [start=0]
* @param {Number} [count=Infinity]
* @return {Number?} Index of the processed accessor on the "accessors" array
* @param {number} [start=0]
* @param {number} [count=Infinity]
* @return {number?} Index of the processed accessor on the "accessors" array
*/
processAccessor( attribute, geometry, start, count ) {

Expand Down Expand Up @@ -1278,10 +1278,10 @@ class GLTFWriter {
/**
* Process image
* @param {Image} image to process
* @param {Number} format Identifier of the format (RGBAFormat)
* @param {Boolean} flipY before writing out the image
* @param {String} mimeType export format
* @return {Number} Index of the processed texture in the "images" array
* @param {number} format Identifier of the format (RGBAFormat)
* @param {boolean} flipY before writing out the image
* @param {string} mimeType export format
* @return {number} Index of the processed texture in the "images" array
*/
processImage( image, format, flipY, mimeType = 'image/png' ) {

Expand Down Expand Up @@ -1418,7 +1418,7 @@ class GLTFWriter {
/**
* Process sampler
* @param {Texture} map Texture to process
* @return {Number} Index of the processed texture in the "samplers" array
* @return {number} Index of the processed texture in the "samplers" array
*/
processSampler( map ) {

Expand All @@ -1440,7 +1440,7 @@ class GLTFWriter {
/**
* Process texture
* @param {Texture} map Map to process
* @return {Promise<Number>} Index of the processed texture in the "textures" array
* @return {Promise<number>} Index of the processed texture in the "textures" array
*/
async processTextureAsync( map ) {

Expand Down Expand Up @@ -2067,7 +2067,7 @@ class GLTFWriter {
/**
* Process camera
* @param {THREE.Camera} camera Camera to process
* @return {Number} Index of the processed mesh in the "camera" array
* @return {number} Index of the processed mesh in the "camera" array
*/
processCamera( camera ) {

Expand Down Expand Up @@ -2268,7 +2268,7 @@ class GLTFWriter {
/**
* Process Object3D node
* @param {THREE.Object3D} object Object3D to processNodeAsync
* @return {Promise<Number>} Index of the node in the nodes list
* @return {Promise<number>} Index of the node in the nodes list
*/
async processNodeAsync( object ) {

Expand Down
6 changes: 3 additions & 3 deletions examples/jsm/loaders/GLTFLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -2776,7 +2776,7 @@ class GLTFParser {
* Returns a reference to a shared resource, cloning it if necessary.
*
* @param {Object} cache
* @param {Number} index
* @param {number} index
* @param {Object} object
* @return {Object}
*/
Expand Down Expand Up @@ -3667,8 +3667,8 @@ class GLTFParser {
/**
* When Object3D instances are targeted by animation, they need unique names.
*
* @param {String} originalName
* @return {String}
* @param {string} originalName
* @return {string}
*/
createUniqueName( originalName ) {

Expand Down
Loading