aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-04-30 09:52:59 -0700
committerhwc4872012-04-30 09:52:59 -0700
commit80715f4f0c45d29926184fa02e0a01b4e7642a79 (patch)
tree1cef0da8cca80037a6f346d9d0f4c22a26f71189 /js
parent1a92b93994cd90abc8df61b7a1e5cfc1f65a19ce (diff)
downloadninja-80715f4f0c45d29926184fa02e0a01b4e7642a79.tar.gz
twist vertex material changes
Diffstat (limited to 'js')
-rw-r--r--js/lib/rdge/materials/twist-vert-material.js27
1 files changed, 24 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js
index 892e975f..b27c0b11 100644
--- a/js/lib/rdge/materials/twist-vert-material.js
+++ b/js/lib/rdge/materials/twist-vert-material.js
@@ -47,7 +47,21 @@ var TwistVertMaterial = function TwistVertMaterial()
47 // Methods 47 // Methods
48 /////////////////////////////////////////////////////////////////////// 48 ///////////////////////////////////////////////////////////////////////
49 // duplcate method requirde 49 // duplcate method requirde
50 this.dup = function () { return new TwistVertMaterial(); }; 50 this.dup = function() {
51 // get the current values;
52 var propNames = [], propValues = [], propTypes = [], propLabels = [];
53 this.getAllProperties(propNames, propValues, propTypes, propLabels);
54
55 // allocate a new material
56 var newMat = new TwistVertMaterial();
57
58 // copy over the current values;
59 var n = propNames.length;
60 for (var i = 0; i < n; i++)
61 newMat.setProperty(propNames[i], propValues[i]);
62
63 return newMat;
64 };
51 65
52 this.init = function (world) 66 this.init = function (world)
53 { 67 {
@@ -162,8 +176,15 @@ var TwistVertMaterial = function TwistVertMaterial()
162 { 176 {
163 case "u_tex0": 177 case "u_tex0":
164 case "u_tex1": 178 case "u_tex1":
165 case "color": this._shader.twistMe[propName].set(propValue); break; 179 break;
166 default: this._shader.twistMe[propName].set([propValue]); break; 180
181 case "color":
182 this._shader.twistMe[propName].set(propValue);
183 break;
184
185 default:
186 this._shader.twistMe[propName].set([propValue]);
187 break;
167 } 188 }
168 } 189 }
169 } 190 }