|
@@ -67,12 +67,10 @@
|
|
|
|
|
|
setFromCamera: function ( coords, camera ) {
|
|
setFromCamera: function ( coords, camera ) {
|
|
|
|
|
|
- // camera is assumed _not_ to be a child of a transformed object
|
|
|
|
-
|
|
|
|
if ( camera instanceof THREE.PerspectiveCamera ) {
|
|
if ( camera instanceof THREE.PerspectiveCamera ) {
|
|
|
|
|
|
- this.ray.origin.copy( camera.position );
|
|
|
|
- this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( camera.position ).normalize();
|
|
|
|
|
|
+ this.ray.origin.setFromMatrixPosition( camera.matrixWorld );
|
|
|
|
+ this.ray.direction.set( coords.x, coords.y, 0.5 ).unproject( camera ).sub( this.ray.origin ).normalize();
|
|
|
|
|
|
} else if ( camera instanceof THREE.OrthographicCamera ) {
|
|
} else if ( camera instanceof THREE.OrthographicCamera ) {
|
|
|
|
|