Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/helpers/CameraHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,10 @@ CameraHelper.prototype.update = function () {

var w = 1, h = 1;

// we need just camera projection matrix
// we need just camera projection matrix inverse
// world matrix must be identity

camera.projectionMatrix.copy( this.camera.projectionMatrix );
camera.projectionMatrixInverse.copy( this.camera.projectionMatrixInverse );

// center / target

Expand Down
13 changes: 3 additions & 10 deletions src/math/Vector3.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { _Math } from './Math.js';
import { Matrix4 } from './Matrix4.js';
import { Quaternion } from './Quaternion.js';

/**
Expand Down Expand Up @@ -318,17 +317,11 @@ Object.assign( Vector3.prototype, {

},

unproject: function () {
unproject: function ( camera ) {

var matrix = new Matrix4();
return this.applyMatrix4( camera.projectionMatrixInverse ).applyMatrix4( camera.matrixWorld );

return function unproject( camera ) {

return this.applyMatrix4( matrix.getInverse( camera.projectionMatrix ) ).applyMatrix4( camera.matrixWorld );

};

}(),
},

transformDirection: function ( m ) {

Expand Down