From afb03b3d2d8ae66fa112f16d75aa7422828a9115 Mon Sep 17 00:00:00 2001 From: Gerard Maguire Date: Tue, 10 Oct 2017 16:19:31 +0100 Subject: [PATCH] Avatar pitch and roll cleared --- interface/resources/qml/hifi/NameCard.qml | 10 ++++++---- libraries/networking/src/AddressManager.cpp | 12 +++++------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index 7e93d2c397..b122f71760 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -244,7 +244,7 @@ Item { enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "" && isPresent; hoverEnabled: enabled onClicked: { - goToUserInDomain(thisNameCard.uuid, false); + goToUserInDomain(thisNameCard.uuid); UserActivityLogger.palAction("go_to_user_in_domain", thisNameCard.uuid); } onEntered: { @@ -339,7 +339,7 @@ Item { enabled: selected && pal.activeTab == "nearbyTab" && thisNameCard.userName !== "" && isPresent; hoverEnabled: enabled onClicked: { - goToUserInDomain(thisNameCard.uuid, false); + goToUserInDomain(thisNameCard.uuid); UserActivityLogger.palAction("go_to_user_in_domain", thisNameCard.uuid); } onEntered: { @@ -433,6 +433,7 @@ Item { anchors.verticalCenter: nameCardRemoveConnectionImage.verticalCenter x: 240 onClicked: { + console.log("Vist user button clicked."); // Remove after debugging. AddressManager.goToUser(thisNameCard.userName, false); UserActivityLogger.palAction("go_to_user", thisNameCard.userName); } @@ -597,7 +598,8 @@ Item { // Note, however, that this script allows teleporting to a person in the air, while teleport.js is going to a grounded target. // Position avatar 2 metres from the target in the direction that target avatar was facing. MyAvatar.position = Vec3.sum(avatar.position, Vec3.multiplyQbyV(avatar.orientation, {x: 0, y: 0, z: -2})); - // Rotate avatar on Y axis to face target avatar. - MyAvatar.orientation = Quat.multiply(avatar.orientation, {y: 1}); + + // Rotate avatar on Y axis to face target avatar and cancel out any inherited roll and pitch. + MyAvatar.orientation = Quat.cancelOutRollAndPitch(Quat.multiply(avatar.orientation, {y: 1})); } } diff --git a/libraries/networking/src/AddressManager.cpp b/libraries/networking/src/AddressManager.cpp index 4030e2101b..772f9df2e1 100644 --- a/libraries/networking/src/AddressManager.cpp +++ b/libraries/networking/src/AddressManager.cpp @@ -668,13 +668,11 @@ bool AddressManager::handleViewpoint(const QString& viewpointString, bool should qCDebug(networking) << "Orientation parsed from lookup string is invalid. Will not use for location change."; } } - - if (trigger == LookupTrigger::VisitUserFromPAL) { - qCDebug(networking) << "trigger is VisitUserFromPAL -- applying Quat.cancelOutRollAndPitch"; - newOrientation = cancelOutRollAndPitch(newOrientation); - } - - emit locationChangeRequired(newPosition, orientationChanged, newOrientation, shouldFace); + + emit locationChangeRequired(newPosition, orientationChanged, + LookupTrigger::VisitUserFromPAL ? cancelOutRollAndPitch(newOrientation): newOrientation, + shouldFace + ); } else { qCDebug(networking) << "Could not jump to position from lookup string because it has an invalid value.";