Fix a bug where a rigid body with multiple shapes would ignore all shapes except the first

Signed-off-by: Yuriy Toporovskyy <toporovskyy.y@gmail.com>
This commit is contained in:
Yuriy Toporovskyy
2021-11-04 14:43:05 -04:00
parent b6be57d2cf
commit e43d60583c
+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))
{