diff --git a/src/objects/Mesh.js b/src/objects/Mesh.js index ff43e486b09cc351d5c811b69b07da907e7bee18..1811af6942cb8823bb8dd7565295a2b7430fbe6d 100644 --- a/src/objects/Mesh.js +++ b/src/objects/Mesh.js @@ -268,28 +268,25 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), { } - } else { + } else if ( position !== undefined ) { // non-indexed buffer geometry - - if ( position ) { - for ( i = 0, l = position.count; i < l; i += 3 ) { + for ( i = 0, l = position.count; i < l; i += 3 ) { - a = i; - b = i + 1; - c = i + 2; + a = i; + b = i + 1; + c = i + 2; - intersection = checkBufferGeometryIntersection( this, raycaster, ray, position, uv, a, b, c ); - - if ( intersection ) { + intersection = checkBufferGeometryIntersection( this, raycaster, ray, position, uv, a, b, c ); - intersection.index = a; // triangle number in positions buffer semantics - intersects.push( intersection ); + if ( intersection ) { - } + intersection.index = a; // triangle number in positions buffer semantics + intersects.push( intersection ); } + } }