diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 6d49ab3406..ddf483f3ea 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -95,8 +95,6 @@ Application::Application(int& argc, char** argv, timeval &startup_time) : _frameCount(0), _fps(120.0f), _justStarted(true), - _particleSystemInitialized(false), - _coolDemoParticleEmitter(-1), _wantToKillLocalVoxels(false), _audioScope(256, 200, true), _mouseX(0), @@ -1971,10 +1969,6 @@ void Application::update(float deltaTime) { _audio.setLastVelocity(_myAvatar.getVelocity()); _audio.eventuallyAnalyzePing(); #endif - - if (Menu::getInstance()->isOptionChecked(MenuOption::ParticleSystem)) { - updateParticleSystem(deltaTime); - } } void Application::updateAvatar(float deltaTime) { @@ -2449,12 +2443,6 @@ void Application::displaySide(Camera& whichCamera) { _myAvatar.renderScreenTint(SCREEN_TINT_AFTER_AVATARS, whichCamera); - if (Menu::getInstance()->isOptionChecked(MenuOption::ParticleSystem)) { - if (_particleSystemInitialized) { - _particleSystem.render(); - } - } - // Render the world box if (!Menu::getInstance()->isOptionChecked(MenuOption::Mirror) && Menu::getInstance()->isOptionChecked(MenuOption::Stats)) { renderWorldBox(); @@ -3379,80 +3367,4 @@ void* Application::networkReceive(void* args) { pthread_exit(0); } return NULL; -} - -void Application::updateParticleSystem(float deltaTime) { - - if (!_particleSystemInitialized) { - - const int LIFESPAN_IN_SECONDS = 100000.0f; - const float EMIT_RATE_IN_SECONDS = 10000.0; - // create a stable test emitter and spit out a bunch of particles - _coolDemoParticleEmitter = _particleSystem.addEmitter(); - - if (_coolDemoParticleEmitter != -1) { - - _particleSystem.setShowingEmitter(_coolDemoParticleEmitter, true); - glm::vec3 particleEmitterPosition = glm::vec3(5.0f, 1.0f, 5.0f); - - _particleSystem.setEmitterPosition (_coolDemoParticleEmitter, particleEmitterPosition); - _particleSystem.setEmitterParticleLifespan(_coolDemoParticleEmitter, LIFESPAN_IN_SECONDS); - _particleSystem.setEmitterThrust (_coolDemoParticleEmitter, 0.0f); - _particleSystem.setEmitterRate (_coolDemoParticleEmitter, EMIT_RATE_IN_SECONDS); // to emit a pile o particles now - } - - // signal that the particle system has been initialized - _particleSystemInitialized = true; - } else { - // update the particle system - - static bool emitting = true; - static float effectsTimer = 0.0f; - effectsTimer += deltaTime; - - if (_coolDemoParticleEmitter != -1) { - - _particleSystem.setEmitterDirection(_coolDemoParticleEmitter, glm::vec3(0.0f, 1.0f, 0.0f)); - - ParticleSystem::ParticleAttributes attributes; - - attributes.radius = 0.01f; - attributes.color = glm::vec4( 1.0f, 1.0f, 1.0f, 1.0f); - attributes.gravity = 0.0f + 0.05f * sinf( effectsTimer * 0.52f ); - attributes.airFriction = 2.5 + 2.0f * sinf( effectsTimer * 0.32f ); - attributes.jitter = 0.05f + 0.05f * sinf( effectsTimer * 0.42f ); - attributes.emitterAttraction = 0.015f + 0.015f * cosf( effectsTimer * 0.6f ); - attributes.tornadoForce = 0.0f + 0.03f * sinf( effectsTimer * 0.7f ); - attributes.neighborAttraction = 0.1f + 0.1f * cosf( effectsTimer * 0.8f ); - attributes.neighborRepulsion = 0.2f + 0.2f * sinf( effectsTimer * 0.4f ); - attributes.bounce = 1.0f; - attributes.usingCollisionSphere = true; - attributes.collisionSpherePosition = glm::vec3( 5.0f, 0.5f, 5.0f ); - attributes.collisionSphereRadius = 0.5f; - attributes.usingCollisionPlane = true; - attributes.collisionPlanePosition = glm::vec3( 5.0f, 0.0f, 5.0f ); - attributes.collisionPlaneNormal = glm::vec3( 0.0f, 1.0f, 0.0f ); - - if (attributes.gravity < 0.0f) { - attributes.gravity = 0.0f; - } - - _particleSystem.setParticleAttributes(_coolDemoParticleEmitter, attributes); - } - - _particleSystem.setUpDirection(glm::vec3(0.0f, 1.0f, 0.0f)); - _particleSystem.simulate(deltaTime); - - const float EMIT_RATE_IN_SECONDS = 0.0; - - if (_coolDemoParticleEmitter != -1) { - if (emitting) { - _particleSystem.setEmitterRate(_coolDemoParticleEmitter, EMIT_RATE_IN_SECONDS); // stop emitter - emitting = false; - } - } - } -} - - - +} \ No newline at end of file diff --git a/interface/src/Application.h b/interface/src/Application.h index 5140785696..c3bb593ed4 100644 --- a/interface/src/Application.h +++ b/interface/src/Application.h @@ -32,7 +32,6 @@ #include "Environment.h" #include "GLCanvas.h" #include "PacketHeaders.h" -#include "ParticleSystem.h" #include "SerialInterface.h" #include "Stars.h" #include "Swatch.h" @@ -255,8 +254,6 @@ private: timeval _timerStart, _timerEnd; timeval _lastTimeUpdated; bool _justStarted; - bool _particleSystemInitialized; - int _coolDemoParticleEmitter; Stars _stars; @@ -336,7 +333,6 @@ private: GeometryCache _geometryCache; TextureCache _textureCache; - ParticleSystem _particleSystem; GlowEffect _glowEffect; #ifndef _WIN32 diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 99eded577c..e4f029b984 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -153,7 +153,6 @@ Menu::Menu() : addCheckableActionToQMenuAndActionHash(renderMenu, MenuOption::FrameTimer); addCheckableActionToQMenuAndActionHash(renderMenu, MenuOption::LookAtVectors); addCheckableActionToQMenuAndActionHash(renderMenu, MenuOption::LookAtIndicator, 0, true); - addCheckableActionToQMenuAndActionHash(renderMenu, MenuOption::ParticleSystem); addCheckableActionToQMenuAndActionHash(renderMenu, MenuOption::FirstPerson, Qt::Key_P, true); addActionToQMenuAndActionHash(renderMenu, diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 49b73c88e8..64433e1f5e 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -159,7 +159,6 @@ namespace MenuOption { const QString Monochrome = "Monochrome"; const QString Oscilloscope = "Audio Oscilloscope"; const QString Pair = "Pair"; - const QString ParticleSystem = "Particle System"; const QString PasteVoxels = "Paste Voxels"; const QString PipelineWarnings = "Show Render Pipeline Warnings"; const QString Preferences = "Preferences...";