mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-22 05:39:43 +00:00
Consider animated object unchanged if no transform updates done
This commit is contained in:
parent
832ab103cb
commit
3caeda7299
1 changed files with 5 additions and 1 deletions
|
@ -112,6 +112,7 @@ namespace MWPhysics
|
|||
assert (mShapeInstance->mCollisionShape->isCompound());
|
||||
|
||||
btCompoundShape* compound = static_cast<btCompoundShape*>(mShapeInstance->mCollisionShape.get());
|
||||
bool result = false;
|
||||
for (const auto& [recIndex, shapeIndex] : mShapeInstance->mAnimatedShapes)
|
||||
{
|
||||
auto nodePathFound = mRecIndexToNodePath.find(recIndex);
|
||||
|
@ -145,8 +146,11 @@ namespace MWPhysics
|
|||
// Note: we can not apply scaling here for now since we treat scaled shapes
|
||||
// as new shapes (btScaledBvhTriangleMeshShape) with 1.0 scale for now
|
||||
if (!(transform == compound->getChildTransform(shapeIndex)))
|
||||
{
|
||||
compound->updateChildTransform(shapeIndex, transform);
|
||||
result = true;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue