History

resolve conflicts on merge with upstream master

Stephen Birarda committed 12 years ago

Commit f389e3a2 parents de46364 df51d2680 files · +2736 −1045Browse files

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

Unified · Split

interface/src/Application.cpp+51−27
@@ -570,6 +570,16 @@ void Application::paintGL() { · 569 unmodified lines
570570 bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
571571 PerformanceWarning warn(showWarnings, "Application::paintGL()");
572572
573+ const bool glowEnabled = Menu::getInstance()->isOptionChecked(MenuOption::EnableGlowEffect);
574+
575+ // Set the desired FBO texture size. If it hasn't changed, this does nothing.
576+ // Otherwise, it must rebuild the FBOs
577+ if (OculusManager::isConnected()) {
578+ _textureCache.setFrameBufferSize(OculusManager::getRenderTargetSize());
579+ } else {
580+ _textureCache.setFrameBufferSize(_glWidget->size());
581+ }
582+
573583 glEnable(GL_LINE_SMOOTH);
574584
575585 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
@@ -578,28 +588,16 @@ void Application::paintGL() { · 2 unmodified lines
578588 _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
579589
580590 } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
591+ //Note, the camera distance is set in Camera::setMode() so we dont have to do it here.
581592 _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing
582593 _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition());
583− _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
594+ _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation());
584595
585596 } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
586597 _myCamera.setTightness(0.0f);
587− glm::vec3 eyePosition = _myAvatar->getHead()->calculateAverageEyePosition();
588− float headHeight = eyePosition.y - _myAvatar->getPosition().y;
589598 _myCamera.setDistance(MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
590− _myCamera.setTargetPosition(_myAvatar->getPosition() + glm::vec3(0, headHeight + (_raiseMirror * _myAvatar->getScale()), 0));
591599 _myCamera.setTargetRotation(_myAvatar->getWorldAlignedOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));
592− }
593−
594− if (OculusManager::isConnected()) {
595− // Oculus in third person causes nausea, so only allow it if option is checked in dev menu
596− if (!Menu::getInstance()->isOptionChecked(MenuOption::AllowOculusCameraModeChange) || _myCamera.getMode() == CAMERA_MODE_FIRST_PERSON) {
597− _myCamera.setDistance(0.0f);
598− _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition());
599− _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation());
600− }
601− _myCamera.setUpShift(0.0f);
602− _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing
600+ _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition());
603601 }
604602
605603 // Update camera position
@@ -634,16 +632,32 @@ void Application::paintGL() { · 28 unmodified lines
634632 updateShadowMap();
635633 }
636634
635+ //If we aren't using the glow shader, we have to clear the color and depth buffer
636+ if (!glowEnabled) {
637+ glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
638+ }
639+
637640 if (OculusManager::isConnected()) {
638− OculusManager::display(whichCamera);
641+ //When in mirror mode, use camera rotation. Otherwise, use body rotation
642+ if (whichCamera.getMode() == CAMERA_MODE_MIRROR) {
643+ OculusManager::display(whichCamera.getRotation(), whichCamera.getPosition(), whichCamera);
644+ } else {
645+ OculusManager::display(_myAvatar->getWorldAlignedOrientation(), whichCamera.getPosition(), whichCamera);
646+ }
639647
640648 } else if (TV3DManager::isConnected()) {
641− _glowEffect.prepare();
649+ if (glowEnabled) {
650+ _glowEffect.prepare();
651+ }
642652 TV3DManager::display(whichCamera);
643− _glowEffect.render();
653+ if (glowEnabled) {
654+ _glowEffect.render();
655+ }
644656
645657 } else {
646− _glowEffect.prepare();
658+ if (glowEnabled) {
659+ _glowEffect.prepare();
660+ }
647661
648662 glMatrixMode(GL_MODELVIEW);
649663 glPushMatrix();
@@ -651,7 +665,9 @@ void Application::paintGL() { · 1 unmodified line
651665 displaySide(whichCamera);
652666 glPopMatrix();
653667
654− _glowEffect.render();
668+ if (glowEnabled) {
669+ _glowEffect.render();
670+ }
655671
656672 if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
657673 renderRearViewMirror(_mirrorViewRect);
@@ -2171,7 +2187,8 @@ int Application::sendNackPackets() { · 1513 unmodified lines
21712187 OctreeSceneStats& stats = _octreeServerSceneStats[nodeUUID];
21722188
21732189 // make copy of missing sequence numbers from stats
2174− const QSet<OCTREE_PACKET_SEQUENCE> missingSequenceNumbers = stats.getMissingSequenceNumbers();
2190+ const QSet<OCTREE_PACKET_SEQUENCE> missingSequenceNumbers =
2191+ stats.getIncomingOctreeSequenceNumberStats().getMissingSet();
21752192
21762193 _octreeSceneStatsLock.unlock();
21772194
@@ -3141,9 +3158,7 @@ void Application::resetSensors() { · 963 unmodified lines
31413158 _faceshift.reset();
31423159 _visage.reset();
31433160
3144− if (OculusManager::isConnected()) {
3145− OculusManager::reset();
3146− }
3161+ OculusManager::reset();
31473162
31483163 _prioVR.reset();
31493164
@@ -3295,6 +3310,10 @@ void Application::nodeKilled(SharedNodePointer node) { · 145 unmodified lines
32953310 _particleEditSender.nodeKilled(node);
32963311 _modelEditSender.nodeKilled(node);
32973312
3313+ if (node->getType() == NodeType::AudioMixer) {
3314+ QMetaObject::invokeMethod(&_audio, "resetIncomingMixedAudioSequenceNumberStats");
3315+ }
3316+
32983317 if (node->getType() == NodeType::VoxelServer) {
32993318 QUuid nodeUUID = node->getUUID();
33003319 // see if this is the first we've heard of this node...
@@ -3619,6 +3638,9 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 318 unmodified lines
36193638 // when the application is about to quit, stop our script engine so it unwinds properly
36203639 connect(this, SIGNAL(aboutToQuit()), scriptEngine, SLOT(stop()));
36213640
3641+ NodeList* nodeList = NodeList::getInstance();
3642+ connect(nodeList, &NodeList::nodeKilled, scriptEngine, &ScriptEngine::nodeKilled);
3643+
36223644 scriptEngine->moveToThread(workerThread);
36233645
36243646 // Starts an event loop, and emits workerThread->started()
@@ -3634,7 +3656,8 @@ ScriptEngine* Application::loadScript(const QString& scriptName, bool loadScript · 9 unmodified lines
36343656 }
36353657
36363658 void Application::scriptFinished(const QString& scriptName) {
3637− QHash<QString, ScriptEngine*>::iterator it = _scriptEnginesHash.find(scriptName);
3659+ const QString& scriptURLString = QUrl(scriptName).toString();
3660+ QHash<QString, ScriptEngine*>::iterator it = _scriptEnginesHash.find(scriptURLString);
36383661 if (it != _scriptEnginesHash.end()) {
36393662 _scriptEnginesHash.erase(it);
36403663 _runningScriptsWidget->scriptStopped(scriptName);
@@ -3656,8 +3679,9 @@ void Application::stopAllScripts(bool restart) { · 15 unmodified lines
36563679 }
36573680
36583681 void Application::stopScript(const QString &scriptName) {
3659− if (_scriptEnginesHash.contains(scriptName)) {
3660− _scriptEnginesHash.value(scriptName)->stop();
3682+ const QString& scriptURLString = QUrl(scriptName).toString();
3683+ if (_scriptEnginesHash.contains(scriptURLString)) {
3684+ _scriptEnginesHash.value(scriptURLString)->stop();
36613685 qDebug() << "stopping script..." << scriptName;
36623686 }
36633687 }

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