Skip to content
Open
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
8 changes: 5 additions & 3 deletions threex.domevent.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,8 @@ THREEx.DomEvent.prototype._onMove = function(mouseX, mouseY, origDomEvent)
var vector = new THREE.Vector3( mouseX, mouseY, 1 );
this._projector.unprojectVector( vector, this._camera );

var ray = new THREE.Ray( this._camera.position, vector.subSelf( this._camera.position ).normalize() );
var pos = this._camera.matrixWorld.getPosition().clone();
var ray = new THREE.Ray( pos, vector.subSelf( pos ).normalize() );
var intersects = ray.intersectObjects( this._boundObjs );

var oldSelected = this._selected;
Expand Down Expand Up @@ -250,8 +251,9 @@ THREEx.DomEvent.prototype._onEvent = function(eventName, mouseX, mouseY, origDom
var vector = new THREE.Vector3( mouseX, mouseY, 1 );
this._projector.unprojectVector( vector, this._camera );

vector.subSelf( this._camera.position ).normalize()
var ray = new THREE.Ray( this._camera.position, vector );
var pos = this._camera.matrixWorld.getPosition().clone();
vector.subSelf( pos ).normalize()
var ray = new THREE.Ray( pos, vector );
var intersects = ray.intersectObjects( this._boundObjs );

// if there are no intersections, return now
Expand Down