Explorar o código

Add error if camera is null

Garrett Johnson %!s(int64=6) %!d(string=hai) anos
pai
achega
29405750b9
Modificáronse 1 ficheiros con 6 adicións e 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();