Showing the changes to interface/src/ParticleSystem.cpp (1 of 5 files). Show all
Unified · Split
| @@ -13,7 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | const float DEFAULT_PARTICLE_BOUNCE = 1.0f; |
| 15 | 15 | const float DEFAULT_PARTICLE_AIR_FRICTION = 2.0f; |
| 16 | −const float DEFAULT_PARTICLE_GRAVITY = 0.05f; | |
| 17 | 16 | |
| 18 | 17 | ParticleSystem::ParticleSystem() { |
| 19 | 18 | |
| @@ -30,7 +29,7 @@ ParticleSystem::ParticleSystem() { · 10 unmodified lines | ||
| 30 | 29 | _emitter[e].front = IDENTITY_FRONT; |
| 31 | 30 | _emitter[e].bounce = DEFAULT_PARTICLE_BOUNCE; |
| 32 | 31 | _emitter[e].airFriction = DEFAULT_PARTICLE_AIR_FRICTION; |
| 33 | − _emitter[e].gravity = DEFAULT_PARTICLE_GRAVITY; | |
| 32 | + _emitter[e].gravity = 0.0f; | |
| 34 | 33 | _emitter[e].jitter = 0.0f; |
| 35 | 34 | _emitter[e].emitterAttraction = 0.0f; |
| 36 | 35 | _emitter[e].tornadoForce = 0.0f; |
| @@ -56,11 +55,20 @@ ParticleSystem::ParticleSystem() { · 19 unmodified lines | ||
| 56 | 55 | |
| 57 | 56 | |
| 58 | 57 | int ParticleSystem::addEmitter() { |
| 58 | + | |
| 59 | + printf( "\n" ); | |
| 60 | + printf( "ParticleSystem::addEmitter\n" ); | |
| 61 | + | |
| 59 | 62 | _numEmitters ++; |
| 60 | 63 | |
| 61 | 64 | if (_numEmitters > MAX_EMITTERS) { |
| 65 | + | |
| 66 | + printf( "Oops! _numEmitters > MAX_EMITTERS... returning -1\n" ); | |
| 67 | + | |
| 62 | 68 | return -1; |
| 63 | 69 | } |
| 70 | + | |
| 71 | + printf( "ok, _numEmitters is %d,and the index of this newly added emitter is %d.\n", _numEmitters, _numEmitters-1 ); | |
| 64 | 72 | |
| 65 | 73 | return _numEmitters - 1; |
| 66 | 74 | } |
| @@ -153,13 +161,13 @@ void ParticleSystem::runSpecialEffectsTest(int e, float deltaTime) { · 86 unmodified lines | ||
| 153 | 161 | |
| 154 | 162 | _timer += deltaTime; |
| 155 | 163 | |
| 156 | − _emitter[e].gravity = 0.0f + DEFAULT_PARTICLE_GRAVITY * sinf( _timer * 0.52f ); | |
| 164 | + _emitter[e].gravity = 0.0f + 0.05f * sinf( _timer * 0.52f ); | |
| 157 | 165 | _emitter[e].airFriction = (DEFAULT_PARTICLE_AIR_FRICTION + 0.5f) + 2.0f * sinf( _timer * 0.32f ); |
| 158 | − _emitter[e].jitter = 0.05f + 0.05f * sinf( _timer * 0.42f ); | |
| 159 | − _emitter[e].emitterAttraction = 0.015f + 0.015f * cosf( _timer * 0.6f ); | |
| 160 | − _emitter[e].tornadoForce = 0.0f + 0.03f * sinf( _timer * 0.7f ); | |
| 161 | − _emitter[e].neighborAttraction = 0.1f + 0.1f * cosf( _timer * 0.8f ); | |
| 162 | − _emitter[e].neighborRepulsion = 0.2f + 0.2f * sinf( _timer * 0.4f ); | |
| 166 | + _emitter[e].jitter = 0.05f + 0.05f * sinf( _timer * 0.42f ); | |
| 167 | + _emitter[e].emitterAttraction = 0.015f + 0.015f * cosf( _timer * 0.6f ); | |
| 168 | + _emitter[e].tornadoForce = 0.0f + 0.03f * sinf( _timer * 0.7f ); | |
| 169 | + _emitter[e].neighborAttraction = 0.1f + 0.1f * cosf( _timer * 0.8f ); | |
| 170 | + _emitter[e].neighborRepulsion = 0.2f + 0.2f * sinf( _timer * 0.4f ); | |
| 163 | 171 | |
| 164 | 172 | if (_emitter[e].gravity < 0.0f) { |
| 165 | 173 | _emitter[e].gravity = 0.0f; |