@@ -112,9 +112,7 @@ export function MeshFaceMaterial( materials ) {
}
-export function MultiMaterial( materials ) {
-
- if ( materials === undefined ) materials = [];
+export function MultiMaterial( materials = [] ) {
console.warn( 'THREE.MultiMaterial has been removed. Use an Array instead.' );
materials.isMultiMaterial = true;
@@ -230,11 +230,9 @@ const AnimationUtils = {
},
- makeClipAdditive: function ( targetClip, referenceFrame, referenceClip, fps ) {
+ makeClipAdditive: function ( targetClip, referenceFrame = 0, referenceClip = targetClip, fps = 30 ) {
- if ( referenceFrame === undefined ) referenceFrame = 0;
- if ( referenceClip === undefined ) referenceClip = targetClip;
- if ( fps === undefined || fps <= 0 ) fps = 30;
+ if ( fps <= 0 ) fps = 30;
const numTracks = referenceClip.tracks.length;
const referenceTime = referenceFrame / fps;
@@ -87,9 +87,7 @@ class Audio extends Object3D {
- play( delay ) {
- if ( delay === undefined ) delay = 0;
+ play( delay = 0 ) {
if ( this.isPlaying === true ) {
@@ -278,9 +278,7 @@ Object.assign( BufferAttribute.prototype, {
- set: function ( value, offset ) {
- if ( offset === undefined ) offset = 0;
+ set: function ( value, offset = 0 ) {
this.array.set( value, offset );
@@ -373,9 +373,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
- computeVertexNormals: function ( areaWeighted ) {
- if ( areaWeighted === undefined ) areaWeighted = true;
+ computeVertexNormals: function ( areaWeighted = true ) {
const vertices = new Array( this.vertices.length );
@@ -631,7 +629,7 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
- merge: function ( geometry, matrix, materialIndexOffset ) {
+ merge: function ( geometry, matrix, materialIndexOffset = 0 ) {
if ( ! ( geometry && geometry.isGeometry ) ) {
@@ -649,8 +647,6 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
colors1 = this.colors,
colors2 = geometry.colors;
- if ( materialIndexOffset === undefined ) materialIndexOffset = 0;
if ( matrix !== undefined ) {
normalMatrix = new Matrix3().getNormalMatrix( matrix );
@@ -66,9 +66,7 @@ Object.assign( InterleavedBuffer.prototype, {
@@ -825,9 +825,7 @@ Object3D.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
- copy: function ( source, recursive ) {
- if ( recursive === undefined ) recursive = true;
+ copy: function ( source, recursive = true ) {
this.name = source.name;
@@ -65,9 +65,7 @@ Object.assign( Curve.prototype, {
// Get sequence of points using getPoint( t )
- getPoints: function ( divisions ) {
- if ( divisions === undefined ) divisions = 5;
+ getPoints: function ( divisions = 5 ) {
const points = [];
@@ -83,9 +81,7 @@ Object.assign( Curve.prototype, {
// Get sequence of points using getPointAt( u )
- getSpacedPoints: function ( divisions ) {
+ getSpacedPoints: function ( divisions = 5 ) {
@@ -134,9 +134,7 @@ CurvePath.prototype = Object.assign( Object.create( Curve.prototype ), {
- if ( divisions === undefined ) divisions = 40;
+ getSpacedPoints: function ( divisions = 40 ) {
@@ -12,9 +12,7 @@ Object.assign( Font.prototype, {
isFont: true,
- generateShapes: function ( text, size ) {
- if ( size === undefined ) size = 100;
+ generateShapes: function ( text, size = 100 ) {
const shapes = [];
const paths = createPaths( text, size, this.data );
@@ -8,9 +8,9 @@ import { FrontSide, BackSide } from '../constants.js';
class PlaneHelper extends Line {
- constructor( plane, size, hex ) {
+ constructor( plane, size = 1, hex = 0xffff00 ) {
- const color = ( hex !== undefined ) ? hex : 0xffff00;
+ const color = hex;
const positions = [ 1, - 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, - 1, 1, 1, 1, 1, 0, 0, 1, 0, 0, 0 ];
@@ -24,7 +24,7 @@ class PlaneHelper extends Line {
this.plane = plane;
- this.size = ( size === undefined ) ? 1 : size;
+ this.size = size;
const positions2 = [ 1, 1, 1, - 1, 1, 1, - 1, - 1, 1, 1, 1, 1, - 1, - 1, 1, 1, - 1, 1 ];
@@ -58,9 +58,7 @@ PointLightShadow.prototype = Object.assign( Object.create( LightShadow.prototype
isPointLightShadow: true,
- updateMatrices: function ( light, viewportIndex ) {
- if ( viewportIndex === undefined ) viewportIndex = 0;
+ updateMatrices: function ( light, viewportIndex = 0 ) {
const camera = this.camera,
shadowMatrix = this.matrix,
@@ -300,9 +300,7 @@ class Color {
- copyGammaToLinear( color, gammaFactor ) {
- if ( gammaFactor === undefined ) gammaFactor = 2.0;
+ copyGammaToLinear( color, gammaFactor = 2.0 ) {
this.r = Math.pow( color.r, gammaFactor );
this.g = Math.pow( color.g, gammaFactor );
@@ -312,9 +310,7 @@ class Color {
- copyLinearToGamma( color, gammaFactor ) {
+ copyLinearToGamma( color, gammaFactor = 2.0 ) {
const safeInverse = ( gammaFactor > 0 ) ? ( 1.0 / gammaFactor ) : 1.0;
@@ -49,9 +49,7 @@ LOD.prototype = Object.assign( Object.create( Object3D.prototype ), {
- addLevel: function ( object, distance ) {
- if ( distance === undefined ) distance = 0;
+ addLevel: function ( object, distance = 0 ) {
distance = Math.abs( distance );
@@ -1914,9 +1914,7 @@ function WebGLRenderer( parameters ) {
};
- this.copyFramebufferToTexture = function ( position, texture, level ) {
- if ( level === undefined ) level = 0;
+ this.copyFramebufferToTexture = function ( position, texture, level = 0 ) {
const levelScale = Math.pow( 2, - level );
const width = Math.floor( texture.image.width * levelScale );
@@ -1931,9 +1929,7 @@ function WebGLRenderer( parameters ) {
- this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level ) {
+ this.copyTextureToTexture = function ( position, srcTexture, dstTexture, level = 0 ) {
const width = srcTexture.image.width;
const height = srcTexture.image.height;