|
@@ -72,13 +72,13 @@ Object.assign( Raycaster.prototype, {
|
|
|
|
|
|
setFromCamera: function ( coords, camera ) {
|
|
setFromCamera: function ( coords, camera ) {
|
|
|
|
|
|
- if ( ( camera && camera.isPerspectiveCamera ) ) {
|
|
|
|
|
|
+ if ( camera && camera.isPerspectiveCamera ) {
|
|
|
|
|
|
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 );
|