Showing the changes to interface/src/ParticleSystem.h (1 of 4 files). Show all
Unified · Split
| @@ -10,9 +10,8 @@ · 9 unmodified lines | |||
| 10 | 10 | ||
| 11 | #include <glm/gtc/quaternion.hpp> | 11 | #include <glm/gtc/quaternion.hpp> |
| 12 | 12 | ||
| 13 | const int MAX_PARTICLES = 5000; | 13 | const int MAX_PARTICLES = 5000; |
| 14 | const int MAX_EMITTERS = 100; | 14 | const int MAX_EMITTERS = 100; |
| 15 | const int NUM_PARTICLE_LIFE_STAGES = 4; // each equal time-division of the particle's life can have different attributes | ||
| 16 | 15 | ||
| 17 | enum ParticleRenderStyle | 16 | enum ParticleRenderStyle |
| 18 | { | 17 | { |
| @@ -22,6 +21,19 @@ enum ParticleRenderStyle · 3 unmodified lines | |||
| 22 | NUM_PARTICLE_RENDER_STYLES | 21 | NUM_PARTICLE_RENDER_STYLES |
| 23 | }; | 22 | }; |
| 24 | 23 | ||
| 24 | |||
| 25 | enum ParticleLifeStage | ||
| 26 | { | ||
| 27 | PARTICLE_LIFESTAGE_0 = 0, | ||
| 28 | PARTICLE_LIFESTAGE_1, | ||
| 29 | PARTICLE_LIFESTAGE_2, | ||
| 30 | PARTICLE_LIFESTAGE_3, | ||
| 31 | NUM_PARTICLE_LIFE_STAGES | ||
| 32 | }; | ||
| 33 | |||
| 34 | |||
| 35 | |||
| 36 | |||
| 25 | class ParticleSystem { | 37 | class ParticleSystem { |
| 26 | public: | 38 | public: |
| 27 | 39 | ||
| @@ -51,7 +63,7 @@ public: · 23 unmodified lines | |||
| 51 | 63 | ||
| 52 | void setUpDirection(glm::vec3 upDirection) {_upDirection = upDirection;} // tell particle system which direction is up | 64 | void setUpDirection(glm::vec3 upDirection) {_upDirection = upDirection;} // tell particle system which direction is up |
| 53 | void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles | 65 | void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles |
| 54 | void setParticleAttributes (int emitterIndex, int lifeStage, ParticleAttributes attributes); // set attributes for this life stage of particles | 66 | void setParticleAttributes (int emitterIndex, ParticleLifeStage lifeStage, ParticleAttributes attributes); // set attributes for this life stage |
| 55 | void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; } | 67 | void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; } |
| 56 | void setEmitterParticleResolution (int emitterIndex, int resolution ) {_emitter[emitterIndex].particleResolution = resolution; } | 68 | void setEmitterParticleResolution (int emitterIndex, int resolution ) {_emitter[emitterIndex].particleResolution = resolution; } |
| 57 | void setEmitterDirection (int emitterIndex, glm::vec3 direction ) {_emitter[emitterIndex].direction = direction; } | 69 | void setEmitterDirection (int emitterIndex, glm::vec3 direction ) {_emitter[emitterIndex].direction = direction; } |