2
0
Эх сурвалжийг харах

fromBufferGeometry: improve readability on trinary operator for vectors

Eran Geva 7 жил өмнө
parent
commit
2c7393a738
1 өөрчлөгдсөн 6 нэмэгдсэн , 3 устгасан
  1. 6 3
      src/core/Geometry.js

+ 6 - 3
src/core/Geometry.js

@@ -242,13 +242,16 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
 
 		function addFace( a, b, c, materialIndex ) {
 
-			var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];
+			var vertexColors = ( colors === undefined ) ? [] : [
+				scope.colors[ a ].clone(),
+				scope.colors[ b ].clone(),
+				scope.colors[ c ].clone() ];
 
-			var vertexNormals = normals !== undefined ? [
+			var vertexNormals = ( normals === undefined ) ? [] : [
 				new Vector3().fromArray( normals, a * 3 ),
 				new Vector3().fromArray( normals, b * 3 ),
 				new Vector3().fromArray( normals, c * 3 )
-			] : [];
+			];
 
 			var face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex );