Browse Source

fix bug: when material is undefined

The triangle may not have the material
washstar 7 years ago
parent
commit
a25321ceb6
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/objects/Mesh.js

+ 1 - 1
src/objects/Mesh.js

@@ -162,7 +162,7 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
 		function checkIntersection( object, material, raycaster, ray, pA, pB, pC, point ) {
 
 			var intersect;
-
+			if(!material) return null;
 			if ( material.side === BackSide ) {
 
 				intersect = ray.intersectTriangle( pC, pB, pA, true, point );