Explorar el Código

fromBufferGeometry: improve readability on trinary operator for vectors

Eran Geva hace 7 años
padre
commit
2c7393a738
Se han modificado 1 ficheros con 6 adiciones y 3 borrados
  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 );