Only rotate if we have at least three active fingers.

This commit is contained in:
Andrzej Kapolka 2013-11-13 13:26:36 -08:00
parent 52a3071cb3
commit 3e4c5f84ed

View file

@ -161,7 +161,8 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
// rotate palm according to average finger direction
float directionLength = glm::length(direction);
if (directionLength > EPSILON) {
const int MIN_ROTATION_FINGERS = 3;
if (directionLength > EPSILON && palm.getNumFingers() >= MIN_ROTATION_FINGERS) {
applyRotationDelta(jointIndex, rotationBetween(palmRotation * glm::vec3(-sign, 0.0f, 0.0f), direction));
getJointRotation(jointIndex, palmRotation, true);
}