diff options
author | Valerio Virgillito | 2012-04-19 11:01:24 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-04-19 11:01:24 -0700 |
commit | 6d33345a9e609e36539d2efa25569f5eeb04a2af (patch) | |
tree | 4876ca48e3c09d43e53a9787dce05185a2850bbc /js/tools/RotateStage3DTool.js | |
parent | 9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff) | |
parent | 1f2d84716ddca3cfc9e5457f67ec1b007b3455a8 (diff) | |
download | ninja-6d33345a9e609e36539d2efa25569f5eeb04a2af.tar.gz |
Merge pull request #168 from mqg734/EricMerge
Merging Eric's snapping and tool fixes into master.
Diffstat (limited to 'js/tools/RotateStage3DTool.js')
-rwxr-xr-x | js/tools/RotateStage3DTool.js | 7 |
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 | } |