aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge
diff options
context:
space:
mode:
authorhwc4872012-05-08 16:15:49 -0700
committerhwc4872012-05-08 16:15:49 -0700
commit3e82beb51fe3f596147e9d7f1c405d9a8c4df63b (patch)
treeaa24a6f504adff0061daa21def06297968f6bba1 /js/lib/rdge
parent24417212f9fad7e992697e9370047fcf2f037913 (diff)
downloadninja-3e82beb51fe3f596147e9d7f1c405d9a8c4df63b.tar.gz
code cleanup for linear gradients.
Diffstat (limited to 'js/lib/rdge')
-rwxr-xr-xjs/lib/rdge/materials/linear-gradient-material.js41
1 files changed, 0 insertions, 41 deletions
diff --git a/js/lib/rdge/materials/linear-gradient-material.js b/js/lib/rdge/materials/linear-gradient-material.js
index 0df9511e..79f323db 100755
--- a/js/lib/rdge/materials/linear-gradient-material.js
+++ b/js/lib/rdge/materials/linear-gradient-material.js
@@ -133,12 +133,6 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
133 } 133 }
134 }; 134 };
135 135
136 // this.getColorCount = function() { return this._colorCount; };
137 // this.setColorCount = function(c) { this._colorCount = c;
138 // if (this._shader && this._shader['default'])
139 // this._shader['default'].u_colorCount.set([c]);
140 // };
141
142 this.getAngle = function () { 136 this.getAngle = function () {
143 return this._angle; 137 return this._angle;
144 }; 138 };
@@ -251,41 +245,6 @@ var LinearGradientMaterial = function LinearGradientMaterial() {
251 } 245 }
252 }; 246 };
253 247
254 this.fitToPrimitive = function( prim )
255 {
256 /*
257 var bounds = ShapePrimitive.getBounds( prim );
258 if (bounds)
259 {
260 var dx = Math.abs( bounds[3] - bounds[0] ),
261 dy = Math.abs( bounds[4] - bounds[1] );
262 if (dy == 0) dy = 1.0;
263 if (dx == 0) dx = 1.0;
264 var xScale = 2.0, yScale = 2.0;
265 if (dx > dy)
266 yScale *= dy/dx;
267 else
268 xScale *= dx/dy;
269
270 // build the matrix - the translation to the origin, the scale,
271 // and the translation back to the center (hard coded at (0.5, 0.5) for now).
272 // the matrix is build directly instead of with matrix multiplications
273 // for efficiency, not to mention that the multiplication function does
274 // not exist for mat3's.
275 // the matrix as laid out below looks transposed - order is columnwise.
276 var xCtr = 0.5, yCtr = 0.5;
277 this._textureTransform = [
278 xScale, 0.0, 0.0,
279 0.0, yScale, 0.0,
280 0.0, 0.0, 1.0
281 ];
282
283 if (this._shader && this._shader['default'])
284 this._shader['default'].u_texTransform.set( this._textureTransform );
285 }
286 */
287 };
288
289 this.exportJSON = function () { 248 this.exportJSON = function () {
290 var jObj = 249 var jObj =
291 { 250 {