aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/GLGeomObj.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/GLGeomObj.js')
-rw-r--r--js/helper-classes/RDGE/GLGeomObj.js54
1 files changed, 54 insertions, 0 deletions
diff --git a/js/helper-classes/RDGE/GLGeomObj.js b/js/helper-classes/RDGE/GLGeomObj.js
index 72019703..5d7497ad 100644
--- a/js/helper-classes/RDGE/GLGeomObj.js
+++ b/js/helper-classes/RDGE/GLGeomObj.js
@@ -37,6 +37,10 @@ function GLGeomObj()
37 37
38 this.m_world = null; 38 this.m_world = null;
39 39
40 // stroke and fill colors
41 this._strokeColor;
42 this._fillColor;
43
40 // stroke and fill materials 44 // stroke and fill materials
41 this._fillMaterial; 45 this._fillMaterial;
42 this._strokeMaterial; 46 this._strokeMaterial;
@@ -99,11 +103,61 @@ function GLGeomObj()
99 } 103 }
100 } 104 }
101 } 105 }
106
107 var world = this.getWorld();
108 if (world) world.restartRenderLoop();
102 } 109 }
103 110
104 this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); } 111 this.setFillColor = function(c) { this.setMaterialColor(c, "fill"); }
105 this.setStrokeColor = function(c) { this.setMaterialColor(c, "stroke"); } 112 this.setStrokeColor = function(c) { this.setMaterialColor(c, "stroke"); }
106 113
114 this.makeStrokeMaterial = function()
115 {
116 var strokeMaterial;
117 if (this.getStrokeMaterial())
118 strokeMaterial = this.getStrokeMaterial().dup();
119 else
120 strokeMaterial = new FlatMaterial();
121
122 if (strokeMaterial)
123 {
124 strokeMaterial.init( this.getWorld() );
125 if(this._strokeColor)
126 {
127 strokeMaterial.setProperty("color", this._strokeColor);
128 }
129 }
130
131 this._materialArray.push( strokeMaterial );
132 this._materialTypeArray.push( "stroke" );
133
134 return strokeMaterial;
135 }
136
137 this.makeFillMaterial = function()
138 {
139 var fillMaterial;
140 if (this.getFillMaterial())
141 fillMaterial = this.getFillMaterial().dup();
142 else
143 fillMaterial = new FlatMaterial();
144
145 if (fillMaterial)
146 {
147 fillMaterial.init( this.getWorld() );
148 //if(!this.getFillMaterial() && this._fillColor)
149 if (this._fillColor)
150 {
151 fillMaterial.setProperty("color", this._fillColor);
152 }
153 }
154
155 this._materialArray.push( fillMaterial );
156 this._materialTypeArray.push( "fill" );
157
158 return fillMaterial;
159 }
160
107 161
108 this.translate = function(v) 162 this.translate = function(v)
109 { 163 {