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 diff --git a/interface/resources/qml/hifi/Pal.qml b/interface/resources/qml/hifi/Pal.qml index d785a8582c..1e72d71b18 100644 --- a/interface/resources/qml/hifi/Pal.qml +++ b/interface/resources/qml/hifi/Pal.qml @@ -910,17 +910,21 @@ 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.mounted ? instructions + hmdMountedInstructions : instructions + hmdNotMountedInstructions) + : ( HMD.mounted ? notLoggedInInstructions + instructions + hmdMountedInstructions : notLoggedInInstructions + instructions + hmdNotMountedInstructions) } } diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index b6ec45b308..ddd41f3cc2 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 7fadf96e11..dbc7ee5011 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -121,6 +121,26 @@ public: Q_INVOKABLE virtual glm::quat getDefaultJointRotation(int index) const; Q_INVOKABLE virtual glm::vec3 getDefaultJointTranslation(int index) const; + /**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; virtual glm::vec3 getAbsoluteJointTranslationInObjectFrame(int index) const override; virtual bool setAbsoluteJointRotationInObjectFrame(int index, const glm::quat& rotation) override { return false; } 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())); }