Showing the changes to interface/src/ParticleSystem.cpp (1 of 3 files). Show all
Unified · Split
| @@ -147,7 +147,7 @@ void ParticleSystem::killParticle(int p) { · 146 unmodified lines | |||
| 147 | _numParticles --; | 147 | _numParticles --; |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | 150 | /* | |
| 151 | void ParticleSystem::setOrangeBlueColorPalette() { | 151 | void ParticleSystem::setOrangeBlueColorPalette() { |
| 152 | 152 | ||
| 153 | for (unsigned int p = 0; p < _numParticles; p++) { | 153 | for (unsigned int p = 0; p < _numParticles; p++) { |
| @@ -163,6 +163,7 @@ void ParticleSystem::setOrangeBlueColorPalette() { · 9 unmodified lines | |||
| 163 | _particle[p].color = glm::vec4(red, green, blue, alpha); | 163 | _particle[p].color = glm::vec4(red, green, blue, alpha); |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | */ | ||
| 166 | 167 | ||
| 167 | 168 | ||
| 168 | void ParticleSystem::setParticleAttributes(int emitterIndex, ParticleAttributes attributes) { | 169 | void ParticleSystem::setParticleAttributes(int emitterIndex, ParticleAttributes attributes) { |
| @@ -201,13 +202,7 @@ void ParticleSystem::updateParticle(int p, float deltaTime) { · 32 unmodified lines | |||
| 201 | int lifeStage = (int)( ageFraction * (NUM_PARTICLE_LIFE_STAGES-1) ); | 202 | int lifeStage = (int)( ageFraction * (NUM_PARTICLE_LIFE_STAGES-1) ); |
| 202 | 203 | ||
| 203 | float lifeStageFraction = ageFraction * ( NUM_PARTICLE_LIFE_STAGES - 1 ) - lifeStage; | 204 | float lifeStageFraction = ageFraction * ( NUM_PARTICLE_LIFE_STAGES - 1 ) - lifeStage; |
| 204 | 205 | ||
| 205 | /* | ||
| 206 | if ( p == 0 ) { | ||
| 207 | printf( "lifespan = %f ageFraction = %f lifeStage = %d lifeStageFraction = %f\n", _particle[p].lifespan, ageFraction, lifeStage, lifeStageFraction ); | ||
| 208 | } | ||
| 209 | */ | ||
| 210 | |||
| 211 | _particle[p].radius | 206 | _particle[p].radius |
| 212 | = _emitter[_particle[p].emitterIndex].particleAttributes[lifeStage ].radius * (1.0f - lifeStageFraction) | 207 | = _emitter[_particle[p].emitterIndex].particleAttributes[lifeStage ].radius * (1.0f - lifeStageFraction) |
| 213 | + _emitter[_particle[p].emitterIndex].particleAttributes[lifeStage+1].radius * lifeStageFraction; | 208 | + _emitter[_particle[p].emitterIndex].particleAttributes[lifeStage+1].radius * lifeStageFraction; |
| @@ -294,6 +289,7 @@ void ParticleSystem::updateParticle(int p, float deltaTime) { · 80 unmodified lines | |||
| 294 | _particle[p].age += deltaTime; | 289 | _particle[p].age += deltaTime; |
| 295 | } | 290 | } |
| 296 | 291 | ||
| 292 | /* | ||
| 297 | void ParticleSystem::setCollisionSphere(int e, glm::vec3 position, float radius) { | 293 | void ParticleSystem::setCollisionSphere(int e, glm::vec3 position, float radius) { |
| 298 | 294 | ||
| 299 | int lifeStage = 0; | 295 | int lifeStage = 0; |
| @@ -302,6 +298,7 @@ void ParticleSystem::setCollisionSphere(int e, glm::vec3 position, float radius) · 2 unmodified lines | |||
| 302 | _emitter[e].particleAttributes[lifeStage].collisionSpherePosition = position; | 298 | _emitter[e].particleAttributes[lifeStage].collisionSpherePosition = position; |
| 303 | _emitter[e].particleAttributes[lifeStage].collisionSphereRadius = radius; | 299 | _emitter[e].particleAttributes[lifeStage].collisionSphereRadius = radius; |
| 304 | } | 300 | } |
| 301 | */ | ||
| 305 | 302 | ||
| 306 | void ParticleSystem::setEmitterBaseParticle(int emitterIndex, bool showing ) { | 303 | void ParticleSystem::setEmitterBaseParticle(int emitterIndex, bool showing ) { |
| 307 | 304 | ||