From 179a445f597e25feec658b35eb1f2d132c41223c Mon Sep 17 00:00:00 2001 From: David Kelly Date: Thu, 6 Apr 2017 15:21:10 -0700 Subject: [PATCH 1/7] updated connection instructions --- interface/resources/qml/hifi/Pal.qml | 31 +++++++++++++++++++--------- 1 file changed, 21 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index d627fb54f9..b378ee3c61 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -916,17 +916,28 @@ Rectangle { color: hifi.colors.darkGray wrapMode: Text.WordWrap textFormat: Text.StyledText; + property string hmdMountedInstructions: + "1. Put your hand out onto their hand and squeeze your controller's grip button on its side.
" + + "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + + "3. After about 3 seconds, you're connected!" + property string hmdNotMountedInstructions: + "1. Press and hold the 'x' key to extend your arm.
" + + "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + + "3. After about 3 seconds, you're connected!"; + property string notLoggedInInstructions: "You must be logged into your High Fidelity account to make connections.
" + property string instructions: + "When you meet someone you want to remember later, you can connect with a handshake:

" + // Text - text: HMD.isMounted ? - "When you meet someone you want to remember later, you can connect with a handshake:

" + - "1. Put your hand out onto their hand and squeeze your controller's grip button on its side.
" + - "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + - "3. After about 3 seconds, you're connected!" - : - "When you meet someone you want to remember later, you can connect with a handshake:

" + - "1. Press and hold the 'x' key to extend your arm.
" + - "2. Once the other person puts their hand onto yours, you'll see your connection form.
" + - "3. After about 3 seconds, you're connected!"; + text: + Account.isLoggedIn() ? + HMD.isMounted ? + instructions + hmdMountedInstructions + : instructions + hmdNotMountedInstructions + : + HMD.isMounted ? + notLoggedInInstructions + instructions + hmdMountedInstructions + : notLoggedInInstructions + instructions + hmdNotMountedInstructions } } From 40844d2a49a8376bc2ee4cbfa9e48f5584b3f851 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 7 Apr 2017 14:03:31 -0700 Subject: [PATCH 2/7] Added getAbsoluteDefaultJoint*InOjbectFrame to Avatar API. --- interface/src/avatar/Avatar.cpp | 15 +++++++++++++++ interface/src/avatar/Avatar.h | 4 ++++ 2 files changed, 19 insertions(+) diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index ade98c63d8..b9b9a7b912 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -933,6 +933,21 @@ glm::vec3 Avatar::getDefaultJointTranslation(int index) const { return translation; } +glm::quat Avatar::getAbsoluteDefaultJointRotationInObjectFrame(int index) const { + glm::quat rotation; + auto rig = _skeletonModel->getRig(); + glm::quat rot = rig->getAnimSkeleton()->getAbsoluteDefaultPose(index).rot(); + return Quaternions::Y_180 * rot; +} + +glm::vec3 Avatar::getAbsoluteDefaultJointTranslationInObjectFrame(int index) const { + glm::vec3 translation; + auto rig = _skeletonModel->getRig(); + glm::vec3 trans = rig->getAnimSkeleton()->getAbsoluteDefaultPose(index).trans(); + glm::mat4 y180Mat = createMatFromQuatAndPos(Quaternions::Y_180, glm::vec3()); + return transformPoint(y180Mat * rig->getGeometryToRigTransform(), trans); +} + glm::quat Avatar::getAbsoluteJointRotationInObjectFrame(int index) const { if (index < 0) { index += numeric_limits::max() + 1; // 65536 diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index ba7e1c617e..c81ff95f10 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -121,6 +121,10 @@ public: Q_INVOKABLE virtual glm::quat getDefaultJointRotation(int index) const; Q_INVOKABLE virtual glm::vec3 getDefaultJointTranslation(int index) const; + // in avatar coordinates + Q_INVOKABLE virtual glm::quat getAbsoluteDefaultJointRotationInObjectFrame(int index) const; + Q_INVOKABLE virtual glm::vec3 getAbsoluteDefaultJointTranslationInObjectFrame(int index) const; + virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override; virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override; virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; } From e065c1bac499b432a93dd33a86c20b81d4d2735f Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 7 Apr 2017 14:12:03 -0700 Subject: [PATCH 3/7] Added jsdoc for new Avatar.getAbsoluteDefaultJoint*InObjectFrame API --- interface/src/avatar/Avatar.h | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index c81ff95f10..fae4cd08be 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -121,8 +121,24 @@ public: Q_INVOKABLE virtual glm::quat getDefaultJointRotation(int index) const; Q_INVOKABLE virtual glm::vec3 getDefaultJointTranslation(int index) const; - // in avatar coordinates + /**jsdoc + * Provides read only access to the default joint rotations in avatar coordinates. + * The default pose of the avatar is defined by the position and orientation of all bones + * in the avatar's model file. Typically this is a t-pose. + * @function Avatar.getAbsoluteDefaultJointRotationInObjectFrame + * @param index {number} index number + * @returns {Quat} The rotation of this joint in avatar coordinates. + */ Q_INVOKABLE virtual glm::quat getAbsoluteDefaultJointRotationInObjectFrame(int index) const; + + /**jsdoc + * Provides read only access to the default joint translations in avatar coordinates. + * The default pose of the avatar is defined by the position and orientation of all bones + * in the avatar's model file. Typically this is a t-pose. + * @function Avatar.getAbsoluteDefaultJointTranslationInObjectFrame + * @param index {number} index number + * @returns {Vec3} The position of this joint in avatar coordinates. + */ Q_INVOKABLE virtual glm::vec3 getAbsoluteDefaultJointTranslationInObjectFrame(int index) const; virtual glm::quat getAbsoluteJointRotationInObjectFrame(int index) const override; From a06df1a400686a62a3db7801286a4516bbb79d2f Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Fri, 7 Apr 2017 14:13:00 -0700 Subject: [PATCH 4/7] Bug fix for passing quats from script to C++ via the animationStateHandler --- libraries/animation/src/AnimVariant.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/animation/src/AnimVariant.cpp b/libraries/animation/src/AnimVariant.cpp index 911899f5a9..832ab8678c 100644 --- a/libraries/animation/src/AnimVariant.cpp +++ b/libraries/animation/src/AnimVariant.cpp @@ -109,7 +109,7 @@ void AnimVariantMap::animVariantMapFromScriptValue(const QScriptValue& source) { if (z.isNumber()) { QScriptValue w = value.property("w"); if (w.isNumber()) { - set(property.name(), glm::quat(x.toNumber(), y.toNumber(), z.toNumber(), w.toNumber())); + set(property.name(), glm::quat(w.toNumber(), x.toNumber(), y.toNumber(), z.toNumber())); } else { set(property.name(), glm::vec3(x.toNumber(), y.toNumber(), z.toNumber())); } From 3ea6cac45aac79ee125ead7dc5702c11eb02634e Mon Sep 17 00:00:00 2001 From: David Kelly Date: Mon, 10 Apr 2017 08:05:01 -0700 Subject: [PATCH 5/7] HMD.mounted instead of HMD.isMounted --- interface/resources/qml/hifi/Pal.qml | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 8814342f02..6f815e79f9 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -921,17 +921,10 @@ Rectangle { property string notLoggedInInstructions: "You must be logged into your High Fidelity account to make connections.
" property string instructions: "When you meet someone you want to remember later, you can connect with a handshake:

" - // Text text: - Account.isLoggedIn() ? - HMD.isMounted ? - instructions + hmdMountedInstructions - : instructions + hmdNotMountedInstructions - : - HMD.isMounted ? - notLoggedInInstructions + instructions + hmdMountedInstructions - : notLoggedInInstructions + instructions + hmdNotMountedInstructions + Account.isLoggedIn() ? ( HMD.mounted ? instructions + hmdMountedInstructions : instructions + hmdNotMountedInstructions) + : ( HMD.mounted ? notLoggedInInstructions + instructions + hmdMountedInstructions : notLoggedInInstructions + instructions + hmdNotMountedInstructions } } From 082d0964d26859c77140205527557ff9c7cf3835 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Mon, 10 Apr 2017 11:08:45 -0700 Subject: [PATCH 6/7] oops --- interface/resources/qml/hifi/Pal.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index 6f815e79f9..1e72d71b18 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -924,7 +924,7 @@ Rectangle { // Text text: Account.isLoggedIn() ? ( HMD.mounted ? instructions + hmdMountedInstructions : instructions + hmdNotMountedInstructions) - : ( HMD.mounted ? notLoggedInInstructions + instructions + hmdMountedInstructions : notLoggedInInstructions + instructions + hmdNotMountedInstructions + : ( HMD.mounted ? notLoggedInInstructions + instructions + hmdMountedInstructions : notLoggedInInstructions + instructions + hmdNotMountedInstructions) } } From 5fc4bbc260404ca45d394711c9d39134b70ad711 Mon Sep 17 00:00:00 2001 From: David Kelly Date: Mon, 10 Apr 2017 12:26:34 -0700 Subject: [PATCH 7/7] re-enable the info button for user images on nearby tab --- interface/resources/qml/hifi/NameCard.qml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/interface/resources/qml/hifi/NameCard.qml b/interface/resources/qml/hifi/NameCard.qml index 6be85f2ea6..554df82d9e 100644 --- a/interface/resources/qml/hifi/NameCard.qml +++ b/interface/resources/qml/hifi/NameCard.qml @@ -81,6 +81,25 @@ Item { anchors.fill: parent; visible: userImage.status != Image.Ready; } + StateImage { + id: infoHoverImage; + visible: false; + imageURL: "../../images/info-icon-2-state.svg"; + size: 32; + buttonState: 1; + anchors.centerIn: parent; + } + MouseArea { + anchors.fill: parent + enabled: (selected || isMyCard) && activeTab == "nearbyTab"; + hoverEnabled: enabled + onClicked: { + userInfoViewer.url = defaultBaseUrl + "/users/" + userName; + userInfoViewer.visible = true; + } + onEntered: infoHoverImage.visible = true; + onExited: infoHoverImage.visible = false; + } } // Colored border around avatarImage