aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorhwc4872012-04-16 13:10:27 -0700
committerhwc4872012-04-16 13:10:27 -0700
commit19115d65a309ccbeab8e07d426ac398dae8a9d68 (patch)
tree9502d5f55165e7c2771f0de27915f3bca869e5c7 /js/tools
parenta62cfc5976b03a9b6c7ee2f308312319b6b0e142 (diff)
downloadninja-19115d65a309ccbeab8e07d426ac398dae8a9d68.tar.gz
snapping for stage rotation tool
Diffstat (limited to 'js/tools')
-rwxr-xr-xjs/tools/RotateStage3DTool.js8
1 files changed, 5 insertions, 3 deletions
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js
index f5cc4040..c0808de3 100755
--- a/js/tools/RotateStage3DTool.js
+++ b/js/tools/RotateStage3DTool.js
@@ -72,9 +72,11 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
72 var eltCtr = viewUtils.getCenterOfProjection(); 72 var eltCtr = viewUtils.getCenterOfProjection();
73 viewUtils.popViewportObj(); 73 viewUtils.popViewportObj();
74 74
75 eltCtr = viewUtils.localToGlobal(eltCtr, elt); 75 // cache the local to global and global to local matrices
76 76 var l2gMat = viewUtils.getLocalToGlobalMatrix( elt );
77 this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr}); 77 var g2lMat = glmat4.inverse( l2gMat, [] );
78 eltCtr = MathUtils.transformAndDivideHomogeneousPoint( eltCtr, l2gMat );
79 this._targets.push({elt:elt, mat:curMat, matInv:curMatInv, ctr:eltCtr, l2g:l2gMat, g2l:g2lMat});
78 80
79 ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool"); 81 ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool");
80 } 82 }