aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes')
-rw-r--r--js/helper-classes/3D/snap-manager.js13
-rw-r--r--js/helper-classes/RDGE/GLCircle.js10
-rw-r--r--js/helper-classes/RDGE/GLGeomObj.js3
-rw-r--r--js/helper-classes/RDGE/GLMaterial.js40
-rw-r--r--js/helper-classes/RDGE/GLRectangle.js157
-rw-r--r--js/helper-classes/RDGE/GLWorld.js221
-rw-r--r--js/helper-classes/RDGE/Materials/BumpMetalMaterial.js66
-rw-r--r--js/helper-classes/RDGE/Materials/DeformMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/FlatMaterial.js44
-rw-r--r--js/helper-classes/RDGE/Materials/FlyMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/IridescentScalesMaterial.js5
-rw-r--r--js/helper-classes/RDGE/Materials/JuliaMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/KeleidoscopeMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/LinearGradientMaterial.js8
-rw-r--r--js/helper-classes/RDGE/Materials/MandelMaterial.js4
-rw-r--r--js/helper-classes/RDGE/Materials/PlasmaMaterial.js2
-rw-r--r--js/helper-classes/RDGE/Materials/PulseMaterial.js15
-rw-r--r--js/helper-classes/RDGE/Materials/RadialBlurMaterial.js5
-rw-r--r--js/helper-classes/RDGE/Materials/RadialGradientMaterial.js188
-rw-r--r--js/helper-classes/RDGE/Materials/ReliefTunnelMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/SquareTunnelMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/StarMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/TunnelMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/TwistMaterial.js3
-rw-r--r--js/helper-classes/RDGE/Materials/UberMaterial.js25
-rw-r--r--js/helper-classes/RDGE/Materials/WaterMaterial.js133
-rw-r--r--js/helper-classes/RDGE/Materials/ZInvertMaterial.js133
-rw-r--r--js/helper-classes/RDGE/MaterialsLibrary.js61
-rw-r--r--js/helper-classes/RDGE/rdge-compiled.js102
-rw-r--r--js/helper-classes/RDGE/src/core/script/engine.js18
-rw-r--r--js/helper-classes/RDGE/src/core/script/init_state.js7
-rw-r--r--js/helper-classes/RDGE/src/core/script/jshader.js6
-rw-r--r--js/helper-classes/RDGE/src/core/script/renderer.js27
-rw-r--r--js/helper-classes/RDGE/src/core/script/run_state.js10
-rw-r--r--js/helper-classes/RDGE/src/core/script/runtime.js2
35 files changed, 1723 insertions, 259 deletions
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 8819f637..7e1260bf 100644
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -977,7 +977,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
977 viewUtils.setViewportObj( stage ); 977 viewUtils.setViewportObj( stage );
978 978
979 MathUtils.makeDimension3( screenPt ); 979 MathUtils.makeDimension3( screenPt );
980 this.hSnapToElements( stage, screenPt, hitRecs, 0, screenPt ); 980 this.hSnapToElements( stage, hitRecs, 0, screenPt );
981 981
982 return; 982 return;
983 } 983 }
@@ -985,7 +985,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
985 985
986 hSnapToElements : 986 hSnapToElements :
987 { 987 {
988 value: function( elt, parentPt, hitRecs, depth, globalScrPt ) 988 value: function( elt, hitRecs, depth, globalScrPt )
989 { 989 {
990 // hit test the current object 990 // hit test the current object
991 var hit; 991 var hit;
@@ -994,8 +994,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
994 // if the element is in the 2D cache snapping is done there 994 // if the element is in the 2D cache snapping is done there
995 if (elt.elementModel && !elt.elementModel.isIn2DSnapCache) 995 if (elt.elementModel && !elt.elementModel.isIn2DSnapCache)
996 { 996 {
997 var scrPt = viewUtils.parentToChild( parentPt, elt, false ); 997 hit = this.snapToElement( elt, globalScrPt );
998 hit = this.snapToElement( elt, scrPt, globalScrPt );
999 if (hit) 998 if (hit)
1000 { 999 {
1001 //hitRecs.push( hit ); 1000 //hitRecs.push( hit );
@@ -1017,14 +1016,14 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1017 } 1016 }
1018 // test the rest of the tree 1017 // test the rest of the tree
1019 var n = elt.childElementCount; 1018 var n = elt.childElementCount;
1020 var eltPt = viewUtils.parentToChild( parentPt, elt, true ); 1019 //var eltPt = viewUtils.parentToChild( parentPt, elt, true );
1021 if (n > 0) 1020 if (n > 0)
1022 { 1021 {
1023 for (var i=0; i<n; i++) 1022 for (var i=0; i<n; i++)
1024 { 1023 {
1025 var child = elt.children[i]; 1024 var child = elt.children[i];
1026 //var childPt = viewUtils.parentToChild( scrPt, child ); 1025 //var childPt = viewUtils.parentToChild( scrPt, child );
1027 hit = this.hSnapToElements( child, eltPt, hitRecs, (depth+1), globalScrPt ); 1026 hit = this.hSnapToElements( child, hitRecs, (depth+1), globalScrPt );
1028 if (hit) 1027 if (hit)
1029 { 1028 {
1030 //hitRecs.push( hit ); 1029 //hitRecs.push( hit );
@@ -1044,7 +1043,7 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1044 1043
1045 snapToElement : 1044 snapToElement :
1046 { 1045 {
1047 value: function( elt, scrPt, globalScrPt ) 1046 value: function( elt, globalScrPt )
1048 { 1047 {
1049 if (this.isAvoidedElement(elt) ) return null; 1048 if (this.isAvoidedElement(elt) ) return null;
1050 1049
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..07a98ab5 100644
--- a/js/helper-classes/RDGE/GLMaterial.js
+++ b/js/helper-classes/RDGE/GLMaterial.js
@@ -31,6 +31,11 @@ function GLMaterial( world )
31 31
32 this._texture; 32 this._texture;
33 33
34 // vertex deformation variables
35 this._hasVertexDeformation = false;
36 this._vertexDeformationRange = [0, 0, 1, 1]; // (xMin, yMin, xMax, yMax)
37 this._vertexDeformationTolerance = 0.05;
38
34 // RDGE variables 39 // RDGE variables
35 this._shader; 40 this._shader;
36 this._materialNode; 41 this._materialNode;
@@ -62,6 +67,16 @@ function GLMaterial( world )
62 this.getShader = function() { return this._shader; } 67 this.getShader = function() { return this._shader; }
63 this.getMaterialNode = function() { return this._materialNode; } 68 this.getMaterialNode = function() { return this._materialNode; }
64 69
70 // a material can be animated or not. default is not.
71 // Any material needing continuous rendering should override this method
72 this.isAnimated = function() { return false; }
73
74 // the vertex shader can apply deformations requiring refinement in
75 // certain areas.
76 this.hasVertexDeformation = function() { return this._hasVertexDeformation; }
77 this.getVertexDeformationRange = function() { return this._vertexDeformationRange.slice(); }
78 this.getVertexDeformationTolerance = function() { return this._vertexDeformationTolerance; }
79
65 80
66 /////////////////////////////////////////////////////////////////////// 81 ///////////////////////////////////////////////////////////////////////
67 // Common Material Methods 82 // Common Material Methods
@@ -174,6 +189,31 @@ function GLMaterial( world )
174 // animated materials should implement the update method 189 // animated materials should implement the update method
175 } 190 }
176 191
192 this.registerTexture = function( texture )
193 {
194 // the world needs to know about the texture map
195 var world = this.getWorld();