mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-20 15:40:32 +00:00
FIX(rotatecontroller): Actually accounting for scale breaks biped creatures
This commit is contained in:
parent
51455b24e0
commit
a4f1e7d918
@ -37,15 +37,12 @@ namespace MWRender
|
||||
osg::Matrix matrix = node->getMatrix();
|
||||
|
||||
osg::Quat worldOrient;
|
||||
osg::Vec3d worldScale(1.0, 1.0, 1.0);
|
||||
|
||||
osg::NodePathList nodepaths = node->getParentalNodePaths(mRelativeTo);
|
||||
|
||||
if (!nodepaths.empty())
|
||||
{
|
||||
osg::Matrixf worldMat = osg::computeLocalToWorld(nodepaths[0]);
|
||||
worldOrient = worldMat.getRotate();
|
||||
worldScale = worldMat.getScale();
|
||||
}
|
||||
|
||||
osg::Quat worldOrientInverse = worldOrient.inverse();
|
||||
@ -54,8 +51,6 @@ namespace MWRender
|
||||
matrix.setRotate(orient);
|
||||
matrix.setTrans(matrix.getTrans() + worldOrientInverse * mOffset);
|
||||
|
||||
matrix *= osg::Matrix::scale(worldScale);
|
||||
|
||||
node->setMatrix(matrix);
|
||||
|
||||
// If we are linked to a bone we must call setMatrixInSkeletonSpace
|
||||
|
Loading…
x
Reference in New Issue
Block a user