History

merge upstream/master into andrew/bispinor

Andrew Meadows committed 11 years ago

Commit fc4e6e92 parents f4f219c 01dc1b029 files · +1047 −398Browse files

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

Unified · Split

interface/src/Application.cpp+13−13
@@ -256,7 +256,8 @@ bool setupEssentials(int& argc, char** argv) { · 255 unmodified lines
256256 auto speechRecognizer = DependencyManager::set<SpeechRecognizer>();
257257 #endif
258258 auto discoverabilityManager = DependencyManager::set<DiscoverabilityManager>();
259−
259+ auto sceneScriptingInterface = DependencyManager::set<SceneScriptingInterface>();
260+
260261 return true;
261262 }
262263
@@ -566,6 +567,9 @@ void Application::aboutToQuit() { · 303 unmodified lines
566567 }
567568
568569 void Application::cleanupBeforeQuit() {
570+
571+ _entities.clear(); // this will allow entity scripts to properly shutdown
572+
569573 _datagramProcessor->shutdown(); // tell the datagram processor we're shutting down, so it can short circuit
570574 _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts
571575 ScriptEngine::stopAllScripts(this); // stop all currently running global scripts
@@ -773,10 +777,6 @@ void Application::paintGL() { · 201 unmodified lines
773777 }
774778
775779 if (OculusManager::isConnected()) {
776− //Clear the color buffer to ensure that there isnt any residual color
777− //Left over from when OR was not connected.
778− glClear(GL_COLOR_BUFFER_BIT);
779−
780780 //When in mirror mode, use camera rotation. Otherwise, use body rotation
781781 if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
782782 OculusManager::display(_myCamera.getRotation(), _myCamera.getPosition(), _myCamera);
@@ -2257,7 +2257,7 @@ void Application::update(float deltaTime) { · 1474 unmodified lines
22572257 if (queryIsDue || viewIsDifferentEnough) {
22582258 _lastQueriedTime = now;
22592259
2260− if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
2260+ if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
22612261 queryOctree(NodeType::EntityServer, PacketTypeEntityQuery, _entityServerJurisdictions);
22622262 }
22632263 _lastQueriedViewFrustum = _viewFrustum;
@@ -2763,7 +2763,7 @@ void Application::updateShadowMap() { · 499 unmodified lines
27632763
27642764 const GLfloat WORLD_AMBIENT_COLOR[] = { 0.525f, 0.525f, 0.6f };
27652765 const GLfloat WORLD_DIFFUSE_COLOR[] = { 0.6f, 0.525f, 0.525f };
2766−const GLfloat WORLD_SPECULAR_COLOR[] = { 0.94f, 0.94f, 0.737f, 1.0f };
2766+const GLfloat WORLD_SPECULAR_COLOR[] = { 0.08f, 0.08f, 0.08f, 1.0f };
27672767
27682768 const glm::vec3 GLOBAL_LIGHT_COLOR = { 0.6f, 0.525f, 0.525f };
27692769
@@ -2970,7 +2970,7 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 200 unmodified lines
29702970 DependencyManager::get<GeometryCache>()->renderSphere(originSphereRadius, 15, 15, glm::vec4(1.0f, 0.0f, 0.0f, 1.0f));
29712971
29722972 // render models...
2973− if (Menu::getInstance()->isOptionChecked(MenuOption::Entities)) {
2973+ if (DependencyManager::get<SceneScriptingInterface>()->shouldRenderEntities()) {
29742974 PerformanceTimer perfTimer("entities");
29752975 PerformanceWarning warn(Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings),
29762976 "Application::displaySide() ... entities...");
@@ -2991,17 +2991,15 @@ void Application::displaySide(Camera& theCamera, bool selfAvatarOnly, RenderArgs · 14 unmodified lines
29912991 DependencyManager::get<AmbientOcclusionEffect>()->render();
29922992 }
29932993 }
2994−
2995−
2996−
2994+
29972995 bool mirrorMode = (theCamera.getMode() == CAMERA_MODE_MIRROR);
2996+
29982997 {
29992998 PerformanceTimer perfTimer("avatars");
30002999 DependencyManager::get<AvatarManager>()->renderAvatars(mirrorMode ? Avatar::MIRROR_RENDER_MODE : Avatar::NORMAL_RENDER_MODE,
3001− false, selfAvatarOnly);
3000+ false, selfAvatarOnly);
30023001 }
30033002
3004−
30053003 {
30063004 DependencyManager::get<DeferredLightingEffect>()->setAmbientLightMode(getRenderAmbientLight());
30073005 auto skyStage = DependencyManager::get<SceneScriptingInterface>()->getSkyStage();
@@ -3584,6 +3582,8 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 576 unmodified lines
35843582 scriptEngine->registerFunction(hmdInterface, "getHUDLookAtPosition2D", HMDScriptingInterface::getHUDLookAtPosition2D, 0);
35853583 scriptEngine->registerFunction(hmdInterface, "getHUDLookAtPosition3D", HMDScriptingInterface::getHUDLookAtPosition3D, 0);
35863584
3585+ scriptEngine->registerGlobalObject("Scene", DependencyManager::get<SceneScriptingInterface>().data());
3586+
35873587 #ifdef HAVE_RTMIDI
35883588 scriptEngine->registerGlobalObject("MIDI", &MIDIManager::getInstance());
35893589 #endif