mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 15:13:41 +02:00
Try finding the fingers using the rotation about the palm.
This commit is contained in:
parent
ebe3ef4b22
commit
11fedb23cd
1 changed files with 3 additions and 2 deletions
|
@ -146,12 +146,13 @@ void SkeletonModel::applyPalmData(int jointIndex, const QVector<int>& fingerJoin
|
|||
QVector<IndexValue> fingerIndices;
|
||||
glm::vec3 direction;
|
||||
for (int i = 0; i < palm.getNumFingers(); i++) {
|
||||
glm::vec3 fingerVector = palm.getFingers()[i].getTipPosition() - palm.getFingers()[i].getRootPosition();
|
||||
glm::vec3 fingerVector = palm.getFingers()[i].getTipPosition() - palm.getPosition();
|
||||
float length = glm::length(fingerVector);
|
||||
if (length > EPSILON) {
|
||||
direction += fingerVector / length;
|
||||
}
|
||||
IndexValue indexValue = { i, palm.getFingers()[i].getTipRawPosition().x };
|
||||
fingerVector = glm::inverse(palmRotation) * fingerVector;
|
||||
IndexValue indexValue = { i, atan2f(fingerVector.z, fingerVector.x) };
|
||||
fingerIndices.append(indexValue);
|
||||
}
|
||||
qSort(fingerIndices.begin(), fingerIndices.end());
|
||||
|
|
Loading…
Reference in a new issue