aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/3D/snap-manager.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/3D/snap-manager.js')
-rw-r--r--js/helper-classes/3D/snap-manager.js26
1 files changed, 17 insertions, 9 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 3ed96082..3af7d8cf 100644
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -9,14 +9,13 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
9// Class to do hit testing of objects in the html page 9// Class to do hit testing of objects in the html page
10/////////////////////////////////////////////////////////////////////// 10///////////////////////////////////////////////////////////////////////
11var Montage = require("montage/core/core").Montage, 11var Montage = require("montage/core/core").Montage,
12 Component = require("montage/ui/component").Component; 12 Component = require("montage/ui/component").Component,
13 13 viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils,
14var viewUtils = require("js/helper-classes/3D/view-utils").ViewUtils; 14 vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils,
15var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils; 15 drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils,
16var drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils; 16 HitRecord = require("js/helper-classes/3D/hit-record").HitRecord,
17var HitRecord = require("js/helper-classes/3D/hit-record").HitRecord; 17 Snap2DRecord = require("js/helper-classes/3D/snap-2d-record").Snap2DRecord,
18var Snap2DRecord = require("js/helper-classes/3D/snap-2d-record").Snap2DRecord; 18 NJUtils = require("js/lib/NJUtils").NJUtils;
19var NJUtils = require("js/lib/NJUtils").NJUtils;
20 19
21var SnapManager = exports.SnapManager = Montage.create(Component, { 20var SnapManager = exports.SnapManager = Montage.create(Component, {
22 /////////////////////////////////////////////////////////////////////// 21 ///////////////////////////////////////////////////////////////////////
@@ -1780,7 +1779,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1780 var mergedSnap = this.mergeHitRecords( hitRecs ); 1779 var mergedSnap = this.mergeHitRecords( hitRecs );
1781 if (mergedSnap) 1780 if (mergedSnap)
1782 { 1781 {
1783 while (hitRecs.length > 0) hitRecs.pop(); 1782 while (hitRecs.length > 0) hitRecs.pop();
1784 hitRecs.push( mergedSnap ); 1783 hitRecs.push( mergedSnap );
1785 //console.log( "merged snaps" ); 1784 //console.log( "merged snaps" );
1786 } 1785 }
@@ -1836,6 +1835,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1836 hSnap.setLocalPoint( localPt ); 1835 hSnap.setLocalPoint( localPt );
1837 hSnap.setScreenPoint( scrPt ); 1836 hSnap.setScreenPoint( scrPt );
1838 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); 1837 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED );
1838 hSnap.setElement( stage );
1839 hSnap.setPlane( [0,0,1,0] );
1840 hSnap.setPlaneMatrix( Matrix.I(4) );
1839 if (vSnap.hasAssociatedScreenPoint() ) 1841 if (vSnap.hasAssociatedScreenPoint() )
1840 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); 1842 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() );
1841 if (vSnap.hasAssociatedScreenPoint2() ) 1843 if (vSnap.hasAssociatedScreenPoint2() )
@@ -1882,6 +1884,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1882 hSnap.setLocalPoint( localPt ); 1884 hSnap.setLocalPoint( localPt );
1883 hSnap.setScreenPoint( scrPt ); 1885 hSnap.setScreenPoint( scrPt );
1884 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); 1886 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED );
1887 hSnap.setElement( stage );
1888 hSnap.setPlane( [0,0,1,0] );
1889 hSnap.setPlaneMatrix( Matrix.I(4) );
1885 if (vSnap.hasAssociatedScreenPoint() ) 1890 if (vSnap.hasAssociatedScreenPoint() )
1886 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); 1891 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() );
1887 if (vSnap.hasAssociatedScreenPoint2() ) 1892 if (vSnap.hasAssociatedScreenPoint2() )
@@ -1934,6 +1939,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1934 hSnap.setLocalPoint( localPt ); 1939 hSnap.setLocalPoint( localPt );
1935 hSnap.setScreenPoint( scrPt ); 1940 hSnap.setScreenPoint( scrPt );
1936 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); 1941 hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED );
1942 hSnap.setElement( stage );
1943 hSnap.setPlane( [0,0,1,0] );
1944 hSnap.setPlaneMatrix( Matrix.I(4) );
1937 if (vSnap.hasAssociatedScreenPoint() ) 1945 if (vSnap.hasAssociatedScreenPoint() )
1938 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); 1946 hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() );
1939 if (vSnap.hasAssociatedScreenPoint2() ) 1947 if (vSnap.hasAssociatedScreenPoint2() )