Explorar el Código

Mesh: Add drawMode warning in .raycast().

Mugen87 hace 6 años
padre
commit
c7f05e76f9
Se han modificado 1 ficheros con 9 adiciones y 0 borrados
  1. 9 0
      src/objects/Mesh.js

+ 9 - 0
src/objects/Mesh.js

@@ -165,6 +165,15 @@ Mesh.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 		}
 
+		// check unsupported draw modes
+
+		if ( this.drawMode !== TrianglesDrawMode ) {
+
+			console.warn( 'THREE.Mesh: TriangleStripDrawMode and TriangleFanDrawMode are not supported by .raycast().' );
+			return;
+
+		}
+
 		var intersection;
 
 		if ( geometry.isBufferGeometry ) {

粤ICP备19079148号