more code cleanup
Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all
Unified · Split
| @@ -73,7 +73,7 @@ using namespace std; · 72 unmodified lines | |||
| 73 | static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt"; | 73 | static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt"; |
| 74 | static char STAR_CACHE_FILE[] = "cachedStars.txt"; | 74 | static char STAR_CACHE_FILE[] = "cachedStars.txt"; |
| 75 | 75 | ||
| 76 | static const bool TESTING_PARTICLE_SYSTEM = false; | 76 | static const bool TESTING_PARTICLE_SYSTEM = true; |
| 77 | 77 | ||
| 78 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | 78 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored |
| 79 | 79 | ||
| @@ -3510,23 +3510,13 @@ void Application::updateParticleSystem(float deltaTime) { · 3430 unmodified lines | |||
| 3510 | _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true); | 3510 | _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true); |
| 3511 | glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); | 3511 | glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); |
| 3512 | _particleSystem.setEmitterPosition(_coolDemoParticleEmitter, particleEmitterPosition); | 3512 | _particleSystem.setEmitterPosition(_coolDemoParticleEmitter, particleEmitterPosition); |
| 3513 | float radius = 0.01f; | ||
| 3514 | glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f); | ||
| 3515 | glm::vec3 velocity(0.0f, 0.1f, 0.0f); | 3513 | glm::vec3 velocity(0.0f, 0.1f, 0.0f); |
| 3516 | float lifespan = 100000.0f; | 3514 | float lifespan = 100000.0f; |
| 3517 | 3515 | _particleSystem.emitParticlesNow(_coolDemoParticleEmitter, 1500, velocity, lifespan); | |
| 3518 | // determine a collision sphere | ||
| 3519 | glm::vec3 collisionSpherePosition = glm::vec3( 5.0f, 0.5f, 5.0f ); | ||
| 3520 | float collisionSphereRadius = 0.5f; | ||
| 3521 | _particleSystem.setCollisionSphere(_coolDemoParticleEmitter, collisionSpherePosition, collisionSphereRadius); | ||
| 3522 | _particleSystem.emitParticlesNow(_coolDemoParticleEmitter, 1500, radius, color, velocity, lifespan); | ||
| 3523 | } | 3516 | } |
| 3524 | 3517 | ||
| 3525 | // signal that the particle system has been initialized | 3518 | // signal that the particle system has been initialized |
| 3526 | _particleSystemInitialized = true; | 3519 | _particleSystemInitialized = true; |
| 3527 | |||
| 3528 | // apply a preset color palette | ||
| 3529 | _particleSystem.setOrangeBlueColorPalette(); | ||
| 3530 | } else { | 3520 | } else { |
| 3531 | // update the particle system | 3521 | // update the particle system |
| 3532 | 3522 | ||
| @@ -3547,6 +3537,7 @@ void Application::updateParticleSystem(float deltaTime) { · 14 unmodified lines | |||
| 3547 | ParticleSystem::ParticleAttributes attributes; | 3537 | ParticleSystem::ParticleAttributes attributes; |
| 3548 | 3538 | ||
| 3549 | attributes.radius = 0.01f; | 3539 | attributes.radius = 0.01f; |
| 3540 | attributes.color = glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f); | ||
| 3550 | attributes.gravity = 0.0f + 0.05f * sinf( t * 0.52f ); | 3541 | attributes.gravity = 0.0f + 0.05f * sinf( t * 0.52f ); |
| 3551 | attributes.airFriction = 2.5 + 2.0f * sinf( t * 0.32f ); | 3542 | attributes.airFriction = 2.5 + 2.0f * sinf( t * 0.32f ); |
| 3552 | attributes.jitter = 0.05f + 0.05f * sinf( t * 0.42f ); | 3543 | attributes.jitter = 0.05f + 0.05f * sinf( t * 0.42f ); |
| @@ -3563,7 +3554,7 @@ void Application::updateParticleSystem(float deltaTime) { · 10 unmodified lines | |||
| 3563 | attributes.gravity = 0.0f; | 3554 | attributes.gravity = 0.0f; |
| 3564 | } | 3555 | } |
| 3565 | 3556 | ||
| 3566 | _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes); | 3557 | _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes); |
| 3567 | } | 3558 | } |
| 3568 | 3559 | ||
| 3569 | _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f)); | 3560 | _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f)); |