mirror of
https://github.com/overte-org/overte.git
synced 2025-04-23 03:53:34 +02:00
Fix for Model Entity animations.
Because rig->setJoint* methods take parameters in geometry space the animations preRotation has to be applied manually.
This commit is contained in:
parent
db21db3cbc
commit
dd3f43705c
1 changed files with 2 additions and 1 deletions
|
@ -224,6 +224,7 @@ void ModelEntityItem::getAnimationFrame(bool& newFrame,
|
|||
if (myAnimation && myAnimation->isLoaded()) {
|
||||
|
||||
const QVector<FBXAnimationFrame>& frames = myAnimation->getFramesReference(); // NOTE: getFrames() is too heavy
|
||||
auto& fbxJoints = myAnimation->getGeometry().joints;
|
||||
|
||||
int frameCount = frames.size();
|
||||
if (frameCount > 0) {
|
||||
|
@ -244,7 +245,7 @@ void ModelEntityItem::getAnimationFrame(bool& newFrame,
|
|||
for (int j = 0; j < _jointMapping.size(); j++) {
|
||||
int index = _jointMapping[j];
|
||||
if (index != -1 && index < rotations.size()) {
|
||||
_lastKnownFrameDataRotations[j] = rotations[index];
|
||||
_lastKnownFrameDataRotations[j] = fbxJoints[index].preRotation * rotations[index];
|
||||
}
|
||||
if (index != -1 && index < translations.size()) {
|
||||
_lastKnownFrameDataTranslations[j] = translations[index];
|
||||
|
|
Loading…
Reference in a new issue