aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/src/core/script/particle.js
diff options
context:
space:
mode:
authorKris Kowal2012-07-06 11:52:06 -0700
committerKris Kowal2012-07-06 15:01:48 -0700
commit648ee61ae84216d0236e0dbc211addc13b2cfa3a (patch)
tree8f0f55557bd0c47a84e49c1977c950645d284607 /js/helper-classes/RDGE/src/core/script/particle.js
parentaedd14b18695d031f695d27dfbd94df5614495bb (diff)
downloadninja-648ee61ae84216d0236e0dbc211addc13b2cfa3a.tar.gz
Expand tabs
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/particle.js')
-rwxr-xr-xjs/helper-classes/RDGE/src/core/script/particle.js14
1 files changed, 7 insertions, 7 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/particle.js b/js/helper-classes/RDGE/src/core/script/particle.js
index d1ab6239..158807bb 100755
--- a/js/helper-classes/RDGE/src/core/script/particle.js
+++ b/js/helper-classes/RDGE/src/core/script/particle.js
@@ -62,8 +62,8 @@ RDGE.particle = function (def, id) {
62 62
63 this.randomize3 = function (min, max) { 63 this.randomize3 = function (min, max) {
64 return [this.randomize(min[0], max[0]), 64 return [this.randomize(min[0], max[0]),
65 this.randomize(min[1], max[1]), 65 this.randomize(min[1], max[1]),
66 this.randomize(min[2], max[2])]; 66 this.randomize(min[2], max[2])];
67 }; 67 };
68 68
69 this.spawn = function (spawnMatrix) { 69 this.spawn = function (spawnMatrix) {
@@ -148,7 +148,7 @@ RDGE.particleBuffer = function (pdef, emitter, size) {
148 'u_textureSize': { 'type': 'vec2' }, 148 'u_textureSize': { 'type': 'vec2' },
149 'u_frameSize': { 'type': 'vec2' }, 149 'u_frameSize': { 'type': 'vec2' },
150 's_texture0': { 'type': 'tex2d' } 150 's_texture0': { 'type': 'tex2d' }
151 // 's_texture1' : { 'type' : 'tex2d' } 151 // 's_texture1' : { 'type' : 'tex2d' }
152 } 152 }
153 }] 153 }]
154 } 154 }
@@ -336,8 +336,8 @@ RDGE.particleBuffer = function (pdef, emitter, size) {
336 var age = (p.age / p.lifespan); // normalized age 336 var age = (p.age / p.lifespan); // normalized age
337 // combine frame number and age and store in w. 337 // combine frame number and age and store in w.
338 // to decode : 338 // to decode :
339 // frame = floor( w ); 339 // frame = floor( w );
340 // age = fract( w ); 340 // age = fract( w );
341 var pw = Math.min(age, 0.999) + Math.floor(p.frame); 341 var pw = Math.min(age, 0.999) + Math.floor(p.frame);
342 if (age < 1.0) { // || (pdef.persist != undefined && pdef.persist == true)) { 342 if (age < 1.0) { // || (pdef.persist != undefined && pdef.persist == true)) {
343 var px = p.pos[0]; 343 var px = p.pos[0];
@@ -481,7 +481,7 @@ RDGE.particleBuffer = function (pdef, emitter, size) {
481 else { 481 else {
482 shaderparms.u_viewMatrix.set(activeCam.view); 482 shaderparms.u_viewMatrix.set(activeCam.view);
483 shaderparms.u_worldMatrix.set(this.owner.world); 483 shaderparms.u_worldMatrix.set(this.owner.world);
484 // shaderparms.u_mvMatrix.set(RDGE.mat4.mul(this.owner.world, activeCam.view)); 484 // shaderparms.u_mvMatrix.set(RDGE.mat4.mul(this.owner.world, activeCam.view));
485 } 485 }
486 shaderparms.u_projMatrix.set(activeCam.proj); 486 shaderparms.u_projMatrix.set(activeCam.proj);
487 487
@@ -492,7 +492,7 @@ RDGE.particleBuffer = function (pdef, emitter, size) {
492 shaderparms.u_textureSize.set(pdef.textureSize); 492 shaderparms.u_textureSize.set(pdef.textureSize);
493 shaderparms.u_frameSize.set(pdef.frameSize); 493 shaderparms.u_frameSize.set(pdef.frameSize);
494 shaderparms.s_texture0.set(this.texture); 494 shaderparms.s_texture0.set(this.texture);
495 // shaderparms.s_texture1.set(null); 495 // shaderparms.s_texture1.set(null);
496 496
497 var passCount = this.shader.begin(); 497 var passCount = this.shader.begin();
498 for (passIdx = 0; passIdx < passCount; ++passIdx) { 498 for (passIdx = 0; passIdx < passCount; ++passIdx) {