Showing the changes to interface/src/Application.cpp (1 of 9 files). Show all
Unified · Split
| @@ -71,10 +71,10 @@ · 70 unmodified lines | |||
| 71 | using namespace std; | 71 | using namespace std; |
| 72 | 72 | ||
| 73 | // Starfield information | 73 | // Starfield information |
| 74 | static char STAR_FILE[] = "https://s3-us-west-1.amazonaws.com/highfidelity/stars.txt"; | 74 | static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt"; |
| 75 | static char STAR_CACHE_FILE[] = "cachedStars.txt"; | 75 | static char STAR_CACHE_FILE[] = "cachedStars.txt"; |
| 76 | 76 | ||
| 77 | static const bool TESTING_PARTICLE_SYSTEM = false; | 77 | static const bool TESTING_PARTICLE_SYSTEM = true; |
| 78 | 78 | ||
| 79 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored | 79 | static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored |
| 80 | 80 | ||
| @@ -3537,23 +3537,13 @@ void Application::updateParticleSystem(float deltaTime) { · 3456 unmodified lines | |||
| 3537 | _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true); | 3537 | _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true); |
| 3538 | glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); | 3538 | glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); |
| 3539 | _particleSystem.setEmitterPosition(_coolDemoParticleEmitter, particleEmitterPosition); | 3539 | _particleSystem.setEmitterPosition(_coolDemoParticleEmitter, particleEmitterPosition); |
| 3540 | float radius = 0.01f; | ||
| 3541 | glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f); | ||
| 3542 | glm::vec3 velocity(0.0f, 0.1f, 0.0f); | 3540 | glm::vec3 velocity(0.0f, 0.1f, 0.0f); |
| 3543 | float lifespan = 100000.0f; | 3541 | float lifespan = 100000.0f; |
| 3544 | 3542 | _particleSystem.emitParticlesNow(_coolDemoParticleEmitter, 1500, velocity, lifespan); | |
| 3545 | // determine a collision sphere | ||
| 3546 | glm::vec3 collisionSpherePosition = glm::vec3( 5.0f, 0.5f, 5.0f ); | ||
| 3547 | float collisionSphereRadius = 0.5f; | ||
| 3548 | _particleSystem.setCollisionSphere(_coolDemoParticleEmitter, collisionSpherePosition, collisionSphereRadius); | ||
| 3549 | _particleSystem.emitParticlesNow(_coolDemoParticleEmitter, 1500, radius, color, velocity, lifespan); | ||
| 3550 | } | 3543 | } |
| 3551 | 3544 | ||
| 3552 | // signal that the particle system has been initialized | 3545 | // signal that the particle system has been initialized |
| 3553 | _particleSystemInitialized = true; | 3546 | _particleSystemInitialized = true; |
| 3554 | |||
| 3555 | // apply a preset color palette | ||
| 3556 | _particleSystem.setOrangeBlueColorPalette(); | ||
| 3557 | } else { | 3547 | } else { |
| 3558 | // update the particle system | 3548 | // update the particle system |
| 3559 | 3549 | ||
| @@ -3574,6 +3564,7 @@ void Application::updateParticleSystem(float deltaTime) { · 14 unmodified lines | |||
| 3574 | ParticleSystem::ParticleAttributes attributes; | 3564 | ParticleSystem::ParticleAttributes attributes; |
| 3575 | 3565 | ||
| 3576 | attributes.radius = 0.01f; | 3566 | attributes.radius = 0.01f; |
| 3567 | attributes.color = glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f); | ||
| 3577 | attributes.gravity = 0.0f + 0.05f * sinf( t * 0.52f ); | 3568 | attributes.gravity = 0.0f + 0.05f * sinf( t * 0.52f ); |
| 3578 | attributes.airFriction = 2.5 + 2.0f * sinf( t * 0.32f ); | 3569 | attributes.airFriction = 2.5 + 2.0f * sinf( t * 0.32f ); |
| 3579 | attributes.jitter = 0.05f + 0.05f * sinf( t * 0.42f ); | 3570 | attributes.jitter = 0.05f + 0.05f * sinf( t * 0.42f ); |
| @@ -3590,7 +3581,7 @@ void Application::updateParticleSystem(float deltaTime) { · 10 unmodified lines | |||
| 3590 | attributes.gravity = 0.0f; | 3581 | attributes.gravity = 0.0f; |
| 3591 | } | 3582 | } |
| 3592 | 3583 | ||
| 3593 | _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes); | 3584 | _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes); |
| 3594 | } | 3585 | } |
| 3595 | 3586 | ||
| 3596 | _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f)); | 3587 | _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f)); |