Read the palm direction from the FST, use that to determine Leap rotations.

This commit is contained in:
Andrzej Kapolka 2013-11-08 15:38:20 -08:00
parent 3446337cc5
commit 0eaaa89c9a
3 changed files with 5 additions and 1 deletions

View file

@ -141,7 +141,7 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;
glm::quat palmRotation;
getJointRotation(jointIndex, palmRotation, true);
palmRotation = rotationBetween(palmRotation * IDENTITY_UP, -palm.getNormal()) * palmRotation;
palmRotation = rotationBetween(palmRotation * geometry.palmDirection, palm.getNormal()) * palmRotation;
// sort the finger indices by raw x, get the average direction
QVector<IndexValue> fingerIndices;

View file

@ -1327,6 +1327,8 @@ FBXGeometry extractFBXGeometry(const FBXNode& node, const QVariantHash& mapping)
geometry.meshes.append(extracted.mesh);
}
geometry.palmDirection = parseVec3(mapping.value("palmDirection", "0, -1, 0").toString());
// process attachments
QVariantHash attachments = mapping.value("attach").toHash();
for (QVariantHash::const_iterator it = attachments.constBegin(); it != attachments.constEnd(); it++) {

View file

@ -145,6 +145,8 @@ public:
QVector<int> leftFingertipJointIndices;
QVector<int> rightFingertipJointIndices;
glm::vec3 palmDirection;
glm::vec3 neckPivot;
QVector<FBXAttachment> attachments;