From 0676f25e310dd7ed6744b0b0098f110dd3ced9a8 Mon Sep 17 00:00:00 2001 From: luiscuenca Date: Tue, 25 Sep 2018 07:42:28 -0700 Subject: [PATCH] Save transit preferences --- interface/src/avatar/MyAvatar.cpp | 12 +++++++----- interface/src/ui/PreferencesDialog.cpp | 4 ++-- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 362fc90a0e..93bed8c8c1 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -1027,7 +1027,7 @@ glm::vec3 MyAvatar::worldToJointPoint(const glm::vec3& position, const int joint if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) { _skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot); } else { - //qWarning() << "Invalid joint index specified: " << jointIndex; + qWarning() << "Invalid joint index specified: " << jointIndex; } } glm::vec3 modelOffset = position - jointPos; @@ -1049,7 +1049,7 @@ glm::vec3 MyAvatar::worldToJointDirection(const glm::vec3& worldDir, const int j glm::quat MyAvatar::worldToJointRotation(const glm::quat& worldRot, const int jointIndex) const { glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) { - //qWarning() << "Invalid joint index specified: " << jointIndex; + qWarning() << "Invalid joint index specified: " << jointIndex; } glm::quat jointSpaceRot = glm::inverse(jointRot) * worldRot; return jointSpaceRot; @@ -1063,7 +1063,7 @@ glm::vec3 MyAvatar::jointToWorldPoint(const glm::vec3& jointSpacePos, const int if (_skeletonModel->getJointPositionInWorldFrame(jointIndex, jointPos)) { _skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot); } else { - //qWarning() << "Invalid joint index specified: " << jointIndex; + qWarning() << "Invalid joint index specified: " << jointIndex; } } @@ -1076,7 +1076,7 @@ glm::vec3 MyAvatar::jointToWorldPoint(const glm::vec3& jointSpacePos, const int glm::vec3 MyAvatar::jointToWorldDirection(const glm::vec3& jointSpaceDir, const int jointIndex) const { glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) { - //qWarning() << "Invalid joint index specified: " << jointIndex; + qWarning() << "Invalid joint index specified: " << jointIndex; } glm::vec3 worldDir = jointRot * jointSpaceDir; return worldDir; @@ -1085,7 +1085,7 @@ glm::vec3 MyAvatar::jointToWorldDirection(const glm::vec3& jointSpaceDir, const glm::quat MyAvatar::jointToWorldRotation(const glm::quat& jointSpaceRot, const int jointIndex) const { glm::quat jointRot = getWorldOrientation();//default value if no or invalid joint specified if ((jointIndex != -1) && (!_skeletonModel->getJointRotationInWorldFrame(jointIndex, jointRot))) { - //qWarning() << "Invalid joint index specified: " << jointIndex; + qWarning() << "Invalid joint index specified: " << jointIndex; } glm::quat worldRot = jointRot * jointSpaceRot; return worldRot; @@ -1223,6 +1223,7 @@ void MyAvatar::saveData() { settings.setValue("displayName", _displayName); settings.setValue("collisionSoundURL", _collisionSoundURL); settings.setValue("useSnapTurn", _useSnapTurn); + settings.setValue("showTransit", _showTransit); settings.setValue("userHeight", getUserHeight()); settings.setValue("flyingHMD", getFlyingHMDPref()); @@ -1381,6 +1382,7 @@ void MyAvatar::loadData() { setDisplayName(settings.value("displayName").toString()); setCollisionSoundURL(settings.value("collisionSoundURL", DEFAULT_AVATAR_COLLISION_SOUND_URL).toString()); setSnapTurn(settings.value("useSnapTurn", _useSnapTurn).toBool()); + setShowTransit(settings.value("showTransit", _showTransit).toBool()); setDominantHand(settings.value("dominantHand", _dominantHand).toString().toLower()); setUserHeight(settings.value("userHeight", DEFAULT_AVATAR_HEIGHT).toDouble()); settings.endGroup(); diff --git a/interface/src/ui/PreferencesDialog.cpp b/interface/src/ui/PreferencesDialog.cpp index 8b0173888e..d3e28f0041 100644 --- a/interface/src/ui/PreferencesDialog.cpp +++ b/interface/src/ui/PreferencesDialog.cpp @@ -249,8 +249,8 @@ void setupPreferences() { preferences->addPreference(preference); } { - auto getter = [myAvatar]()->int { return myAvatar->getShowTransit() ? 0 : 1; }; - auto setter = [myAvatar](int value) { myAvatar->setShowTransit(value == 0); }; + auto getter = [myAvatar]()->int { return myAvatar->getShowTransit() ? 1 : 0; }; + auto setter = [myAvatar](int value) { myAvatar->setShowTransit(value == 1); }; auto preference = new RadioButtonsPreference(VR_MOVEMENT, "Snap teleport / Smooth teleport", getter, setter); QStringList items; items << "Snap teleport" << "Smooth teleport";