Merge pull request #5320 from yuriy0/physx_multi_shape_rigid_body

Fix a bug where a rigid body with multiple shapes would ignore all shapes except the first
This commit is contained in:
SergeyAMZN
2021-11-10 12:48:24 +00:00
committed by GitHub
+2 -3
View File
@@ -139,9 +139,8 @@ namespace PhysX
else if (auto* shapeColliderPairList = AZStd::get_if<AZStd::vector<AzPhysics::ShapeColliderPair>>(&shapeData))
{
bool shapeAdded = false;
if (!shapeColliderPairList->empty())
for (const auto& shapeColliderConfigs : *shapeColliderPairList)
{
const auto& shapeColliderConfigs = shapeColliderPairList->front();
auto shapePtr = AZStd::make_shared<Shape>(*(shapeColliderConfigs.first), *(shapeColliderConfigs.second));
AZStd::visit([shapePtr, &shapeAdded](auto&& body)
{
@@ -151,8 +150,8 @@ namespace PhysX
shapeAdded = true;
}
}, simulatedBody);
return shapeAdded;
}
return shapeAdded;
}
else if (auto* shape = AZStd::get_if<AZStd::shared_ptr<Physics::Shape>>(&shapeData))
{