History

cleanup

Jeffrey Ventrella committed 13 years ago

Commit df32c181 parent 4b07d653 files · +27 −17Browse files

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

Unified · Split

interface/src/ParticleSystem.h+4−7
@@ -21,7 +21,6 @@ enum ParticleRenderStyle · 20 unmodified lines
21 NUM_PARTICLE_RENDER_STYLES21 NUM_PARTICLE_RENDER_STYLES
22};22};
23 23
24
25enum ColorModulationStyle24enum ColorModulationStyle
26{25{
27 COLOR_MODULATION_STYLE_NULL = -1,26 COLOR_MODULATION_STYLE_NULL = -1,
@@ -30,7 +29,6 @@ enum ColorModulationStyle · 2 unmodified lines
30 NUM_COLOR_MODULATION_STYLES29 NUM_COLOR_MODULATION_STYLES
31};30};
32 31
33
34enum ParticleLifeStage32enum ParticleLifeStage
35{33{
36 PARTICLE_LIFESTAGE_0 = 0,34 PARTICLE_LIFESTAGE_0 = 0,
@@ -40,9 +38,6 @@ enum ParticleLifeStage · 3 unmodified lines
40 NUM_PARTICLE_LIFE_STAGES38 NUM_PARTICLE_LIFE_STAGES
41};39};
42 40
43
44
45
46class ParticleSystem {41class ParticleSystem {
47public:42public:
48 43
@@ -80,7 +75,7 @@ public: · 31 unmodified lines
80 void setParticleAttributesToDefault(ParticleAttributes * attributes); // set these attributes to their default values75 void setParticleAttributesToDefault(ParticleAttributes * attributes); // set these attributes to their default values
81 void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles76 void setParticleAttributes (int emitterIndex, ParticleAttributes attributes); // set attributes for whole life of particles
82 void setParticleAttributes (int emitterIndex, ParticleLifeStage lifeStage, ParticleAttributes attributes); // set attributes for this life stage77 void setParticleAttributes (int emitterIndex, ParticleLifeStage lifeStage, ParticleAttributes attributes); // set attributes for this life stage
83 void setEmitterPosition (int emitterIndex, glm::vec3 position ) {_emitter[emitterIndex].position = position; } 78 void setEmitterPosition (int emitterIndex, glm::vec3 position );
84 void setEmitterParticleResolution (int emitterIndex, int resolution ) {_emitter[emitterIndex].particleResolution = resolution; } 79 void setEmitterParticleResolution (int emitterIndex, int resolution ) {_emitter[emitterIndex].particleResolution = resolution; }
85 void setEmitterDirection (int emitterIndex, glm::vec3 direction ) {_emitter[emitterIndex].direction = direction; } 80 void setEmitterDirection (int emitterIndex, glm::vec3 direction ) {_emitter[emitterIndex].direction = direction; }
86 void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; } 81 void setShowingEmitter (int emitterIndex, bool showing ) {_emitter[emitterIndex].visible = showing; }
@@ -105,11 +100,13 @@ private: · 18 unmodified lines
105 100
106 struct Emitter {101 struct Emitter {
107 glm::vec3 position; // the position of the emitter in world coordinates102 glm::vec3 position; // the position of the emitter in world coordinates
103 glm::vec3 previousPosition; // the position of the emitter in the previous time step
108 glm::vec3 direction; // a normalized vector used as an axis for particle emission and other effects104 glm::vec3 direction; // a normalized vector used as an axis for particle emission and other effects
109 bool visible; // whether or not a line is shown indicating the emitter (indicating its direction)105 bool visible; // whether or not a line is shown indicating the emitter (indicating its direction)
110 float particleLifespan; // how long the particle shall live, in seconds106 float particleLifespan; // how long the particle shall live, in seconds
111 int particleResolution; // for sphere-based particles107 int particleResolution; // for sphere-based particles
112 float emitReserve; // baed on 'rate', this is the number of particles that need to be emitted at a given time step108 float emitReserve; // baed on 'rate', this is the number of particles that need to be emitted at a given time step
109 int numParticlesEmittedThisTime; //the integer number of particles to emit at the preent time step
113 float thrust; // the initial velocity upon emitting along the emitter direction 110 float thrust; // the initial velocity upon emitting along the emitter direction
114 float rate; // currently, how many particles emitted during a simulation time step111 float rate; // currently, how many particles emitted during a simulation time step
115 bool showingBaseParticle; // if true, a copy of particle 0 is shown on the emitter position112 bool showingBaseParticle; // if true, a copy of particle 0 is shown on the emitter position
@@ -127,7 +124,7 @@ private: · 11 unmodified lines
127 124
128 // private methods125 // private methods
129 void updateParticle(int index, float deltaTime);126 void updateParticle(int index, float deltaTime);
130 void createParticle(int e);127 void createParticle(int e, float timeFraction);
131 void killParticle(int p);128 void killParticle(int p);
132 void renderEmitter(int emitterIndex, float size);129 void renderEmitter(int emitterIndex, float size);
133 void renderParticle(int p);130 void renderParticle(int p);

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