aboutsummaryrefslogtreecommitdiff
path: root/js/tools/RotateStage3DTool.js
diff options
context:
space:
mode:
authorJon Reid2012-04-19 14:30:38 -0700
committerJon Reid2012-04-19 14:30:38 -0700
commit71e1e65d6aaa64afc9fffba9b1fd6d19904b52b0 (patch)
tree78292a128cd79f2aa7fbc7a7077dea83389a52e8 /js/tools/RotateStage3DTool.js
parentfc22cd3b5c65dc6f137fbb59443e2061cbbcac26 (diff)
parent4465a66996f2b022ab9e838e028415fd87cfa405 (diff)
downloadninja-71e1e65d6aaa64afc9fffba9b1fd6d19904b52b0.tar.gz
Merge remote-tracking branch 'ninja-jduran/TimelineUber' into timeline-local
Conflicts: js/panels/Timeline/TimelinePanel.reel/TimelinePanel.js Used mine.
Diffstat (limited to 'js/tools/RotateStage3DTool.js')
-rwxr-xr-xjs/tools/RotateStage3DTool.js7
1 files changed, 6 insertions, 1 deletions
diff --git a/js/tools/RotateStage3DTool.js b/js/tools/RotateStage3DTool.js
index a980bf73..d1701304 100755
--- a/js/tools/RotateStage3DTool.js
+++ b/js/tools/RotateStage3DTool.js
@@ -70,11 +70,16 @@ exports.RotateStage3DTool = Montage.create(Rotate3DToolBase, {
70 var eltCtr = viewUtils.getCenterOfProjection(); 70 var eltCtr = viewUtils.getCenterOfProjection();
71 viewUtils.popViewportObj(); 71 viewUtils.popViewportObj();
72 72
73 eltCtr = viewUtils.localToGlobal(eltCtr, elt); 73 // cache the local to global and global to local matrices
74 var l2gMat = viewUtils.getLocalToGlobalMatrix( elt );
75 var g2lMat = glmat4.inverse( l2gMat, [] );
76 eltCtr = MathUtils.transformAndDivideHomogeneousPoint( eltCtr, l2gMat );
74 77
75 elt.elementModel.setProperty("mat", curMat); 78 elt.elementModel.setProperty("mat", curMat);
76 elt.elementModel.setProperty("matInv", curMatInv); 79 elt.elementModel.setProperty("matInv", curMatInv);
77 elt.elementModel.setProperty("ctr", eltCtr); 80 elt.elementModel.setProperty("ctr", eltCtr);
81 elt.elementModel.setProperty("l2g", l2gMat);
82 elt.elementModel.setProperty("g2l", g2lMat);
78 83
79 ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool"); 84 ElementsMediator.setMatrix(elt, curMat, false, "rotateStage3DTool");
80 } 85 }