Skip to content

Commit

Permalink
Account for parent scale and rotation in Drag behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
brianpeiris committed Nov 15, 2016
1 parent b673b83 commit 63d3778
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utilities/behaviors/Drag.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,8 @@ altspace.utilities.behaviors.Drag = function (config) {
dragOffset.copy(dragPoint).sub(objectCenterPoint);

//Move to drag point (not object center), where raycast hits the object.
intersector.position.copy(dragPoint);
intersector.position.copy(intersector.parent.worldToLocal(dragPoint));
intersector.quaternion.copy(object3d.parent.quaternion);
intersector.updateMatrixWorld();// necessary for raycast, TODO: Make GH issue
}

Expand Down

0 comments on commit 63d3778

Please sign in to comment.