diff options
author | hwc487 | 2012-04-19 13:02:24 -0700 |
---|---|---|
committer | hwc487 | 2012-04-19 13:02:24 -0700 |
commit | 7d96e0778ed45e131cb5182ac93610ec3f545083 (patch) | |
tree | 7991dba229f80acd84f6dcb8ecd9878fe8240fe6 /js/tools/RotateStage3DTool.js | |
parent | e6a20fe64574763483dc602bd759278ccf5e5e68 (diff) | |
parent | 6d33345a9e609e36539d2efa25569f5eeb04a2af (diff) | |
download | ninja-7d96e0778ed45e131cb5182ac93610ec3f545083.tar.gz |
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
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 | } |