File tree Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Expand file tree Collapse file tree 2 files changed +5
-12
lines changed Original file line number Diff line number Diff line change @@ -158,10 +158,10 @@ CameraHelper.prototype.update = function () {
158158
159159 var w = 1 , h = 1 ;
160160
161- // we need just camera projection matrix
161+ // we need just camera projection matrix inverse
162162 // world matrix must be identity
163163
164- camera . projectionMatrix . copy ( this . camera . projectionMatrix ) ;
164+ camera . projectionMatrixInverse . copy ( this . camera . projectionMatrixInverse ) ;
165165
166166 // center / target
167167
Original file line number Diff line number Diff line change 11import { _Math } from './Math.js' ;
2- import { Matrix4 } from './Matrix4.js' ;
32import { Quaternion } from './Quaternion.js' ;
43
54/**
@@ -318,17 +317,11 @@ Object.assign( Vector3.prototype, {
318317
319318 } ,
320319
321- unproject : function ( ) {
320+ unproject : function ( camera ) {
322321
323- var matrix = new Matrix4 ( ) ;
322+ return this . applyMatrix4 ( camera . projectionMatrixInverse ) . applyMatrix4 ( camera . matrixWorld ) ;
324323
325- return function unproject ( camera ) {
326-
327- return this . applyMatrix4 ( matrix . getInverse ( camera . projectionMatrix ) ) . applyMatrix4 ( camera . matrixWorld ) ;
328-
329- } ;
330-
331- } ( ) ,
324+ } ,
332325
333326 transformDirection : function ( m ) {
334327
You can’t perform that action at this time.
0 commit comments