History

added extra mode and improved particle system

Jeffrey Ventrella committed 13 years ago

Commit ad0ca741 parent 05039b44 files · +63 −50Browse files

Showing the changes to interface/src/ParticleSystem.h (1 of 4 files). Show all

Unified · Split

interface/src/ParticleSystem.h+14−11
@@ -38,21 +38,23 @@ public: · 37 unmodified lines
3838 ParticleSystem();
3939
4040 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);
4242 void simulate(float deltaTime);
4343 void killAllParticles();
4444 void render();
4545
4646 void setUpDirection(glm::vec3 upDirection) {_upDirection = upDirection;} // tell particle system which direction is up
47− void setEmitterBaseParticle (int emitterIndex, bool showing );
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
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; }
52− void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; }
53− void setEmitterDirection (int emitterIndex, glm::vec3 direction) {_emitter[emitterIndex].direction = direction; }
54− void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; }
55− void setEmitterParticleLifespan (int emitterIndex, float lifespan ) {_emitter[emitterIndex].particleLifespan = lifespan; }
47+ void setShowingEmitterBaseParticle(int emitterIndex, bool showing );
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
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; }
52+ void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; }
53+ void setEmitterDirection (int emitterIndex, glm::vec3 direction) {_emitter[emitterIndex].direction = direction; }
54+ void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; }
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; }
5658
5759 private:
5860
@@ -63,7 +65,6 @@ private: · 4 unmodified lines
6365 glm::vec4 color; // color (rgba)
6466 float age; // age in seconds
6567 float radius; // radius
66− float lifespan; // how long this particle stays alive (in seconds)
6768 int emitterIndex; // which emitter created this particle?
6869 };
6970
@@ -72,6 +73,8 @@ private: · 2 unmodified lines
7273 glm::vec3 direction;
7374 bool visible;
7475 float particleLifespan;
76+ float thrust;
77+ float rate;
7578 Particle baseParticle; // a non-physical particle at the emitter position
7679 ParticleAttributes particleAttributes[NUM_PARTICLE_LIFE_STAGES]; // the attributes of particles emitted from this emitter
7780 };

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t