Sfoglia il codice sorgente

Merge pull request #20742 from linbingquan/dev-es6-default-value

Face4: Updated es6 default values.
Mr.doob 4 anni fa
parent
commit
71fe47ad3a
1 ha cambiato i file con 2 aggiunte e 2 eliminazioni
  1. 2 2
      src/core/Face3.js

+ 2 - 2
src/core/Face3.js

@@ -3,7 +3,7 @@ import { Vector3 } from '../math/Vector3.js';
 
 
 class Face3 {
 class Face3 {
 
 
-	constructor( a, b, c, normal, color, materialIndex ) {
+	constructor( a, b, c, normal, color, materialIndex = 0 ) {
 
 
 		this.a = a;
 		this.a = a;
 		this.b = b;
 		this.b = b;
@@ -15,7 +15,7 @@ class Face3 {
 		this.color = ( color && color.isColor ) ? color : new Color();
 		this.color = ( color && color.isColor ) ? color : new Color();
 		this.vertexColors = Array.isArray( color ) ? color : [];
 		this.vertexColors = Array.isArray( color ) ? color : [];
 
 
-		this.materialIndex = materialIndex !== undefined ? materialIndex : 0;
+		this.materialIndex = materialIndex;
 
 
 	}
 	}