Showing the changes to interface/src/ParticleSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -16,6 +16,7 @@ const float DEFAULT_PARTICLE_BOUNCE = 1.0f; · 15 unmodified lines | ||
| 16 | 16 | const float DEFAULT_PARTICLE_AIR_FRICTION = 2.0f; |
| 17 | 17 | const float DEFAULT_PARTICLE_LIFESPAN = 1.0f; |
| 18 | 18 | const int DEFAULT_PARTICLE_SPHERE_RESOLUTION = 6; |
| 19 | +const float DEFAULT_EMITTER_RENDER_LENGTH = 0.2f; | |
| 19 | 20 | |
| 20 | 21 | ParticleSystem::ParticleSystem() { |
| 21 | 22 | |
| @@ -325,7 +326,7 @@ void ParticleSystem::render() { · 303 unmodified lines | ||
| 325 | 326 | } |
| 326 | 327 | |
| 327 | 328 | if (_emitter[e].visible) { |
| 328 | − renderEmitter(e, 0.2f); | |
| 329 | + renderEmitter(e, DEFAULT_EMITTER_RENDER_LENGTH); | |
| 329 | 330 | } |
| 330 | 331 | }; |
| 331 | 332 | |
| @@ -447,14 +448,14 @@ void ParticleSystem::renderParticle(int p) { · 115 unmodified lines | ||
| 447 | 448 | } |
| 448 | 449 | } |
| 449 | 450 | |
| 450 | − | |
| 451 | 451 | void ParticleSystem::renderEmitter(int e, float size) { |
| 452 | 452 | |
| 453 | − glLineWidth(2.0f); | |
| 453 | + glm::vec3 v = _emitter[e].direction * size; | |
| 454 | + | |
| 454 | 455 | glColor3f(0.4f, 0.4, 0.8); |
| 455 | 456 | glBegin(GL_LINES); |
| 456 | 457 | glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z); |
| 457 | − glVertex3f(_emitter[e].position.x + _emitter[e].direction.x, _emitter[e].position.y + _emitter[e].direction.y, _emitter[e].position.z + _emitter[e].direction.z); | |
| 458 | + glVertex3f(_emitter[e].position.x + v.x, _emitter[e].position.y + v.y, _emitter[e].position.z + v.z); | |
| 458 | 459 | glEnd(); |
| 459 | 460 | } |
| 460 | 461 | |