Showing the changes to interface/src/Application.cpp (1 of 40 files). Show all
Unified · Split
| @@ -81,9 +81,10 @@ · 80 unmodified lines | ||
| 81 | 81 | #include "scripting/LocationScriptingInterface.h" |
| 82 | 82 | |
| 83 | 83 | #include "ui/InfoView.h" |
| 84 | +#include "ui/OAuthWebViewHandler.h" | |
| 84 | 85 | #include "ui/Snapshot.h" |
| 85 | −#include "ui/TextRenderer.h" | |
| 86 | 86 | #include "ui/Stats.h" |
| 87 | +#include "ui/TextRenderer.h" | |
| 87 | 88 | |
| 88 | 89 | using namespace std; |
| 89 | 90 | |
| @@ -361,12 +362,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) : · 271 unmodified lines | ||
| 361 | 362 | QMutexLocker locker(&_settingsMutex); |
| 362 | 363 | _previousScriptLocation = _settings->value("LastScriptLocation", QVariant("")).toString(); |
| 363 | 364 | } |
| 364 | − | |
| 365 | + | |
| 365 | 366 | connect(_window, &MainWindow::windowGeometryChanged, |
| 366 | 367 | _runningScriptsWidget, &RunningScriptsWidget::setBoundary); |
| 367 | − | |
| 368 | − //When -url in command line, teleport to location | |
| 369 | − urlGoTo(argc, constArgv); | |
| 368 | + | |
| 369 | + //When -url in command line, teleport to location | |
| 370 | + urlGoTo(argc, constArgv); | |
| 371 | + | |
| 372 | + // call the OAuthWebviewHandler static getter so that its instance lives in our thread | |
| 373 | + OAuthWebViewHandler::getInstance(); | |
| 374 | + // make sure the High Fidelity root CA is in our list of trusted certs | |
| 375 | + OAuthWebViewHandler::addHighFidelityRootCAToSSLConfig(); | |
| 370 | 376 | } |
| 371 | 377 | |
| 372 | 378 | Application::~Application() { |
| @@ -555,41 +561,42 @@ void Application::paintGL() { · 182 unmodified lines | ||
| 555 | 561 | _myCamera.setTargetPosition(_myAvatar->getHead()->calculateAverageEyePosition()); |
| 556 | 562 | _myCamera.setTargetRotation(_myAvatar->getHead()->getCameraOrientation()); |
| 557 | 563 | |
| 558 | − glm::vec3 planeNormal = _myCamera.getTargetRotation() * IDENTITY_FRONT; | |
| 559 | − const float BASE_PUSHBACK_RADIUS = 0.25f; | |
| 560 | − float pushbackRadius = _myCamera.getNearClip() + _myAvatar->getScale() * BASE_PUSHBACK_RADIUS; | |
| 561 | − glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - pushbackRadius); | |
| 562 | − | |
| 563 | − // push camera out of any intersecting avatars | |
| 564 | − foreach (const AvatarSharedPointer& avatarData, _avatarManager.getAvatarHash()) { | |
| 565 | − Avatar* avatar = static_cast<Avatar*>(avatarData.data()); | |
| 566 | − if (avatar->isMyAvatar()) { | |
| 567 | − continue; | |
| 568 | − } | |
| 569 | − if (glm::distance(avatar->getPosition(), _myCamera.getTargetPosition()) > | |
| 570 | − avatar->getBoundingRadius() + pushbackRadius) { | |
| 571 | − continue; | |
| 572 | − } | |
| 573 | − float angle = angleBetween(avatar->getPosition() - _myCamera.getTargetPosition(), planeNormal); | |
| 574 | − if (angle > PI_OVER_TWO) { | |
| 575 | − continue; | |
| 576 | − } | |
| 577 | − float scale = 1.0f - angle / PI_OVER_TWO; | |
| 578 | − scale = qMin(1.0f, scale * 2.5f); | |
| 579 | − static CollisionList collisions(64); | |
| 580 | − collisions.clear(); | |
| 581 | − if (!avatar->findPlaneCollisions(plane, collisions)) { | |
| 582 | − continue; | |
| 583 | − } | |
| 584 | − for (int i = 0; i < collisions.size(); i++) { | |
| 585 | − pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration) * scale); | |
| 564 | + if (Menu::getInstance()->isOptionChecked(MenuOption::CollideWithAvatars)) { | |
| 565 | + glm::vec3 planeNormal = _myCamera.getTargetRotation() * IDENTITY_FRONT; | |
| 566 | + const float BASE_PUSHBACK_RADIUS = 0.25f; | |
| 567 | + float pushbackRadius = _myCamera.getNearClip() + _myAvatar->getScale() * BASE_PUSHBACK_RADIUS; | |
| 568 | + glm::vec4 plane(planeNormal, -glm::dot(planeNormal, _myCamera.getTargetPosition()) - pushbackRadius); | |
| 569 | + | |
| 570 | + // push camera out of any intersecting avatars | |
| 571 | + foreach (const AvatarSharedPointer& avatarData, _avatarManager.getAvatarHash()) { | |
| 572 | + Avatar* avatar = static_cast<Avatar*>(avatarData.data()); | |
| 573 | + if (avatar->isMyAvatar()) { | |
| 574 | + continue; | |
| 575 | + } | |
| 576 | + if (glm::distance(avatar->getPosition(), _myCamera.getTargetPosition()) > | |
| 577 | + avatar->getBoundingRadius() + pushbackRadius) { | |
| 578 | + continue; | |
| 579 | + } | |
| 580 | + float angle = angleBetween(avatar->getPosition() - _myCamera.getTargetPosition(), planeNormal); | |
| 581 | + if (angle > PI_OVER_TWO) { | |
| 582 | + continue; | |
| 583 | + } | |
| 584 | + float scale = 1.0f - angle / PI_OVER_TWO; | |
| 585 | + scale = qMin(1.0f, scale * 2.5f); | |
| 586 | + static CollisionList collisions(64); | |
| 587 | + collisions.clear(); | |
| 588 | + if (!avatar->findPlaneCollisions(plane, collisions)) { | |
| 589 | + continue; | |
| 590 | + } | |
| 591 | + for (int i = 0; i < collisions.size(); i++) { | |
| 592 | + pushback = qMax(pushback, glm::length(collisions.getCollision(i)->_penetration) * scale); | |
| 593 | + } | |
| 586 | 594 | } |
| 595 | + const float MAX_PUSHBACK = 0.35f; | |
| 596 | + pushback = qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()); | |
| 597 | + const float BASE_PUSHBACK_FOCAL_LENGTH = 0.5f; | |
| 598 | + pushbackFocalLength = BASE_PUSHBACK_FOCAL_LENGTH * _myAvatar->getScale(); | |
| 587 | 599 | } |
| 588 | − const float MAX_PUSHBACK = 0.35f; | |
| 589 | − pushback = qMin(pushback, MAX_PUSHBACK * _myAvatar->getScale()); | |
| 590 | − const float BASE_PUSHBACK_FOCAL_LENGTH = 0.5f; | |
| 591 | − pushbackFocalLength = BASE_PUSHBACK_FOCAL_LENGTH * _myAvatar->getScale(); | |
| 592 | − | |
| 593 | 600 | } else if (_myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) { |
| 594 | 601 | _myCamera.setTightness(0.0f); // Camera is directly connected to head without smoothing |
| 595 | 602 | _myCamera.setTargetPosition(_myAvatar->getUprightHeadPosition()); |
| @@ -3124,7 +3131,7 @@ void Application::updateWindowTitle(){ · 2528 unmodified lines | ||
| 3124 | 3131 | QString buildVersion = " (build " + applicationVersion() + ")"; |
| 3125 | 3132 | NodeList* nodeList = NodeList::getInstance(); |
| 3126 | 3133 | |
| 3127 | − QString username = AccountManager::getInstance().getUsername(); | |
| 3134 | + QString username = AccountManager::getInstance().getAccountInfo().getUsername(); | |
| 3128 | 3135 | QString title = QString() + (!username.isEmpty() ? username + " " : QString()) + nodeList->getSessionUUID().toString() |
| 3129 | 3136 | + " @ " + nodeList->getDomainHandler().getHostname() + buildVersion; |
| 3130 | 3137 | qDebug("Application title set to: %s", title.toStdString().c_str()); |
| @@ -3150,6 +3157,9 @@ void Application::domainChanged(const QString& domainHostname) { · 19 unmodified lines | ||
| 3150 | 3157 | |
| 3151 | 3158 | // reset the voxels renderer |
| 3152 | 3159 | _voxels.killLocalVoxels(); |
| 3160 | + | |
| 3161 | + // reset the auth URL for OAuth web view handler | |
| 3162 | + OAuthWebViewHandler::getInstance().clearLastAuthorizationURL(); | |
| 3153 | 3163 | } |
| 3154 | 3164 | |
| 3155 | 3165 | void Application::connectedToDomain(const QString& hostname) { |