Fix extreme eye movement when face is scaled small
Offset needs to be multiplied by scale, otherwise the effect will be disproportionately pronounced when the face is scaled down.
This commit is contained in:
parent
fbfc14bdf9
commit
b1571c0dc9
|
@ -83,7 +83,7 @@ void ModelPart::processFaceData(struct FaceData faceData) {
|
||||||
glm::vec2 bindPosition = faceData.positions[bind];
|
glm::vec2 bindPosition = faceData.positions[bind];
|
||||||
glm::vec2 followPosition = faceData.positions[follow];
|
glm::vec2 followPosition = faceData.positions[follow];
|
||||||
glm::vec2 followDirection = followPosition - bindPosition;
|
glm::vec2 followDirection = followPosition - bindPosition;
|
||||||
glm::vec2 offset = faceData.positions[offsetBind] * offsetFactor;
|
glm::vec2 offset = faceData.positions[offsetBind] * offsetFactor * faceData.scale;
|
||||||
glm::vec2 newPosition = bindPosition + offset + (followDirection * factor);
|
glm::vec2 newPosition = bindPosition + offset + (followDirection * factor);
|
||||||
|
|
||||||
smoothTransform(newPosition, faceData.headRotation, faceData.scale);
|
smoothTransform(newPosition, faceData.headRotation, faceData.scale);
|
||||||
|
|
Loading…
Reference in a new issue