Revert "Avoid some broken calculations for IBoneSceneNode positions."

This was reported to cause broken models in some cases.
reverts commit edb381bd5050712d1eb8875fe3a405000dd09a3d
This commit is contained in:
sfan5 2023-03-26 14:07:42 +02:00
parent 799c8b936f
commit a67f3003de

@ -1347,24 +1347,9 @@ void CSkinnedMesh::recoverJointsFromMesh(core::array<IBoneSceneNode*> &jointChil
{
IBoneSceneNode* node=jointChildSceneNodes[i];
SJoint *joint=AllJoints[i];
if ( joint->UseAnimationFrom ) // Seems to work better (else solution seems to mess up sometimes) and would be faster. Any disadvantage?
{
node->setPosition(joint->Animatedposition);
core::quaternion qrot = joint->Animatedrotation;
qrot.W *= -1.f; // Animation system uses right-handed rotations? Argh...
irr::core::vector3df euler;
qrot.toEuler(euler);
euler *= core::RADTODEG;
node->setRotation(euler);
node->setScale(joint->Animatedscale);
}
else
{
node->setPosition(joint->LocalAnimatedMatrix.getTranslation());
node->setRotation(joint->LocalAnimatedMatrix.getRotationDegrees());
node->setScale(joint->LocalAnimatedMatrix.getScale());
}
node->setPosition(joint->LocalAnimatedMatrix.getTranslation());
node->setRotation(joint->LocalAnimatedMatrix.getRotationDegrees());
node->setScale(joint->LocalAnimatedMatrix.getScale());
node->positionHint=joint->positionHint;
node->scaleHint=joint->scaleHint;