Browse Source

Merge pull request #1 from washstar/washstar-patch-1

fix intersectsBox
washstar 7 years ago
parent
commit
0b0e1fe6f2
1 changed files with 3 additions and 5 deletions
  1. 3 5
      src/objects/Mesh.js

+ 3 - 5
src/objects/Mesh.js

@@ -245,11 +245,9 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 			// Check boundingBox before continuing
 
-			if ( geometry.boundingBox !== null ) {
-
-				if ( ray.intersectsBox( geometry.boundingBox ) === false ) return;
-
-			}
+			if ( geometry.boundingBox === null ) geometry.computeBoundingBox();
+			
+			if ( ray.intersectsBox( geometry.boundingBox ) === false ) return;
 
 			var intersection;