mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:58:51 +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;
|
QVector<IndexValue> fingerIndices;
|
||||||
glm::vec3 direction;
|
glm::vec3 direction;
|
||||||
for (int i = 0; i < palm.getNumFingers(); i++) {
|
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);
|
float length = glm::length(fingerVector);
|
||||||
if (length > EPSILON) {
|
if (length > EPSILON) {
|
||||||
direction += fingerVector / length;
|
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);
|
fingerIndices.append(indexValue);
|
||||||
}
|
}
|
||||||
qSort(fingerIndices.begin(), fingerIndices.end());
|
qSort(fingerIndices.begin(), fingerIndices.end());
|
||||||
|
|
Loading…
Reference in a new issue