Skip to content

Commit 2c7393a

Browse files
authored
fromBufferGeometry: improve readability on trinary operator for vectors
1 parent 5a1a80e commit 2c7393a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/core/Geometry.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -242,13 +242,16 @@ Geometry.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
242242

243243
function addFace( a, b, c, materialIndex ) {
244244

245-
var vertexColors = colors !== undefined ? [ scope.colors[ a ].clone(), scope.colors[ b ].clone(), scope.colors[ c ].clone() ] : [];
245+
var vertexColors = ( colors === undefined ) ? [] : [
246+
scope.colors[ a ].clone(),
247+
scope.colors[ b ].clone(),
248+
scope.colors[ c ].clone() ];
246249

247-
var vertexNormals = normals !== undefined ? [
250+
var vertexNormals = ( normals === undefined ) ? [] : [
248251
new Vector3().fromArray( normals, a * 3 ),
249252
new Vector3().fromArray( normals, b * 3 ),
250253
new Vector3().fromArray( normals, c * 3 )
251-
] : [];
254+
];
252255

253256
var face = new Face3( a, b, c, vertexNormals, vertexColors, materialIndex );
254257

0 commit comments

Comments
 (0)