mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 16:33:33 +02:00
Rig.cpp: take avatar scale into account when computing elbow pole vector
This commit is contained in:
parent
1979ed7f3a
commit
0f51236fb0
1 changed files with 4 additions and 2 deletions
|
@ -1383,8 +1383,10 @@ glm::vec3 Rig::calculateElbowPoleVector(int handIndex, int elbowIndex, int armIn
|
|||
glm::vec3 y = hipsPose.rot() * Vectors::UNIT_Y;
|
||||
// project d onto n.
|
||||
glm::vec3 dProj = d - glm::dot(d, n) * n;
|
||||
const float LATERAL_OFFSET = 0.333f;
|
||||
const float VERTICAL_OFFSET = -0.333f;
|
||||
|
||||
float avatarScale = extractUniformScale(_modelOffset);
|
||||
const float LATERAL_OFFSET = 0.333f * avatarScale;
|
||||
const float VERTICAL_OFFSET = -0.333f * avatarScale;
|
||||
|
||||
// give dProj a bit of offset away from the body.
|
||||
glm::vec3 dProjWithOffset = dProj + sign * LATERAL_OFFSET * n + y * VERTICAL_OFFSET;
|
||||
|
|
Loading…
Reference in a new issue