Showing the changes to interface/src/ParticleSystem.h (1 of 4 files). Show all
Unified · Split
| @@ -38,21 +38,23 @@ public: · 37 unmodified lines | |||
| 38 | ParticleSystem(); | 38 | ParticleSystem(); |
| 39 | 39 | ||
| 40 | int addEmitter(); // add (create new) emitter and get its unique id | 40 | int addEmitter(); // add (create new) emitter and get its unique id |
| 41 | void emitParticlesNow(int emitterIndex, int numParticles, float thrust); | 41 | void emitNow(int emitterIndex); |
| 42 | void simulate(float deltaTime); | 42 | void simulate(float deltaTime); |
| 43 | void killAllParticles(); | 43 | void killAllParticles(); |
| 44 | void render(); | 44 | void render(); |
| 45 | 45 | ||
| 46 | void setUpDirection(glm::vec3 upDirection) {_upDirection = upDirection;} // tell particle system which direction is up | 46 | void setUpDirection(glm::vec3 upDirection) {_upDirection = upDirection;} // tell particle system which direction is up |
| 47 | void setEmitterBaseParticle (int emitterIndex, bool showing ); | 47 | void setShowingEmitterBaseParticle(int emitterIndex, bool showing ); |
| 48 | void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles | 48 | void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles |
| 49 | void setParticleAttributes (int emitterIndex, int lifeStage, ParticleAttributes attributes); // set attributes for this life stage of particles | 49 | void setParticleAttributes (int emitterIndex, int lifeStage, ParticleAttributes attributes); // set attributes for this life stage of particles |
| 50 | void setEmitterBaseParticleColor (int emitterIndex, glm::vec4 color ) {_emitter[emitterIndex].baseParticle.color = color; } | 50 | void setEmitterBaseParticleColor (int emitterIndex, glm::vec4 color ) {_emitter[emitterIndex].baseParticle.color = color; } |
| 51 | void setEmitterBaseParticleRadius(int emitterIndex, float radius ) {_emitter[emitterIndex].baseParticle.radius = radius; } | 51 | void setEmitterBaseParticleRadius (int emitterIndex, float radius ) {_emitter[emitterIndex].baseParticle.radius = radius; } |
| 52 | void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; } | 52 | void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; } |
| 53 | void setEmitterDirection (int emitterIndex, glm::vec3 direction) {_emitter[emitterIndex].direction = direction; } | 53 | void setEmitterDirection (int emitterIndex, glm::vec3 direction) {_emitter[emitterIndex].direction = direction; } |
| 54 | void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; } | 54 | void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; } |
| 55 | void setEmitterParticleLifespan (int emitterIndex, float lifespan ) {_emitter[emitterIndex].particleLifespan = lifespan; } | 55 | void setEmitterParticleLifespan (int emitterIndex, float lifespan ) {_emitter[emitterIndex].particleLifespan = lifespan; } |
| 56 | void setEmitterThrust (int emitterIndex, float thrust ) {_emitter[emitterIndex].thrust = thrust; } | ||
| 57 | void setEmitterRate (int emitterIndex, float rate ) {_emitter[emitterIndex].rate = rate; } | ||
| 56 | 58 | ||
| 57 | private: | 59 | private: |
| 58 | 60 | ||
| @@ -63,7 +65,6 @@ private: · 4 unmodified lines | |||
| 63 | glm::vec4 color; // color (rgba) | 65 | glm::vec4 color; // color (rgba) |
| 64 | float age; // age in seconds | 66 | float age; // age in seconds |
| 65 | float radius; // radius | 67 | float radius; // radius |
| 66 | float lifespan; // how long this particle stays alive (in seconds) | ||
| 67 | int emitterIndex; // which emitter created this particle? | 68 | int emitterIndex; // which emitter created this particle? |
| 68 | }; | 69 | }; |
| 69 | 70 | ||
| @@ -72,6 +73,8 @@ private: · 2 unmodified lines | |||
| 72 | glm::vec3 direction; | 73 | glm::vec3 direction; |
| 73 | bool visible; | 74 | bool visible; |
| 74 | float particleLifespan; | 75 | float particleLifespan; |
| 76 | float thrust; | ||
| 77 | float rate; | ||
| 75 | Particle baseParticle; // a non-physical particle at the emitter position | 78 | Particle baseParticle; // a non-physical particle at the emitter position |
| 76 | ParticleAttributes particleAttributes[NUM_PARTICLE_LIFE_STAGES]; // the attributes of particles emitted from this emitter | 79 | ParticleAttributes particleAttributes[NUM_PARTICLE_LIFE_STAGES]; // the attributes of particles emitted from this emitter |
| 77 | }; | 80 | }; |