Browse Source

Add error if camera is null

Garrett Johnson 6 years ago
parent
commit
29405750b9
1 changed files with 6 additions and 0 deletions
  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 ) {
 
+		if ( raycaster.camera === null ) {
+
+			console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
+
+		}
+
 		if ( _uvC === undefined ) {
 
 			_intersectPoint = new Vector3();