소스 검색

Add error if camera is null

Garrett Johnson 6 년 전
부모
커밋
29405750b9
1개의 변경된 파일6개의 추가작업 그리고 0개의 파일을 삭제
  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();