1
0
Fork 0
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:
elsid 2022-02-02 01:11:13 +01:00
parent 832ab103cb
commit 3caeda7299
No known key found for this signature in database
GPG key ID: B845CB9FEE18AB40

View file

@ -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;
}
}