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
1616 const float DEFAULT_PARTICLE_AIR_FRICTION = 2.0f;
1717 const float DEFAULT_PARTICLE_LIFESPAN = 1.0f;
1818 const int DEFAULT_PARTICLE_SPHERE_RESOLUTION = 6;
19+const float DEFAULT_EMITTER_RENDER_LENGTH = 0.2f;
1920
2021 ParticleSystem::ParticleSystem() {
2122
@@ -325,7 +326,7 @@ void ParticleSystem::render() { · 303 unmodified lines
325326 }
326327
327328 if (_emitter[e].visible) {
328− renderEmitter(e, 0.2f);
329+ renderEmitter(e, DEFAULT_EMITTER_RENDER_LENGTH);
329330 }
330331 };
331332
@@ -447,14 +448,14 @@ void ParticleSystem::renderParticle(int p) { · 115 unmodified lines
447448 }
448449 }
449450
450−
451451 void ParticleSystem::renderEmitter(int e, float size) {
452452
453− glLineWidth(2.0f);
453+ glm::vec3 v = _emitter[e].direction * size;
454+
454455 glColor3f(0.4f, 0.4, 0.8);
455456 glBegin(GL_LINES);
456457 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);
458459 glEnd();
459460 }
460461