aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/3D')
-rwxr-xr-xjs/helper-classes/3D/draw-utils.js4
-rwxr-xr-xjs/helper-classes/3D/math-utils.js5
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js12
3 files changed, 16 insertions, 5 deletions
diff --git a/js/helper-classes/3D/draw-utils.js b/js/helper-classes/3D/draw-utils.js
index 63e7799a..59da411f 100755
--- a/js/helper-classes/3D/draw-utils.js
+++ b/js/helper-classes/3D/draw-utils.js
@@ -139,8 +139,8 @@ var DrawUtils = exports.DrawUtils = Montage.create(Component, {
139 handleCloseDocument:{ 139 handleCloseDocument:{
140 value: function() { 140 value: function() {
141 if(this.application.ninja.documentController._documents.length === 0){ 141 if(this.application.ninja.documentController._documents.length === 0){
142 this._eltArray = []; 142 this._eltArray = null;
143 this._planesArray = []; 143 this._planesArray = null;
144 } 144 }
145 } 145 }
146 }, 146 },
diff --git a/js/helper-classes/3D/math-utils.js b/js/helper-classes/3D/math-utils.js
index 562a6e73..2f0283a9 100755
--- a/js/helper-classes/3D/math-utils.js
+++ b/js/helper-classes/3D/math-utils.js
@@ -729,7 +729,10 @@ var MathUtilsClass = exports.MathUtilsClass = Object.create(Object.prototype, {
729 // the area of the polygon is the length of the normal 729 // the area of the polygon is the length of the normal
730 var area = VecUtils.vecMag(3, normal ); 730 var area = VecUtils.vecMag(3, normal );
731 if (this.fpSign(area) != 0) 731 if (this.fpSign(area) != 0)
732 vec3.scale(normal, 1.0/area); 732 {
733 //vec3.scale(normal, 1.0/area);
734 normal = VecUtils.vecNormalize(3, normal, 1.0);
735 }
733 736
734 return normal; 737 return normal;
735 } 738 }
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index cf8a91db..1caacd00 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -1978,12 +1978,20 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1978 }, 1978 },
1979 1979
1980 setupDragPlanes : { 1980 setupDragPlanes : {
1981 value: function( hitRec ) { 1981 value: function( hitRec, inGlobalMode ) {
1982 // get the location of the point in stage world space 1982 // get the location of the point in stage world space
1983 var elt = hitRec.getElt(); 1983 var elt = hitRec.getElt();
1984 var localPt = hitRec.getLocalPoint(); 1984 var localPt = hitRec.getLocalPoint();
1985 var planeMat = hitRec.getPlaneMatrix(); 1985 var planeMat = hitRec.getPlaneMatrix();
1986 var stageWorldPt = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt ); 1986 var stageWorldPt;
1987 if(inGlobalMode)
1988 {
1989 stageWorldPt = MathUtils.transformPoint(localPt,planeMat);
1990 }
1991 else
1992 {
1993 stageWorldPt = viewUtils.postViewToStageWorld( MathUtils.transformPoint(localPt,planeMat), elt );
1994 }
1987 1995
1988 /* 1996 /*
1989 // get a working plane parallel to the current working plane through the stage world point 1997 // get a working plane parallel to the current working plane through the stage world point