1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 09:35:28 +00:00

Fix btCompoundShape scaling (Fixes #1683)

This commit is contained in:
scrawl 2015-01-14 17:59:04 +01:00
parent a3c861b7fa
commit 52ed3d92a8

View File

@ -73,10 +73,12 @@ void animateCollisionShapes (std::map<OEngine::Physic::RigidBody*, OEngine::Phys
btCompoundShape* compound = dynamic_cast<btCompoundShape*>(instance.mCompound);
btTransform trans;
trans.setOrigin(BtOgre::Convert::toBullet(bone->_getDerivedPosition()));
trans.setOrigin(BtOgre::Convert::toBullet(bone->_getDerivedPosition()) * compound->getLocalScaling());
trans.setRotation(BtOgre::Convert::toBullet(bone->_getDerivedOrientation()));
compound->getChildShape(shapeIt->second)->setLocalScaling(BtOgre::Convert::toBullet(bone->_getDerivedScale()));
compound->getChildShape(shapeIt->second)->setLocalScaling(
compound->getLocalScaling() *
BtOgre::Convert::toBullet(bone->_getDerivedScale()));
compound->updateChildTransform(shapeIt->second, trans);
}