Showing the changes to interface/src/ParticleSystem.cpp (1 of 1 file). Show all
Unified · Split
| @@ -22,6 +22,7 @@ ParticleSystem::ParticleSystem() { · 21 unmodified lines | |||
| 22 | _upDirection = glm::vec3(0.0f, 1.0f, 0.0f); // default | 22 | _upDirection = glm::vec3(0.0f, 1.0f, 0.0f); // default |
| 23 | 23 | ||
| 24 | for (unsigned int emitterIndex = 0; emitterIndex < MAX_EMITTERS; emitterIndex++) { | 24 | for (unsigned int emitterIndex = 0; emitterIndex < MAX_EMITTERS; emitterIndex++) { |
| 25 | |||
| 25 | _emitter[emitterIndex].position = glm::vec3(0.0f, 0.0f, 0.0f); | 26 | _emitter[emitterIndex].position = glm::vec3(0.0f, 0.0f, 0.0f); |
| 26 | _emitter[emitterIndex].direction = glm::vec3(0.0f, 1.0f, 0.0f); | 27 | _emitter[emitterIndex].direction = glm::vec3(0.0f, 1.0f, 0.0f); |
| 27 | _emitter[emitterIndex].visible = false; | 28 | _emitter[emitterIndex].visible = false; |
| @@ -346,36 +347,12 @@ void ParticleSystem::renderParticle(int p) { · 318 unmodified lines | |||
| 346 | 347 | ||
| 347 | 348 | ||
| 348 | void ParticleSystem::renderEmitter(int e, float size) { | 349 | void ParticleSystem::renderEmitter(int e, float size) { |
| 349 | |||
| 350 | /* | ||
| 351 | glm::vec3 r = _emitter[e].rotation * IDENTITY_FRONT * size; | ||
| 352 | glm::vec3 u = _emitter[e].rotation * IDENTITY_RIGHT * size; | ||
| 353 | glm::vec3 f = _emitter[e].rotation * IDENTITY_UP * size; | ||
| 354 | */ | ||
| 355 | |||
| 356 | glm::vec3 f = _emitter[e].direction; | ||
| 357 | //glm::vec3 r = glm::vec3(_emitter[e].direction.y, _emitter[e].direction.z, _emitter[e].direction.x); | ||
| 358 | //glm::vec3 u = glm::vec3(_emitter[e].direction.z, _emitter[e].direction.x, _emitter[e].direction.y); | ||
| 359 | |||
| 360 | glLineWidth(2.0f); | ||
| 361 | |||
| 362 | /* | ||
| 363 | glColor3f(0.8f, 0.4, 0.4); | ||
| 364 | glBegin(GL_LINES); | ||
| 365 | glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z); | ||
| 366 | glVertex3f(_emitter[e].position.x + r.x, _emitter[e].position.y + r.y, _emitter[e].position.z + r.z); | ||
| 367 | glEnd(); | ||
| 368 | 350 | ||
| 369 | glColor3f(0.4f, 0.8, 0.4); | 351 | glLineWidth(2.0f); |
| 370 | glBegin(GL_LINES); | ||
| 371 | glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z); | ||
| 372 | glVertex3f(_emitter[e].position.x + u.x, _emitter[e].position.y + u.y, _emitter[e].position.z + u.z); | ||
| 373 | glEnd(); | ||
| 374 | */ | ||
| 375 | glColor3f(0.4f, 0.4, 0.8); | 352 | glColor3f(0.4f, 0.4, 0.8); |
| 376 | glBegin(GL_LINES); | 353 | glBegin(GL_LINES); |
| 377 | glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z); | 354 | glVertex3f(_emitter[e].position.x, _emitter[e].position.y, _emitter[e].position.z); |
| 378 | glVertex3f(_emitter[e].position.x + f.x, _emitter[e].position.y + f.y, _emitter[e].position.z + f.z); | 355 | 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); |
| 379 | glEnd(); | 356 | glEnd(); |
| 380 | } | 357 | } |
| 381 | 358 | ||