mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 20:55:10 +02:00
Merge pull request #6751 from hyperlogic/tony/model-entity-item-animation-fix
ModelEntityItem: Fix for missing pre-rotations for animated models.
This commit is contained in:
commit
b190b2757e
1 changed files with 4 additions and 2 deletions
|
@ -252,9 +252,11 @@ void ModelEntityItem::getAnimationFrame(bool& newFrame,
|
||||||
if (index < translations.size()) {
|
if (index < translations.size()) {
|
||||||
translationMat = glm::translate(translations[index]);
|
translationMat = glm::translate(translations[index]);
|
||||||
}
|
}
|
||||||
glm::mat4 rotationMat;
|
glm::mat4 rotationMat(glm::mat4::_null);
|
||||||
if (index < rotations.size()) {
|
if (index < rotations.size()) {
|
||||||
rotationMat = glm::mat4_cast(rotations[index]);
|
rotationMat = glm::mat4_cast(fbxJoints[index].preRotation * rotations[index] * fbxJoints[index].postRotation);
|
||||||
|
} else {
|
||||||
|
rotationMat = glm::mat4_cast(fbxJoints[index].preRotation * fbxJoints[index].postRotation);
|
||||||
}
|
}
|
||||||
glm::mat4 finalMat = (translationMat * fbxJoints[index].preTransform *
|
glm::mat4 finalMat = (translationMat * fbxJoints[index].preTransform *
|
||||||
rotationMat * fbxJoints[index].postTransform);
|
rotationMat * fbxJoints[index].postTransform);
|
||||||
|
|
Loading…
Reference in a new issue