History

Merge pull request #704 from Ventrella/particles

more code cleanup

Philip Rosedale committed 13 years ago

Commit e6cd90f2 parents 5edcfaa f89b1fc4 files · +79 −137Browse files

Showing the changes to interface/src/Application.cpp (1 of 4 files). Show all

Unified · Split

interface/src/Application.cpp+4−13
@@ -73,7 +73,7 @@ using namespace std; · 72 unmodified lines
7373 static char STAR_FILE[] = "http://s3-us-west-1.amazonaws.com/highfidelity/stars.txt";
7474 static char STAR_CACHE_FILE[] = "cachedStars.txt";
7575
76−static const bool TESTING_PARTICLE_SYSTEM = false;
76+static const bool TESTING_PARTICLE_SYSTEM = true;
7777
7878 static const int BANDWIDTH_METER_CLICK_MAX_DRAG_LENGTH = 6; // farther dragged clicks are ignored
7979
@@ -3510,23 +3510,13 @@ void Application::updateParticleSystem(float deltaTime) { · 3430 unmodified lines
35103510 _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true);
35113511 glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f);
35123512 _particleSystem.setEmitterPosition(_coolDemoParticleEmitter, particleEmitterPosition);
3513− float radius = 0.01f;
3514− glm::vec4 color(0.0f, 0.0f, 0.0f, 1.0f);
35153513 glm::vec3 velocity(0.0f, 0.1f, 0.0f);
35163514 float lifespan = 100000.0f;
3517−
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);
3515+ _particleSystem.emitParticlesNow(_coolDemoParticleEmitter, 1500, velocity, lifespan);
35233516 }
35243517
35253518 // signal that the particle system has been initialized
35263519 _particleSystemInitialized = true;
3527−
3528− // apply a preset color palette
3529− _particleSystem.setOrangeBlueColorPalette();
35303520 } else {
35313521 // update the particle system
35323522
@@ -3547,6 +3537,7 @@ void Application::updateParticleSystem(float deltaTime) { · 14 unmodified lines
35473537 ParticleSystem::ParticleAttributes attributes;
35483538
35493539 attributes.radius = 0.01f;
3540+ attributes.color = glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f);
35503541 attributes.gravity = 0.0f + 0.05f * sinf( t * 0.52f );
35513542 attributes.airFriction = 2.5 + 2.0f * sinf( t * 0.32f );
35523543 attributes.jitter = 0.05f + 0.05f * sinf( t * 0.42f );
@@ -3563,7 +3554,7 @@ void Application::updateParticleSystem(float deltaTime) { · 10 unmodified lines
35633554 attributes.gravity = 0.0f;
35643555 }
35653556
3566− _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes);
3557+ _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes);
35673558 }
35683559
35693560 _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t