aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/GLLine.js
diff options
context:
space:
mode:
authorValerio Virgillito2012-02-08 10:18:36 -0800
committerValerio Virgillito2012-02-08 10:18:36 -0800
commit763910b9d074137eb7dee80447b89407ce5750c9 (patch)
tree3c8820a06afd442fa5ba8e68665a4d2836230628 /js/helper-classes/RDGE/GLLine.js
parente5579374ff39b80b8c0c69faba37f6f581758fe0 (diff)
parent329a859e2666716c3a1d99c6bd2679e10c81fc8d (diff)
downloadninja-763910b9d074137eb7dee80447b89407ce5750c9.tar.gz
Merge pull request #20 from mqg734/ToolFixes
Hooked up materials code to go through the ShapesController and updated the PI to reflect the currently selected shape's materials. Also fixed the following bugs:
Diffstat (limited to 'js/helper-classes/RDGE/GLLine.js')
-rw-r--r--js/helper-classes/RDGE/GLLine.js27
1 files changed, 3 insertions, 24 deletions
diff --git a/js/helper-classes/RDGE/GLLine.js b/js/helper-classes/RDGE/GLLine.js
index 9eaa69d1..bd3cbc26 100644
--- a/js/helper-classes/RDGE/GLLine.js
+++ b/js/helper-classes/RDGE/GLLine.js
@@ -27,12 +27,6 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
27 27
28 this._strokeWidth = 0.25; 28 this._strokeWidth = 0.25;
29 29
30 // stroke colors
31 this._strokeColor = [0.4, 0.4, 0.4, 1.0];
32
33 // stroke materials
34 this._strokeMaterial;
35
36 this._strokeStyle = "Solid"; 30 this._strokeStyle = "Solid";
37 31
38 if (arguments.length > 0) 32 if (arguments.length > 0)
@@ -267,26 +261,11 @@ function GLLine( world, xOffset, yOffset, width, height, slope, strokeSize, stro
267 } 261 }
268 262
269 var prim = ShapePrimitive.create(strokeVertices, strokeNormals, strokeTextures, indices, g_Engine.getContext().renderer.TRIANGLES, indices.length); 263 var prim = ShapePrimitive.create(strokeVertices, strokeNormals, strokeTextures, indices, g_Engine.getContext().renderer.TRIANGLES, indices.length);
270 this._primArray.push( prim );
271 264
272 var strokeMaterial; 265 var strokeMaterial = this.makeStrokeMaterial();
273 if (this.getStrokeMaterial())
274 strokeMaterial = this.getStrokeMaterial().dup();
275 else
276 strokeMaterial = new FlatMaterial();
277 266
278 if (strokeMaterial) 267 this._primArray.push( prim );
279 { 268 this._materialNodeArray.push( strokeMaterial.getMaterialNode() );
280 strokeMaterial.init( this.getWorld() );
281 if(!this.getStrokeMaterial() && this._strokeColor)
282 {
283 strokeMaterial.setProperty("color", this._strokeColor);
284 }
285 }
286
287 this._materialArray.push( strokeMaterial );
288 this._materialTypeArray.push( "stroke" );
289 this._materialNodeArray.push( strokeMaterial.getMaterialNode() );
290 269
291 world.updateObject(this); 270 world.updateObject(this);
292 } 271 }