diff options
Diffstat (limited to 'js')
32 files changed, 672 insertions, 288 deletions
diff --git a/js/controllers/elements/canvas-controller.js b/js/controllers/elements/canvas-controller.js index 21de9879..b5df3911 100644 --- a/js/controllers/elements/canvas-controller.js +++ b/js/controllers/elements/canvas-controller.js | |||
@@ -34,12 +34,12 @@ exports.CanvasController = Montage.create(ElementController, { | |||
34 | } | 34 | } |
35 | } | 35 | } |
36 | }, | 36 | }, |
37 | 37 | ||
38 | setProperties: { | 38 | setProperties: { |
39 | value: function(el, props, index) { | 39 | value: function(el, props, index) { |
40 | for(var p in props) { | 40 | for(var p in props) { |
41 | el.elementModel.controller.setProperty(el, p, props[p][index]); | 41 | el.elementModel.controller.setProperty(el, p, props[p][index]); |
42 | } | 42 | } |
43 | } | 43 | } |
44 | } | 44 | } |
45 | }); \ No newline at end of file | 45 | }); \ No newline at end of file |
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js index 3ed96082..8819f637 100644 --- a/js/helper-classes/3D/snap-manager.js +++ b/js/helper-classes/3D/snap-manager.js | |||
@@ -1780,7 +1780,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1780 | var mergedSnap = this.mergeHitRecords( hitRecs ); | 1780 | var mergedSnap = this.mergeHitRecords( hitRecs ); |
1781 | if (mergedSnap) | 1781 | if (mergedSnap) |
1782 | { | 1782 | { |
1783 | while (hitRecs.length > 0) hitRecs.pop(); | 1783 | while (hitRecs.length > 0) hitRecs.pop(); |
1784 | hitRecs.push( mergedSnap ); | 1784 | hitRecs.push( mergedSnap ); |
1785 | //console.log( "merged snaps" ); | 1785 | //console.log( "merged snaps" ); |
1786 | } | 1786 | } |
@@ -1836,6 +1836,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1836 | hSnap.setLocalPoint( localPt ); | 1836 | hSnap.setLocalPoint( localPt ); |
1837 | hSnap.setScreenPoint( scrPt ); | 1837 | hSnap.setScreenPoint( scrPt ); |
1838 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); | 1838 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); |
1839 | hSnap.setElement( stage ); | ||
1840 | hSnap.setPlane( [0,0,1,0] ); | ||
1841 | hSnap.setPlaneMatrix( Matrix.I(4) ); | ||
1839 | if (vSnap.hasAssociatedScreenPoint() ) | 1842 | if (vSnap.hasAssociatedScreenPoint() ) |
1840 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); | 1843 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); |
1841 | if (vSnap.hasAssociatedScreenPoint2() ) | 1844 | if (vSnap.hasAssociatedScreenPoint2() ) |
@@ -1882,6 +1885,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1882 | hSnap.setLocalPoint( localPt ); | 1885 | hSnap.setLocalPoint( localPt ); |
1883 | hSnap.setScreenPoint( scrPt ); | 1886 | hSnap.setScreenPoint( scrPt ); |
1884 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); | 1887 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); |
1888 | hSnap.setElement( stage ); | ||
1889 | hSnap.setPlane( [0,0,1,0] ); | ||
1890 | hSnap.setPlaneMatrix( Matrix.I(4) ); | ||
1885 | if (vSnap.hasAssociatedScreenPoint() ) | 1891 | if (vSnap.hasAssociatedScreenPoint() ) |
1886 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); | 1892 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); |
1887 | if (vSnap.hasAssociatedScreenPoint2() ) | 1893 | if (vSnap.hasAssociatedScreenPoint2() ) |
@@ -1934,6 +1940,9 @@ var SnapManager = exports.SnapManager = Montage.create(Component, { | |||
1934 | hSnap.setLocalPoint( localPt ); | 1940 | hSnap.setLocalPoint( localPt ); |
1935 | hSnap.setScreenPoint( scrPt ); | 1941 | hSnap.setScreenPoint( scrPt ); |
1936 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); | 1942 | hSnap.setType( hSnap.SNAP_TYPE_ALIGN_MERGED ); |
1943 | hSnap.setElement( stage ); | ||
1944 | hSnap.setPlane( [0,0,1,0] ); | ||
1945 | hSnap.setPlaneMatrix( Matrix.I(4) ); | ||
1937 | if (vSnap.hasAssociatedScreenPoint() ) | 1946 | if (vSnap.hasAssociatedScreenPoint() ) |
1938 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); | 1947 | hSnap.setAssociatedScreenPoint( vSnap.getAssociatedScreenPoint() ); |
1939 | if (vSnap.hasAssociatedScreenPoint2() ) | 1948 | if (vSnap.hasAssociatedScreenPoint2() ) |
diff --git a/js/helper-classes/RDGE/GLCircle.js b/js/helper-classes/RDGE/GLCircle.js index fc2e6460..8f7a5d30 100644 --- a/js/helper-classes/RDGE/GLCircle.js +++ b/js/helper-classes/RDGE/GLCircle.js | |||
@@ -63,14 +63,16 @@ function GLCircle() | |||
63 | 63 | ||
64 | this.m_world = world; | 64 | this.m_world = world; |
65 | 65 | ||
66 | |||
66 | if(strokeMaterial) | 67 | if(strokeMaterial) |
67 | { | ||
68 | this._strokeMaterial = strokeMaterial; | 68 | this._strokeMaterial = strokeMaterial; |
69 | } | 69 | else |
70 | this._strokeMaterial = new FlatMaterial(); | ||
71 | |||
70 | if(fillMaterial) | 72 | if(fillMaterial) |
71 | { | ||
72 | this._fillMaterial = fillMaterial; | 73 | this._fillMaterial = fillMaterial; |
73 | } | 74 | else |
75 | this._fillMaterial = new FlatMaterial(); | ||
74 | } | 76 | } |
75 | 77 | ||
76 | /////////////////////////////////////////////////////////////////////// | 78 | /////////////////////////////////////////////////////////////////////// |
diff --git a/js/helper-classes/RDGE/GLGeomObj.js b/js/helper-classes/RDGE/GLGeomObj.js index 72019703..e04b3283 100644 --- a/js/helper-classes/RDGE/GLGeomObj.js +++ b/js/helper-classes/RDGE/GLGeomObj.js | |||
@@ -99,6 +99,9 @@ function GLGeomObj() | |||
99 | } | 99 | } |
100 | } | 100 | } |
101 | } | 101 | } |
102 | |||
103 | var world = this.getWorld(); | ||
104 | if (world) world.restartRenderLoop(); | ||
102 | } | 105 | } |
103 | 106 | ||
104 | this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } | 107 | this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } |
diff --git a/js/helper-classes/RDGE/GLMaterial.js b/js/helper-classes/RDGE/GLMaterial.js index 51c27ace..c633f679 100644 --- a/js/helper-classes/RDGE/GLMaterial.js +++ b/js/helper-classes/RDGE/GLMaterial.js | |||
@@ -62,6 +62,10 @@ function GLMaterial( world ) | |||
62 | this.getShader = function() { return this._shader; } | 62 | this.getShader = function() { return this._shader; } |
63 | this.getMaterialNode = function() { return this._materialNode; } | 63 | this.getMaterialNode = function() { return this._materialNode; } |
64 | 64 | ||
65 | // a material can be animated or not. default is not. | ||
66 | // Any material needing continuous rendering should override this method | ||
67 | this.isAnimated = function() { return false; } | ||
68 | |||
65 | 69 | ||
66 | /////////////////////////////////////////////////////////////////////// | 70 | /////////////////////////////////////////////////////////////////////// |
67 | // Common Material Methods | 71 | // Common Material Methods |
@@ -174,6 +178,31 @@ function GLMaterial( world ) | |||
174 | // animated materials should implement the update method | 178 | // animated materials should implement the update method |
175 | } | 179 | } |
176 | 180 | ||
181 | this.registerTexture = function( texture ) | ||
182 | { | ||
183 | // the world needs to know about the texture map | ||
184 | var world = this.getWorld(); | ||
185 | if (!world) | ||
186 | console.log( "**** world not defined for registering texture map: " + texture.lookUpName ); | ||
187 | else | ||
188 | world.textureToLoad( texture ); | ||
189 | } | ||
190 | |||
191 | this.loadTexture = function( texMapName, wrap, mips ) | ||
192 | { | ||
193 | var tex; | ||
194 | var world = this.getWorld(); | ||
195 | if (!world) | ||
196 | console.log( "world not defined for material with texture map" ); | ||
197 | else | ||
198 | { | ||
199 | var renderer = world.getRenderer(); | ||
200 | tex = renderer.getTextureByName(texMapName, wrap, mips ); | ||
201 | this.registerTexture( tex ); | ||
202 | } | ||