|
@@ -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();
|
|
@@ -82,12 +88,12 @@ Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
_worldScale.setFromMatrixScale( this.matrixWorld );
|
|
_worldScale.setFromMatrixScale( this.matrixWorld );
|
|
|
|
|
|
- _viewWorldMatrix.copy( raycaster._camera.matrixWorld );
|
|
|
|
- this.modelViewMatrix.multiplyMatrices( raycaster._camera.matrixWorldInverse, this.matrixWorld );
|
|
|
|
|
|
+ _viewWorldMatrix.copy( raycaster.camera.matrixWorld );
|
|
|
|
+ this.modelViewMatrix.multiplyMatrices( raycaster.camera.matrixWorldInverse, this.matrixWorld );
|
|
|
|
|
|
_mvPosition.setFromMatrixPosition( this.modelViewMatrix );
|
|
_mvPosition.setFromMatrixPosition( this.modelViewMatrix );
|
|
|
|
|
|
- if ( raycaster._camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {
|
|
|
|
|
|
+ if ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {
|
|
|
|
|
|
_worldScale.multiplyScalar( - _mvPosition.z );
|
|
_worldScale.multiplyScalar( - _mvPosition.z );
|
|
|
|
|