History

Merge branch 'master' into tony/remove-joint-states

Anthony J. Thibault committed 10 years ago

Commit f120e102 parents 14189ac b12bc96100 files · +3427 −1962Browse files

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

Unified · Split

interface/src/Application.cpp+85−91
@@ -679,7 +679,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 678 unmodified lines
679679 }));
680680
681681 userInputMapper->registerDevice(_applicationStateDevice);
682−
682+
683683 // Setup the keyboardMouseDevice and the user input mapper with the default bindings
684684 userInputMapper->registerDevice(_keyboardMouseDevice->getInputDevice());
685685
@@ -749,7 +749,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 63 unmodified lines
749749 _oldHandRightClick[0] = false;
750750 _oldHandLeftClick[1] = false;
751751 _oldHandRightClick[1] = false;
752−
752+
753753 auto applicationUpdater = DependencyManager::get<AutoUpdater>();
754754 connect(applicationUpdater.data(), &AutoUpdater::newVersionIsAvailable, dialogsManager.data(), &DialogsManager::showUpdateDialog);
755755 applicationUpdater->checkForUpdate();
@@ -768,7 +768,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 12 unmodified lines
768768
769769 // If the user clicks an an entity, we will check that it's an unlocked web entity, and if so, set the focus to it
770770 auto entityScriptingInterface = DependencyManager::get<EntityScriptingInterface>();
771− connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
771+ connect(entityScriptingInterface.data(), &EntityScriptingInterface::clickDownOnEntity,
772772 [this, entityScriptingInterface](const EntityItemID& entityItemID, const MouseEvent& event) {
773773 if (_keyboardFocusedItem != entityItemID) {
774774 _keyboardFocusedItem = UNKNOWN_ENTITY_ID;
@@ -817,7 +817,7 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 42 unmodified lines
817817 });
818818
819819 // If the user clicks somewhere where there is NO entity at all, we will release focus
820− connect(getEntities(), &EntityTreeRenderer::mousePressOffEntity,
820+ connect(getEntities(), &EntityTreeRenderer::mousePressOffEntity,
821821 [=](const RayToEntityIntersectionResult& entityItemID, const QMouseEvent* event, unsigned int deviceId) {
822822 _keyboardFocusedItem = UNKNOWN_ENTITY_ID;
823823 if (_keyboardFocusHighlight) {
@@ -826,17 +826,17 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer) : · 2 unmodified lines
826826 });
827827
828828 connect(this, &Application::applicationStateChanged, this, &Application::activeChanged);
829−
829+
830830 qCDebug(interfaceapp, "Startup time: %4.2f seconds.", (double)startupTimer.elapsed() / 1000.0);
831831 }
832832
833833 void Application::aboutToQuit() {
834834 emit beforeAboutToQuit();
835−
835+
836836 getActiveDisplayPlugin()->deactivate();
837−
837+
838838 _aboutToQuit = true;
839−
839+
840840 cleanupBeforeQuit();
841841 }
842842
@@ -860,16 +860,16 @@ void Application::cleanupBeforeQuit() { · 17 unmodified lines
860860 _keyboardFocusHighlight = nullptr;
861861
862862 _entities.clear(); // this will allow entity scripts to properly shutdown
863−
863+
864864 auto nodeList = DependencyManager::get<NodeList>();
865−
865+
866866 // send the domain a disconnect packet, force stoppage of domain-server check-ins
867867 nodeList->getDomainHandler().disconnect();
868868 nodeList->setIsShuttingDown(true);
869−
869+
870870 // tell the packet receiver we're shutting down, so it can drop packets
871871 nodeList->getPacketReceiver().setShouldDropPackets(true);
872−
872+
873873 _entities.shutdown(); // tell the entities system we're shutting down, so it will stop running scripts
874874 ScriptEngine::stopAllScripts(this); // stop all currently running global scripts
875875
@@ -947,7 +947,7 @@ Application::~Application() { · 71 unmodified lines
947947 DependencyManager::destroy<GeometryCache>();
948948 DependencyManager::destroy<ScriptCache>();
949949 DependencyManager::destroy<SoundCache>();
950−
950+
951951 // cleanup the AssetClient thread
952952 QThread* assetThread = DependencyManager::get<AssetClient>()->thread();
953953 DependencyManager::destroy<AssetClient>();
@@ -955,14 +955,14 @@ Application::~Application() { · 1 unmodified line
955955 assetThread->wait();
956956
957957 QThread* nodeThread = DependencyManager::get<NodeList>()->thread();
958−
958+
959959 // remove the NodeList from the DependencyManager
960960 DependencyManager::destroy<NodeList>();
961961
962962 // ask the node thread to quit and wait until it is done
963963 nodeThread->quit();
964964 nodeThread->wait();
965−
965+
966966 Leapmotion::destroy();
967967 RealSense::destroy();
968968
@@ -1058,7 +1058,7 @@ void Application::initializeUi() { · 89 unmodified lines
10581058 resizeGL();
10591059 }
10601060 });
1061−
1061+
10621062 // This will set up the input plugins UI
10631063 _activeInputPlugins.clear();
10641064 foreach(auto inputPlugin, PluginManager::getInstance()->getInputPlugins()) {
@@ -1100,8 +1100,8 @@ void Application::paintGL() { · 35 unmodified lines
11001100 return;
11011101 }
11021102
1103− // Some plugins process message events, potentially leading to
1104− // re-entering a paint event. don't allow further processing if this
1103+ // Some plugins process message events, potentially leading to
1104+ // re-entering a paint event. don't allow further processing if this
11051105 // happens
11061106 if (_inPaint) {
11071107 return;
@@ -1137,17 +1137,17 @@ void Application::paintGL() { · 29 unmodified lines
11371137 if (Menu::getInstance()->isOptionChecked(MenuOption::Mirror)) {
11381138 PerformanceTimer perfTimer("Mirror");
11391139 auto primaryFbo = DependencyManager::get<FramebufferCache>()->getPrimaryFramebufferDepthColor();
1140−
1140+
11411141 renderArgs._renderMode = RenderArgs::MIRROR_RENDER_MODE;
11421142 renderRearViewMirror(&renderArgs, _mirrorViewRect);
11431143 renderArgs._renderMode = RenderArgs::DEFAULT_RENDER_MODE;
1144−
1144+
11451145 {
11461146 float ratio = ((float)QApplication::desktop()->windowHandle()->devicePixelRatio() * getRenderResolutionScale());
11471147 // Flip the src and destination rect horizontally to do the mirror
11481148 auto mirrorRect = glm::ivec4(0, 0, _mirrorViewRect.width() * ratio, _mirrorViewRect.height() * ratio);
11491149 auto mirrorRectDest = glm::ivec4(mirrorRect.z, mirrorRect.y, mirrorRect.x, mirrorRect.w);
1150−
1150+
11511151 auto selfieFbo = DependencyManager::get<FramebufferCache>()->getSelfieFramebuffer();
11521152 gpu::doInBatch(renderArgs._context, [=](gpu::Batch& batch) {
11531153 batch.setFramebuffer(selfieFbo);
@@ -1169,9 +1169,9 @@ void Application::paintGL() { · 15 unmodified lines
11691169
11701170 {
11711171 PerformanceTimer perfTimer("CameraUpdates");
1172−
1172+
11731173 auto myAvatar = getMyAvatar();
1174−
1174+
11751175 myAvatar->startCapture();
11761176 if (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON || _myCamera.getMode() == CAMERA_MODE_THIRD_PERSON) {
11771177 Menu::getInstance()->setIsOptionChecked(MenuOption::FirstPerson, myAvatar->getBoomLength() <= MyAvatar::ZOOM_MIN);
@@ -1208,26 +1208,26 @@ void Application::paintGL() { · 30 unmodified lines
12081208 * (myAvatar->getScale() * myAvatar->getBoomLength() * glm::vec3(0.0f, 0.0f, 1.0f)));
12091209 } else {
12101210 _myCamera.setPosition(myAvatar->getDefaultEyePosition()
1211− + myAvatar->getOrientation()
1211+ + myAvatar->getOrientation()
12121212 * (myAvatar->getScale() * myAvatar->getBoomLength() * glm::vec3(0.0f, 0.0f, 1.0f)));
12131213 }
12141214 }
12151215 } else if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
12161216 if (isHMDMode()) {
12171217 glm::quat hmdRotation = extractRotation(myAvatar->getHMDSensorMatrix());
1218− _myCamera.setRotation(myAvatar->getWorldAlignedOrientation()
1218+ _myCamera.setRotation(myAvatar->getWorldAlignedOrientation()
12191219 * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)) * hmdRotation);
12201220 glm::vec3 hmdOffset = extractTranslation(myAvatar->getHMDSensorMatrix());
1221− _myCamera.setPosition(myAvatar->getDefaultEyePosition()
1222− + glm::vec3(0, _raiseMirror * myAvatar->getScale(), 0)
1221+ _myCamera.setPosition(myAvatar->getDefaultEyePosition()
1222+ + glm::vec3(0, _raiseMirror * myAvatar->getScale(), 0)
12231223 + (myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) *
1224− glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror
1224+ glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror
12251225 + (myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f))) * hmdOffset);
12261226 } else {
1227− _myCamera.setRotation(myAvatar->getWorldAlignedOrientation()
1227+ _myCamera.setRotation(myAvatar->getWorldAlignedOrientation()
12281228 * glm::quat(glm::vec3(0.0f, PI + _rotateMirror, 0.0f)));
1229− _myCamera.setPosition(myAvatar->getDefaultEyePosition()
1230− + glm::vec3(0, _raiseMirror * myAvatar->getScale(), 0)
1229+ _myCamera.setPosition(myAvatar->getDefaultEyePosition()
1230+ + glm::vec3(0, _raiseMirror * myAvatar->getScale(), 0)
12311231 + (myAvatar->getOrientation() * glm::quat(glm::vec3(0.0f, _rotateMirror, 0.0f))) *
12321232 glm::vec3(0.0f, 0.0f, -1.0f) * MIRROR_FULLSCREEN_DISTANCE * _scaleMirror);
12331233 }
@@ -1246,7 +1246,7 @@ void Application::paintGL() { · 12 unmodified lines
12461246 }
12471247 }
12481248 }
1249− // Update camera position
1249+ // Update camera position
12501250 if (!isHMDMode()) {
12511251 _myCamera.update(1.0f / _fps);
12521252 }
@@ -1264,12 +1264,12 @@ void Application::paintGL() { · 11 unmodified lines
12641264 if (displayPlugin->isStereo()) {
12651265 // Stereo modes will typically have a larger projection matrix overall,
12661266 // so we ask for the 'mono' projection matrix, which for stereo and HMD
1267− // plugins will imply the combined projection for both eyes.
1267+ // plugins will imply the combined projection for both eyes.
12681268 //
12691269 // This is properly implemented for the Oculus plugins, but for OpenVR
1270− // and Stereo displays I'm not sure how to get / calculate it, so we're
1271− // just relying on the left FOV in each case and hoping that the
1272− // overall culling margin of error doesn't cause popping in the
1270+ // and Stereo displays I'm not sure how to get / calculate it, so we're
1271+ // just relying on the left FOV in each case and hoping that the
1272+ // overall culling margin of error doesn't cause popping in the
12731273 // right eye. There are FIXMEs in the relevant plugins
12741274 _myCamera.setProjection(displayPlugin->getProjection(Mono, _myCamera.getProjection()));
12751275 renderArgs._context->enableStereo(true);
@@ -1279,11 +1279,11 @@ void Application::paintGL() { · 3 unmodified lines
12791279 auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();
12801280 float IPDScale = hmdInterface->getIPDScale();
12811281 // FIXME we probably don't need to set the projection matrix every frame,
1282− // only when the display plugin changes (or in non-HMD modes when the user
1282+ // only when the display plugin changes (or in non-HMD modes when the user
12831283 // changes the FOV manually, which right now I don't think they can.
12841284 for_each_eye([&](Eye eye) {
1285− // For providing the stereo eye views, the HMD head pose has already been
1286− // applied to the avatar, so we need to get the difference between the head
1285+ // For providing the stereo eye views, the HMD head pose has already been
1286+ // applied to the avatar, so we need to get the difference between the head
12871287 // pose applied to the avatar and the per eye pose, and use THAT as
12881288 // the per-eye stereo matrix adjustment.
12891289 mat4 eyeToHead = displayPlugin->getEyeToHeadTransform(eye);
@@ -1293,10 +1293,10 @@ void Application::paintGL() { · 3 unmodified lines
12931293 mat4 eyeOffsetTransform = glm::translate(mat4(), eyeOffset * -1.0f * IPDScale);
12941294 eyeOffsets[eye] = eyeOffsetTransform;
12951295
1296− // Tell the plugin what pose we're using to render. In this case we're just using the
1297− // unmodified head pose because the only plugin that cares (the Oculus plugin) uses it
1298− // for rotational timewarp. If we move to support positonal timewarp, we need to
1299− // ensure this contains the full pose composed with the eye offsets.
1296+ // Tell the plugin what pose we're using to render. In this case we're just using the
1297+ // unmodified head pose because the only plugin that cares (the Oculus plugin) uses it
1298+ // for rotational timewarp. If we move to support positonal timewarp, we need to
1299+ // ensure this contains the full pose composed with the eye offsets.
13001300 mat4 headPose = displayPlugin->getHeadPose();
13011301 displayPlugin->setEyeRenderPose(eye, headPose);
13021302
@@ -1343,7 +1343,7 @@ void Application::paintGL() { · 40 unmodified lines
13431343 PerformanceTimer perfTimer("pluginOutput");
13441344 auto primaryFbo = framebufferCache->getPrimaryFramebuffer();
13451345 GLuint finalTexture = gpu::GLBackend::getTextureID(primaryFbo->getRenderBuffer(0));
1346− // Ensure the rendering context commands are completed when rendering
1346+ // Ensure the rendering context commands are completed when rendering
13471347 GLsync sync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
13481348 // Ensure the sync object is flushed to the driver thread before releasing the context
13491349 // CRITICAL for the mac driver apparently.
@@ -1394,7 +1394,7 @@ void Application::audioMuteToggled() { · 44 unmodified lines
13941394 }
13951395
13961396 void Application::faceTrackerMuteToggled() {
1397−
1397+
13981398 QAction* muteAction = Menu::getInstance()->getActionForOption(MenuOption::MuteFaceTracking);
13991399 Q_CHECK_PTR(muteAction);
14001400 bool isMuted = getSelectedFaceTracker()->isMuted();
@@ -1427,7 +1427,7 @@ void Application::resizeGL() { · 26 unmodified lines
14271427 if (nullptr == _displayPlugin) {
14281428 return;
14291429 }
1430−
1430+
14311431 auto displayPlugin = getActiveDisplayPlugin();
14321432 // Set the desired FBO texture size. If it hasn't changed, this does nothing.
14331433 // Otherwise, it must rebuild the FBOs
@@ -1437,14 +1437,14 @@ void Application::resizeGL() { · 3 unmodified lines
14371437 _renderResolution = renderSize;
14381438 DependencyManager::get<FramebufferCache>()->setFrameBufferSize(fromGlm(renderSize));
14391439 }
1440−
1440+
14411441 // FIXME the aspect ratio for stereo displays is incorrect based on this.
14421442 float aspectRatio = displayPlugin->getRecommendedAspectRatio();
14431443 _myCamera.setProjection(glm::perspective(glm::radians(_fieldOfView.get()), aspectRatio,
14441444 DEFAULT_NEAR_CLIP, DEFAULT_FAR_CLIP));
14451445 // Possible change in aspect ratio
14461446 loadViewFrustum(_myCamera, _viewFrustum);
1447−
1447+
14481448 auto offscreenUi = DependencyManager::get<OffscreenUi>();
14491449 auto uiSize = displayPlugin->getRecommendedUiSize();
14501450 // Bit of a hack since there's no device pixel ratio change event I can find.
@@ -1613,7 +1613,7 @@ void Application::keyPressEvent(QKeyEvent* event) { · 162 unmodified lines
16131613 if (isMeta) {
16141614 auto offscreenUi = DependencyManager::get<OffscreenUi>();
16151615 offscreenUi->load("Browser.qml");
1616− }
1616+ }
16171617 break;
16181618
16191619 case Qt::Key_X:
@@ -2109,7 +2109,7 @@ void Application::wheelEvent(QWheelEvent* event) { · 489 unmodified lines
21092109 if (_controllerScriptingInterface->isWheelCaptured()) {
21102110 return;
21112111 }
2112−
2112+
21132113 if (Menu::getInstance()->isOptionChecked(KeyboardMouseDevice::NAME)) {
21142114 _keyboardMouseDevice->wheelEvent(event);
21152115 }
@@ -2227,7 +2227,7 @@ void Application::idle(uint64_t now) { · 111 unmodified lines
22272227 _idleLoopStdev.reset();
22282228 }
22292229 }
2230−
2230+
22312231 _overlayConductor.update(secondsSinceLastUpdate);
22322232
22332233 // check for any requested background downloads.
@@ -2481,7 +2481,7 @@ void Application::init() { · 247 unmodified lines
24812481 DependencyManager::get<AddressManager>()->loadSettings(addressLookupString);
24822482
24832483 qCDebug(interfaceapp) << "Loaded settings";
2484−
2484+
24852485 Leapmotion::init();
24862486 RealSense::init();
24872487
@@ -2539,7 +2539,7 @@ void Application::setAvatarUpdateThreading(bool isThreaded) { · 51 unmodified lines
25392539 if (_avatarUpdate && (_avatarUpdate->isThreaded() == isThreaded)) {
25402540 return;
25412541 }
2542−
2542+
25432543 auto myAvatar = getMyAvatar();
25442544 if (_avatarUpdate) {
25452545 _avatarUpdate->terminate(); // Must be before we shutdown anim graph.
@@ -2750,7 +2750,7 @@ void Application::updateDialogs(float deltaTime) { · 204 unmodified lines
27502750 if(audioStatsDialog) {
27512751 audioStatsDialog->update();
27522752 }
2753−
2753+
27542754 // Update bandwidth dialog, if any
27552755 BandwidthDialog* bandwidthDialog = dialogsManager->getBandwidthDialog();
27562756 if (bandwidthDialog) {
@@ -2828,14 +2828,8 @@ void Application::update(float deltaTime) { · 71 unmodified lines
28282828 myAvatar->setDriveKeys(TRANSLATE_Y, userInputMapper->getActionState(controller::Action::TRANSLATE_Y));
28292829 myAvatar->setDriveKeys(TRANSLATE_X, userInputMapper->getActionState(controller::Action::TRANSLATE_X));
28302830 if (deltaTime > FLT_EPSILON) {
2831− // For rotations what we really want are meausures of "angles per second" (in order to prevent
2832− // fps-dependent spin rates) so we need to scale the units of the controller contribution.
2833− // (TODO?: maybe we should similarly scale ALL action state info, or change the expected behavior
2834− // controllers to provide a delta_per_second value rather than a raw delta.)
2835− const float EXPECTED_FRAME_RATE = 60.0f;
2836− float timeFactor = EXPECTED_FRAME_RATE * deltaTime;
2837− myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH) / timeFactor);
2838− myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW) / timeFactor);
2831+ myAvatar->setDriveKeys(PITCH, -1.0f * userInputMapper->getActionState(controller::Action::PITCH));
2832+ myAvatar->setDriveKeys(YAW, -1.0f * userInputMapper->getActionState(controller::Action::YAW));
28392833 myAvatar->setDriveKeys(STEP_YAW, -1.0f * userInputMapper->getActionState(controller::Action::STEP_YAW));
28402834 }
28412835 }
@@ -2892,7 +2886,7 @@ void Application::update(float deltaTime) { · 50 unmodified lines
28922886 _entities.getTree()->withWriteLock([&] {
28932887 _physicsEngine->stepSimulation();
28942888 });
2895−
2889+
28962890 if (_physicsEngine->hasOutgoingChanges()) {
28972891 _entities.getTree()->withWriteLock([&] {
28982892 _entitySimulation.handleOutgoingChanges(_physicsEngine->getOutgoingChanges(), _physicsEngine->getSessionID());
@@ -3021,10 +3015,10 @@ int Application::sendNackPackets() { · 122 unmodified lines
30213015 foreach(const OCTREE_PACKET_SEQUENCE& missingNumber, missingSequenceNumbers) {
30223016 nackPacketList->writePrimitive(missingNumber);
30233017 }
3024−
3018+
30253019 if (nackPacketList->getNumPackets()) {
30263020 packetsSent += nackPacketList->getNumPackets();
3027−
3021+
30283022 // send the packet list
30293023 nodeList->sendPacketList(std::move(nackPacketList), *node);
30303024 }
@@ -3632,7 +3626,7 @@ void Application::renderRearViewMirror(RenderArgs* renderArgs, const QRect& regi · 601 unmodified lines
36323626 float fov = MIRROR_FIELD_OF_VIEW;
36333627
36343628 auto myAvatar = getMyAvatar();
3635−
3629+
36363630 // bool eyeRelativeCamera = false;
36373631 if (billboard) {
36383632 fov = BILLBOARD_FIELD_OF_VIEW; // degees
@@ -3840,7 +3834,7 @@ void Application::nodeKilled(SharedNodePointer node) { · 201 unmodified lines
38403834 Menu::getInstance()->getActionForOption(MenuOption::UploadAsset)->setEnabled(false);
38413835 }
38423836 }
3843−
3837+
38443838 void Application::trackIncomingOctreePacket(NLPacket& packet, SharedNodePointer sendingNode, bool wasStatsPacket) {
38453839
38463840 // Attempt to identify the sender from its address.
@@ -3865,7 +3859,7 @@ int Application::processOctreeStats(NLPacket& packet, SharedNodePointer sendingN · 18 unmodified lines
38653859 int statsMessageLength = 0;
38663860
38673861 const QUuid& nodeUUID = sendingNode->getUUID();
3868−
3862+
38693863 // now that we know the node ID, let's add these stats to the stats for that node...
38703864 _octreeServerSceneStats.withWriteLock([&] {
38713865 OctreeSceneStats& octreeStats = _octreeServerSceneStats[nodeUUID];
@@ -4066,7 +4060,7 @@ bool Application::acceptURL(const QString& urlString, bool defaultUpload) { · 194 unmodified lines
40664060 Qt::AutoConnection, Q_ARG(const QString&, urlString));
40674061 return true;
40684062 }
4069−
4063+
40704064 QUrl url(urlString);
40714065 QHashIterator<QString, AcceptURLMethod> i(_acceptedExtensions);
40724066 QString lowerPath = url.path().toLower();
@@ -4077,7 +4071,7 @@ bool Application::acceptURL(const QString& urlString, bool defaultUpload) { · 4 unmodified lines
40774071 return (this->*method)(urlString);
40784072 }
40794073 }
4080−
4074+
40814075 return defaultUpload && askToUploadAsset(urlString);
40824076 }
40834077
@@ -4159,10 +4153,10 @@ bool Application::askToUploadAsset(const QString& filename) { · 75 unmodified lines
41594153 QString("You don't have upload rights on that domain.\n\n"));
41604154 return false;
41614155 }
4162−
4156+
41634157 QUrl url { filename };
41644158 if (auto upload = DependencyManager::get<AssetClient>()->createUpload(url.toLocalFile())) {
4165−
4159+
41664160 QMessageBox messageBox;
41674161 messageBox.setWindowTitle("Asset upload");
41684162 messageBox.setText("You are about to upload the following file to the asset server:\n" +
@@ -4170,19 +4164,19 @@ bool Application::askToUploadAsset(const QString& filename) { · 1 unmodified line
41704164 messageBox.setInformativeText("Do you want to continue?");
41714165 messageBox.setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
41724166 messageBox.setDefaultButton(QMessageBox::Ok);
4173−
4167+
41744168 // Option to drop model in world for models
41754169 if (filename.endsWith(FBX_EXTENSION) || filename.endsWith(OBJ_EXTENSION)) {
41764170 auto checkBox = new QCheckBox(&messageBox);
41774171 checkBox->setText("Add to scene");
41784172 messageBox.setCheckBox(checkBox);
41794173 }
4180−
4174+
41814175 if (messageBox.exec() != QMessageBox::Ok) {
41824176 upload->deleteLater();
41834177 return false;
41844178 }
4185−
4179+
41864180 // connect to the finished signal so we know when the AssetUpload is done
41874181 if (messageBox.checkBox() && (messageBox.checkBox()->checkState() == Qt::Checked)) {
41884182 // Custom behavior for models
@@ -4192,12 +4186,12 @@ bool Application::askToUploadAsset(const QString& filename) { · 3 unmodified lines
41924186 &AssetUploadDialogFactory::getInstance(),
41934187 &AssetUploadDialogFactory::handleUploadFinished);
41944188 }
4195−
4189+
41964190 // start the upload now
41974191 upload->start();
41984192 return true;
41994193 }
4200−
4194+
42014195 // display a message box with the error
42024196 QMessageBox::warning(_window, "Failed Upload", QString("Failed to upload %1.\n\n").arg(filename));
42034197 return false;
@@ -4205,20 +4199,20 @@ bool Application::askToUploadAsset(const QString& filename) { · 1 unmodified line
42054199
42064200 void Application::modelUploadFinished(AssetUpload* upload, const QString& hash) {
42074201 auto filename = QFileInfo(upload->getFilename()).fileName();
4208−
4202+
42094203 if ((upload->getError() == AssetUpload::NoError) &&
42104204 (filename.endsWith(FBX_EXTENSION) || filename.endsWith(OBJ_EXTENSION))) {
4211−
4205+
42124206 auto entities = DependencyManager::get<EntityScriptingInterface>();
4213−
4207+
42144208 EntityItemProperties properties;
42154209 properties.setType(EntityTypes::Model);
42164210 properties.setModelURL(QString("%1:%2.%3").arg(URL_SCHEME_ATP).arg(hash).arg(upload->getExtension()));
42174211 properties.setPosition(_myCamera.getPosition() + _myCamera.getOrientation() * Vectors::FRONT * 2.0f);
42184212 properties.setName(QUrl(upload->getFilename()).fileName());
4219−
4213+
42204214 entities->addEntity(properties);
4221−
4215+
42224216 upload->deleteLater();
42234217 } else {
42244218 AssetUploadDialogFactory::getInstance().handleUploadFinished(upload, hash);
@@ -4499,7 +4493,7 @@ void Application::takeSnapshot() { · 274 unmodified lines
44994493 _snapshotShareDialog = new SnapshotShareDialog(fileName, _glWidget);
45004494 }
45014495 _snapshotShareDialog->show();
4502−
4496+
45034497 }
45044498
45054499 float Application::getRenderResolutionScale() const {
@@ -4744,8 +4738,8 @@ void Application::updateDisplayMode() { · 238 unmodified lines
47444738 return;
47454739 }
47464740
4747− // Some plugins *cough* Oculus *cough* process message events from inside their
4748− // display function, and we don't want to change the display plugin underneath
4741+ // Some plugins *cough* Oculus *cough* process message events from inside their
4742+ // display function, and we don't want to change the display plugin underneath
47494743 // the paintGL call, so we need to guard against that
47504744 if (_inPaint) {
47514745 qDebug() << "Deferring plugin switch until out of painting";
@@ -4779,14 +4773,14 @@ void Application::updateDisplayMode() { · 27 unmodified lines
47794773
47804774 oldDisplayPlugin = _displayPlugin;
47814775 _displayPlugin = newDisplayPlugin;
4782−
4776+
47834777 // If the displayPlugin is a screen based HMD, then it will want the HMDTools displayed
47844778 // Direct Mode HMDs (like windows Oculus) will be isHmd() but will have a screen of -1
47854779 bool newPluginWantsHMDTools = newDisplayPlugin ?
47864780 (newDisplayPlugin->isHmd() && (newDisplayPlugin->getHmdScreen() >= 0)) : false;
4787− bool oldPluginWantedHMDTools = oldDisplayPlugin ?
4781+ bool oldPluginWantedHMDTools = oldDisplayPlugin ?
47884782 (oldDisplayPlugin->isHmd() && (oldDisplayPlugin->getHmdScreen() >= 0)) : false;
4789−
4783+
47904784 // Only show the hmd tools after the correct plugin has
47914785 // been activated so that it's UI is setup correctly
47924786 if (newPluginWantsHMDTools) {
@@ -4796,7 +4790,7 @@ void Application::updateDisplayMode() { · 3 unmodified lines
47964790 if (oldDisplayPlugin) {
47974791 oldDisplayPlugin->deactivate();
47984792 _offscreenContext->makeCurrent();
4799−
4793+
48004794 // if the old plugin was HMD and the new plugin is not HMD, then hide our hmdtools
48014795 if (oldPluginWantedHMDTools && !newPluginWantsHMDTools) {
48024796 DependencyManager::get<DialogsManager>()->hmdTools(false);
@@ -4929,7 +4923,7 @@ void Application::setPalmData(Hand* hand, const controller::Pose& pose, float de · 126 unmodified lines
49294923 rawVelocity = glm::vec3(0.0f);
49304924 }
49314925 palm.setRawVelocity(rawVelocity); // meters/sec
4932−
4926+
49334927 // Angular Velocity of Palm
49344928 glm::quat deltaRotation = rotation * glm::inverse(palm.getRawRotation());
49354929 glm::vec3 angularVelocity(0.0f);
@@ -5009,7 +5003,7 @@ void Application::emulateMouse(Hand* hand, float click, float shift, HandData::H · 73 unmodified lines
50095003 pos.setY(canvasSize.y / 2.0f + cursorRange * yAngle);
50105004
50115005 }
5012−
5006+
50135007 //If we are off screen then we should stop processing, and if a trigger or bumper is pressed,
50145008 //we should unpress them.
50155009 if (pos.x() == INT_MAX) {

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