diff options
author | Nivesh Rajbhandari | 2012-03-13 13:05:16 -0700 |
---|---|---|
committer | Nivesh Rajbhandari | 2012-03-13 13:05:16 -0700 |
commit | e19376c54eedd1f1c457ba405b2f110be376a559 (patch) | |
tree | d48c090f71ed2cd6bd6ce38ff68c36ab69299985 /js/lib/rdge/materials/taper-material.js | |
parent | 970c2e63aa8ec3f70df2bf073cedb9e3b7617755 (diff) | |
parent | f56b8cf4d3316d250c0f0045fb78f0dbd5c56e94 (diff) | |
download | ninja-e19376c54eedd1f1c457ba405b2f110be376a559.tar.gz |
Merge branch 'refs/heads/ninja-internal' into WebGLFixes
Diffstat (limited to 'js/lib/rdge/materials/taper-material.js')
-rw-r--r-- | js/lib/rdge/materials/taper-material.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/taper-material.js b/js/lib/rdge/materials/taper-material.js index eeb08aec..03a7ba9c 100644 --- a/js/lib/rdge/materials/taper-material.js +++ b/js/lib/rdge/materials/taper-material.js | |||
@@ -42,8 +42,10 @@ function TaperMaterial() | |||
42 | // duplcate method requirde | 42 | // duplcate method requirde |
43 | this.dup = function() { return new TaperMaterial(); } | 43 | this.dup = function() { return new TaperMaterial(); } |
44 | 44 | ||
45 | this.init = function() | 45 | this.init = function( world ) |
46 | { | 46 | { |
47 | this.setWorld( world ); | ||
48 | |||
47 | // set up the shader | 49 | // set up the shader |
48 | this._shader = new jshader(); | 50 | this._shader = new jshader(); |
49 | this._shader.def = taperShaderDef; | 51 | this._shader.def = taperShaderDef; |
@@ -53,7 +55,7 @@ function TaperMaterial() | |||
53 | this._shader.colorMe.color.set( this.getColor() ); | 55 | this._shader.colorMe.color.set( this.getColor() ); |
54 | 56 | ||
55 | // set up the material node | 57 | // set up the material node |
56 | this._materialNode = createMaterialNode("taperMaterial"); | 58 | this._materialNode = createMaterialNode("taperMaterial" + "_" + world.generateUniqueNodeID()); |
57 | this._materialNode.setShader(this._shader); | 59 | this._materialNode.setShader(this._shader); |
58 | 60 | ||
59 | // initialize the taper properties | 61 | // initialize the taper properties |
@@ -102,7 +104,7 @@ function TaperMaterial() | |||
102 | exportStr += "name: " + this.getName() + "\n"; | 104 | exportStr += "name: " + this.getName() + "\n"; |
103 | 105 | ||
104 | if (this._shader) | 106 | if (this._shader) |
105 | exportStr += "color: " + String(this._shader.colorMe.color) + "\n"; | 107 | exportStr += "color: " + this._shader.colorMe.color + "\n"; |
106 | else | 108 | else |
107 | exportStr += "color: " + this.getColor() + "\n"; | 109 | exportStr += "color: " + this.getColor() + "\n"; |
108 | exportStr += "endMaterial\n"; | 110 | exportStr += "endMaterial\n"; |