# shiffman/The-Nature-of-Code-Examples

Chapter 4 flight404/flight404_particles_1_simple loc -> pos

1 parent f422aad commit 99335c09a2d99d8a579f04b23f158c8d8819c953 abhikpal committed Sep 19, 2016
 @@ -2,12 +2,11 @@ // Daniel Shiffman // http://natureofcode.com -void renderImage(PImage img, Vec3D _loc, float _diam, color _col, float _alpha ) { +void renderImage(PImage img, Vec3D _pos, float _diam, color _col, float _alpha ) { pushMatrix(); translate( _pos.x, _pos.y, _pos.z ); tint(red(_col), green(_col), blue(_col), _alpha); imageMode(CENTER); image(img,0,0,_diam,_diam); popMatrix(); -} - +}
 @@ -8,7 +8,7 @@ multiple emitters. */ class Emitter{ - Vec3D loc; + Vec3D pos; Vec3D vel; Vec3D velToMouse; @@ -17,7 +17,7 @@ class Emitter{ ArrayList particles; Emitter( ){ - loc = new Vec3D(); + pos = new Vec3D(); vel = new Vec3D(); velToMouse = new Vec3D(); @@ -71,7 +71,7 @@ class Emitter{ void render(){ - renderImage( emitterImg, loc, 150, myColor, 1.0 ); + renderImage( emitterImg, pos, 150, myColor, 1.0 ); } void iterateListRenderTrails(){ @@ -83,7 +83,7 @@ class Emitter{ void addParticles( int _amt ){ for( int i=0; i<_amt; i++ ){ - particles.add( new Particle( loc, vel ) ); + particles.add( new Particle( pos, vel ) ); } } -} +}