mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-25 16:43:33 +00:00
Consider animated object unchanged if no transform updates done
This commit is contained in:
parent
832ab103cb
commit
3caeda7299
@ -112,6 +112,7 @@ namespace MWPhysics
|
|||||||
assert (mShapeInstance->mCollisionShape->isCompound());
|
assert (mShapeInstance->mCollisionShape->isCompound());
|
||||||
|
|
||||||
btCompoundShape* compound = static_cast<btCompoundShape*>(mShapeInstance->mCollisionShape.get());
|
btCompoundShape* compound = static_cast<btCompoundShape*>(mShapeInstance->mCollisionShape.get());
|
||||||
|
bool result = false;
|
||||||
for (const auto& [recIndex, shapeIndex] : mShapeInstance->mAnimatedShapes)
|
for (const auto& [recIndex, shapeIndex] : mShapeInstance->mAnimatedShapes)
|
||||||
{
|
{
|
||||||
auto nodePathFound = mRecIndexToNodePath.find(recIndex);
|
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
|
// Note: we can not apply scaling here for now since we treat scaled shapes
|
||||||
// as new shapes (btScaledBvhTriangleMeshShape) with 1.0 scale for now
|
// as new shapes (btScaledBvhTriangleMeshShape) with 1.0 scale for now
|
||||||
if (!(transform == compound->getChildTransform(shapeIndex)))
|
if (!(transform == compound->getChildTransform(shapeIndex)))
|
||||||
|
{
|
||||||
compound->updateChildTransform(shapeIndex, transform);
|
compound->updateChildTransform(shapeIndex, transform);
|
||||||
|
result = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return result;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user