aboutsummaryrefslogtreecommitdiff
path: root/js/tools/TranslateObject3DTool.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-07-24 09:46:47 -0700
committerJose Antonio Marquez2012-07-24 09:46:47 -0700
commit2f32323d6d5a65feaaa53461a80fcef297a5b65a (patch)
tree0956c504a462609f3818052ab6a641c520b12dd5 /js/tools/TranslateObject3DTool.js
parent2952c2465b9a66076344087f899c5c836ad15ad6 (diff)
parent55a69aeb3c66b533d5a2d27d7548471c2c8b5dfc (diff)
downloadninja-2f32323d6d5a65feaaa53461a80fcef297a5b65a.tar.gz
Merge branch 'refs/heads/Ninja-Master' into Document
Diffstat (limited to 'js/tools/TranslateObject3DTool.js')
-rwxr-xr-xjs/tools/TranslateObject3DTool.js11
1 files changed, 4 insertions, 7 deletions
diff --git a/js/tools/TranslateObject3DTool.js b/js/tools/TranslateObject3DTool.js
index 284ba417..a3ece1f9 100755
--- a/js/tools/TranslateObject3DTool.js
+++ b/js/tools/TranslateObject3DTool.js
@@ -32,7 +32,6 @@ POSSIBILITY OF SUCH DAMAGE.
32var Montage = require("montage/core/core").Montage, 32var Montage = require("montage/core/core").Montage,
33 Translate3DToolBase = require("js/tools/Translate3DToolBase").Translate3DToolBase, 33 Translate3DToolBase = require("js/tools/Translate3DToolBase").Translate3DToolBase,
34 drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils, 34 drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils,
35 vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils,
36 viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils, 35 viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils,
37 vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils, 36 vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils,
38 snapManager = require("js/helper-classes/3D/snap-manager").SnapManager; 37 snapManager = require("js/helper-classes/3D/snap-manager").SnapManager;
@@ -48,8 +47,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
48 }, 47 },
49 48
50 initializeSnapping : { 49 initializeSnapping : {
51 value : function(event) 50 value : function(event) {
52 {
53// console.log( "initializeSnapping" ); 51// console.log( "initializeSnapping" );
54 52
55 this._mouseDownHitRec = null; 53 this._mouseDownHitRec = null;
@@ -79,8 +77,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
79 else 77 else
80 { 78 {
81 this._delta = null; 79 this._delta = null;
82 //if(this._handleMode === 2) 80 //if(this._handleMode === 2) {
83 {
84 this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target, this._handleMode, this._inLocalMode); 81 this._dragPlane = viewUtils.getNormalToUnprojectedElementPlane(this._target, this._handleMode, this._inLocalMode);
85 //console.log( "dragPlane: " + this._dragPlane ); 82 //console.log( "dragPlane: " + this._dragPlane );
86 snapManager.setupDragPlaneFromPlane(this._dragPlane); 83 snapManager.setupDragPlaneFromPlane(this._dragPlane);
@@ -88,7 +85,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
88 85
89 snapManager.enableElementSnap ( false ); 86 snapManager.enableElementSnap ( false );
90 snapManager.enableGridSnap ( false ); 87 snapManager.enableGridSnap ( false );
91 } 88 //}
92 } 89 }
93 90
94 if(this.application.ninja.selectedElements.length) { 91 if(this.application.ninja.selectedElements.length) {
@@ -161,7 +158,7 @@ exports.TranslateObject3DTool = Montage.create(Translate3DToolBase, {
161 // only do quadrant snapping if the 4 corners of the element are in the drag plane 158 // only do quadrant snapping if the 4 corners of the element are in the drag plane
162 159
163 var sign = MathUtils.fpSign( vecUtils.vecDot(3,this._dragPlane,[0,0,1]) + this._dragPlane[3] - 1.0); 160 var sign = MathUtils.fpSign( vecUtils.vecDot(3,this._dragPlane,[0,0,1]) + this._dragPlane[3] - 1.0);
164 this._shouldUseQuadPt = (sign == 0); 161 this._shouldUseQuadPt = (sign === 0);
165 162
166 var wpHitRec = hitRec.convertToWorkingPlane( this._dragPlane ); 163 var wpHitRec = hitRec.convertToWorkingPlane( this._dragPlane );
167 this._mouseDownHitRec = wpHitRec; 164 this._mouseDownHitRec = wpHitRec;