History

cleanup

Jeffrey Ventrella committed 13 years ago

Commit 65278601 parent 937574a1 file · +5 −4Browse files

Showing the changes to interface/src/ParticleSystem.cpp (1 of 1 file). Show all

Unified · Split

interface/src/ParticleSystem.cpp+5−4
@@ -16,6 +16,7 @@ const float DEFAULT_PARTICLE_BOUNCE = 1.0f; · 15 unmodified lines
16const float DEFAULT_PARTICLE_AIR_FRICTION = 2.0f;16const float DEFAULT_PARTICLE_AIR_FRICTION = 2.0f;
17const float DEFAULT_PARTICLE_LIFESPAN = 1.0f;17const float DEFAULT_PARTICLE_LIFESPAN = 1.0f;
18const int DEFAULT_PARTICLE_SPHERE_RESOLUTION = 6;18const int DEFAULT_PARTICLE_SPHERE_RESOLUTION = 6;
19const float DEFAULT_EMITTER_RENDER_LENGTH = 0.2f;
19 20
20ParticleSystem::ParticleSystem() {21ParticleSystem::ParticleSystem() {
21 22
@@ -325,7 +326,7 @@ void ParticleSystem::render() { · 303 unmodified lines
325 }326 }
326 327
327 if (_emitter[e].visible) {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
451void ParticleSystem::renderEmitter(int e, float size) {451void ParticleSystem::renderEmitter(int e, float size) {
452 452
453 glLineWidth(2.0f);453 glm::vec3 v = _emitter[e].direction * size;
454
454 glColor3f(0.4f, 0.4, 0.8);455 glColor3f(0.4f, 0.4, 0.8);
455 glBegin(GL_LINES);456 glBegin(GL_LINES);
456 glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z);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 glEnd();459 glEnd();
459}460}
460 461