Trying incremental rotations for Leap palms.

This commit is contained in:
Andrzej Kapolka 2013-11-08 15:11:56 -08:00
parent 49c9d41dd5
commit 3446337cc5

View file

@ -139,8 +139,9 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
const FBXGeometry& geometry = _geometry->getFBXGeometry();
setJointPosition(jointIndex, palm.getPosition());
float sign = (jointIndex == geometry.rightHandJointIndex) ? 1.0f : -1.0f;
glm::quat palmRotation = rotationBetween(_rotation * IDENTITY_UP, -palm.getNormal()) * _rotation *
glm::angleAxis(90.0f, 0.0f, sign, 0.0f); // ninety degree rotation to face fingers forward from bind pose
glm::quat palmRotation;
getJointRotation(jointIndex, palmRotation, true);
palmRotation = rotationBetween(palmRotation * IDENTITY_UP, -palm.getNormal()) * palmRotation;
// sort the finger indices by raw x, get the average direction
QVector<IndexValue> fingerIndices;