|
@@ -100,14 +100,20 @@ Sprite.prototype = Object.assign( Object.create( Object3D.prototype ), {
|
|
|
|
|
|
return function raycast( raycaster, intersects ) {
|
|
|
|
|
|
+ if ( raycaster.camera === null ) {
|
|
|
+
|
|
|
+ console.error( 'THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.' );
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
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 );
|
|
|
|
|
|
- if ( raycaster._camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {
|
|
|
+ if ( raycaster.camera.isPerspectiveCamera && this.material.sizeAttenuation === false ) {
|
|
|
|
|
|
worldScale.multiplyScalar( - mvPosition.z );
|
|
|
|