فهرست منبع

Mesh: Clean up.

Mr.doob 8 سال پیش
والد
کامیت
7c2ebf71a6
1فایلهای تغییر یافته به همراه10 افزوده شده و 13 حذف شده
  1. 10 13
      src/objects/Mesh.js

+ 10 - 13
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 );
 
 						}
+
 					}
 
 				}