1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 12:54:00 +00:00

Merge branch 'no-more-oversized-demons' into 'master'

Don't apply scale in RotateController

See merge request OpenMW/openmw!4284
This commit is contained in:
psi29a 2024-08-01 17:38:46 +00:00
commit e8fcdae99e

View File

@ -37,15 +37,12 @@ namespace MWRender
osg::Matrix matrix = node->getMatrix(); osg::Matrix matrix = node->getMatrix();
osg::Quat worldOrient; osg::Quat worldOrient;
osg::Vec3d worldScale(1.0, 1.0, 1.0);
osg::NodePathList nodepaths = node->getParentalNodePaths(mRelativeTo); osg::NodePathList nodepaths = node->getParentalNodePaths(mRelativeTo);
if (!nodepaths.empty()) if (!nodepaths.empty())
{ {
osg::Matrixf worldMat = osg::computeLocalToWorld(nodepaths[0]); osg::Matrixf worldMat = osg::computeLocalToWorld(nodepaths[0]);
worldOrient = worldMat.getRotate(); worldOrient = worldMat.getRotate();
worldScale = worldMat.getScale();
} }
osg::Quat worldOrientInverse = worldOrient.inverse(); osg::Quat worldOrientInverse = worldOrient.inverse();
@ -54,8 +51,6 @@ namespace MWRender
matrix.setRotate(orient); matrix.setRotate(orient);
matrix.setTrans(matrix.getTrans() + worldOrientInverse * mOffset); matrix.setTrans(matrix.getTrans() + worldOrientInverse * mOffset);
matrix *= osg::Matrix::scale(worldScale);
node->setMatrix(matrix); node->setMatrix(matrix);
// If we are linked to a bone we must call setMatrixInSkeletonSpace // If we are linked to a bone we must call setMatrixInSkeletonSpace