|
@@ -13,6 +13,7 @@ function Raycaster( origin, direction, near, far ) {
|
|
|
|
|
|
this.near = near || 0;
|
|
this.near = near || 0;
|
|
this.far = far || Infinity;
|
|
this.far = far || Infinity;
|
|
|
|
+ this.camera = null;
|
|
|
|
|
|
this.params = {
|
|
this.params = {
|
|
Mesh: {},
|
|
Mesh: {},
|
|
@@ -79,13 +80,13 @@ Object.assign( Raycaster.prototype, {
|
|
|
|
|
|
this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
|
|
this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
|
|
this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
|
|
this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
|
|
- this._camera = camera;
|
|
|
|
|
|
+ this.camera = camera;
|
|
|
|
|
|
} else if ( ( camera && camera.isOrthographicCamera ) ) {
|
|
} else if ( ( camera && camera.isOrthographicCamera ) ) {
|
|
|
|
|
|
this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera
|
|
this.ray.origin.set( coords.x, coords.y, ( camera.near + camera.far ) / ( camera.near - camera.far ) ).unproject( camera ); // set origin in plane of camera
|
|
this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
|
|
this.ray.direction.set( 0, 0, - 1 ).transformDirection( camera.matrixWorld );
|
|
- this._camera = camera;
|
|
|
|
|
|
+ this.camera = camera;
|
|
|
|
|
|
} else {
|
|
} else {
|
|
|
|
|