From 3caeda7299508b8a80da254658bb3f73b11c66fd Mon Sep 17 00:00:00 2001 From: elsid Date: Wed, 2 Feb 2022 01:11:13 +0100 Subject: [PATCH] Consider animated object unchanged if no transform updates done --- apps/openmw/mwphysics/object.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/apps/openmw/mwphysics/object.cpp b/apps/openmw/mwphysics/object.cpp index 08fcc7e47d..76661b86a0 100644 --- a/apps/openmw/mwphysics/object.cpp +++ b/apps/openmw/mwphysics/object.cpp @@ -112,6 +112,7 @@ namespace MWPhysics assert (mShapeInstance->mCollisionShape->isCompound()); btCompoundShape* compound = static_cast(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; } }