History

resolve conflicts on merge with upstream master

Stephen Birarda committed 10 years ago

Commit cb708852 parents 2aa56b5 b49342752 files · +855 −483Browse files

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

Unified · Split

interface/src/Application.cpp+25−15
@@ -88,6 +88,7 @@ · 87 unmodified lines
8888 #include <RenderDeferredTask.h>
8989 #include <ResourceCache.h>
9090 #include <SceneScriptingInterface.h>
91+#include <RecordingScriptingInterface.h>
9192 #include <ScriptCache.h>
9293 #include <SoundCache.h>
9394 #include <TextureCache.h>
@@ -128,7 +129,6 @@ · 34 unmodified lines
128129 #include "scripting/LocationScriptingInterface.h"
129130 #include "scripting/MenuScriptingInterface.h"
130131 #include "scripting/SettingsScriptingInterface.h"
131−#include "scripting/RecordingScriptingInterface.h"
132132 #include "scripting/WebWindowClass.h"
133133 #include "scripting/WindowScriptingInterface.h"
134134 #include "scripting/ControllerScriptingInterface.h"
@@ -745,6 +745,10 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 610 unmodified lines
745745 connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
746746 applicationUpdater->checkForUpdate();
747747
748+ // Assign MyAvatar to th eRecording Singleton
749+ DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(getMyAvatar());
750+
751+
748752 // Now that menu is initalized we can sync myAvatar with it's state.
749753 getMyAvatar()->updateMotionBehaviorFromMenu();
750754
@@ -839,6 +843,7 @@ void Application::cleanupBeforeQuit() { · 88 unmodified lines
839843 #ifdef HAVE_IVIEWHMD
840844 DependencyManager::get<EyeTracker>()->setEnabled(false, true);
841845 #endif
846+ DependencyManager::get<RecordingScriptingInterface>()->setControlledAvatar(nullptr);
842847
843848 AnimDebugDraw::getInstance().shutdown();
844849
@@ -1005,10 +1010,6 @@ void Application::initializeGL() { · 160 unmodified lines
10051010 connect(&_octreeProcessor, &OctreePacketProcessor::packetVersionMismatch, this, &Application::notifyPacketVersionMismatch);
10061011 _entityEditSender.initialize(_enableProcessOctreeThread);
10071012
1008− // call our timer function every second
1009− connect(&pingTimer, &QTimer::timeout, this, &Application::ping);
1010− pingTimer.start(1000);
1011−
10121013 _idleLoopStdev.reset();
10131014
10141015 // update before the first render
@@ -1232,6 +1233,19 @@ void Application::paintGL() { · 217 unmodified lines
12321233 glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
12331234 }
12341235 renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE;
1236+ } else if (_myCamera.getMode() == CAMERA_MODE_ENTITY) {
1237+ EntityItemPointer cameraEntity = _myCamera.getCameraEntityPointer();
1238+ if (cameraEntity != nullptr) {
1239+ if (isHMDMode()) {
1240+ glm::quat hmdRotation = extractRotation(myAvatar->getHMDSensorMatrix());
1241+ _myCamera.setRotation(cameraEntity->getRotation() * hmdRotation);
1242+ glm::vec3 hmdOffset = extractTranslation(myAvatar->getHMDSensorMatrix());
1243+ _myCamera.setPosition(cameraEntity->getPosition() + (hmdRotation * hmdOffset));
1244+ } else {
1245+ _myCamera.setRotation(cameraEntity->getRotation());
1246+ _myCamera.setPosition(cameraEntity->getPosition());
1247+ }
1248+ }
12351249 }
12361250 // Update camera position
12371251 if (!isHMDMode()) {
@@ -2136,13 +2150,6 @@ bool Application::acceptSnapshot(const QString& urlString) { · 898 unmodified lines
21362150 return true;
21372151 }
21382152
2139−// Every second, send a ping, if menu item is checked.
2140−void Application::ping() {
2141− if (Menu::getInstance()->isOptionChecked(MenuOption::TestPing)) {
2142− DependencyManager::get<NodeList>()->sendPingPackets();
2143− }
2144−}
2145−
21462153 void Application::idle(uint64_t now) {
21472154 if (_aboutToQuit) {
21482155 return; // bail early, nothing to do here.
@@ -2682,8 +2689,8 @@ void Application::cycleCamera() { · 533 unmodified lines
26822689 menu->setIsOptionChecked(MenuOption::ThirdPerson, false);
26832690 menu->setIsOptionChecked(MenuOption::FullscreenMirror, true);
26842691
2685− } else if (menu->isOptionChecked(MenuOption::IndependentMode)) {
2686− // do nothing if in independe mode
2692+ } else if (menu->isOptionChecked(MenuOption::IndependentMode) || menu->isOptionChecked(MenuOption::CameraEntityMode)) {
2693+ // do nothing if in independent or camera entity modes
26872694 return;
26882695 }
26892696 cameraMenuChanged(); // handle the menu change
@@ -2710,6 +2717,10 @@ void Application::cameraMenuChanged() { · 20 unmodified lines
27102717 if (_myCamera.getMode() != CAMERA_MODE_INDEPENDENT) {
27112718 _myCamera.setMode(CAMERA_MODE_INDEPENDENT);
27122719 }
2720+ } else if (Menu::getInstance()->isOptionChecked(MenuOption::CameraEntityMode)) {
2721+ if (_myCamera.getMode() != CAMERA_MODE_ENTITY) {
2722+ _myCamera.setMode(CAMERA_MODE_ENTITY);
2723+ }
27132724 }
27142725 }
27152726
@@ -3995,7 +4006,6 @@ void Application::registerScriptEngineWithApplicationServices(ScriptEngine* scri · 1279 unmodified lines
39954006 RayToOverlayIntersectionResultFromScriptValue);
39964007
39974008 scriptEngine->registerGlobalObject("Desktop", DependencyManager::get<DesktopScriptingInterface>().data());
3998− scriptEngine->registerGlobalObject("Recording", DependencyManager::get<RecordingScriptingInterface>().data());
39994009
40004010 scriptEngine->registerGlobalObject("Window", DependencyManager::get<WindowScriptingInterface>().data());
40014011 scriptEngine->registerGetterSetter("location", LocationScriptingInterface::locationGetter,