Showing the changes to interface/src/ParticleSystem.cpp (1 of 2 files). Show all
Unified · Split
| @@ -80,9 +80,7 @@ void ParticleSystem::simulate(float deltaTime) { · 79 unmodified lines | ||
| 80 | 80 | assert(_emitter[e].rate >= 0); |
| 81 | 81 | |
| 82 | 82 | _emitter[e].emitReserve += _emitter[e].rate * deltaTime; |
| 83 | − | |
| 84 | 83 | _emitter[e].numParticlesEmittedThisTime = (int)_emitter[e].emitReserve; |
| 85 | − | |
| 86 | 84 | _emitter[e].emitReserve -= _emitter[e].numParticlesEmittedThisTime; |
| 87 | 85 | |
| 88 | 86 | for (int p = 0; p < _emitter[e].numParticlesEmittedThisTime; p++) { |
| @@ -114,8 +112,8 @@ void ParticleSystem::createParticle(int e, float timeFraction) { · 25 unmodified lines | ||
| 114 | 112 | _particle[p].age = 0.0f; |
| 115 | 113 | _particle[p].velocity = _emitter[e].direction * _emitter[e].thrust; |
| 116 | 114 | _particle[p].position = _emitter[e].previousPosition + timeFraction * (_emitter[e].position - _emitter[e].previousPosition); |
| 117 | − _particle[p].radius = _emitter[e].particleAttributes[0].radius; | |
| 118 | − _particle[p].color = _emitter[e].particleAttributes[0].color; | |
| 115 | + _particle[p].radius = _emitter[e].particleAttributes[PARTICLE_LIFESTAGE_0].radius; | |
| 116 | + _particle[p].color = _emitter[e].particleAttributes[PARTICLE_LIFESTAGE_0].color; | |
| 119 | 117 | _particle[p].previousParticle = NULL_PARTICLE; |
| 120 | 118 | |
| 121 | 119 | if (_particle[_emitter[e].currentParticle].alive) { |
| @@ -142,6 +140,8 @@ void ParticleSystem::killParticle(int p) { · 20 unmodified lines | ||
| 142 | 140 | _particle[p].velocity = glm::vec3(0.0f, 0.0f, 0.0f); |
| 143 | 141 | _particle[p].age = 0.0f; |
| 144 | 142 | _particle[p].emitterIndex = NULL_PARTICLE; |
| 143 | + _particle[p].color = glm::vec4(0.0f, 0.0f, 0.0f, 0.0f); | |
| 144 | + _particle[p].radius = 0.0f; | |
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | |