Explorar el Código

Add error if camera is null

Garrett Johnson hace 7 años
padre
commit
29405750b9
Se han modificado 1 ficheros con 6 adiciones y 0 borrados
  1. 6 0
      src/objects/Sprite.js

+ 6 - 0
src/objects/Sprite.js

@@ -60,6 +60,12 @@ Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), {
 
 
 	raycast: function ( raycaster, intersects ) {
 	raycast: function ( raycaster, intersects ) {
 
 
+		if ( raycaster.camera === null ) {
+
+			console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
+
+		}
+
 		if ( _uvC === undefined ) {
 		if ( _uvC === undefined ) {
 
 
 			_intersectPoint = new Vector3();
 			_intersectPoint = new Vector3();

粤ICP备19079148号