From e43d60583ccc4b0f0fac1357df859cc73d081504 Mon Sep 17 00:00:00 2001 From: Yuriy Toporovskyy Date: Thu, 4 Nov 2021 14:43:05 -0400 Subject: [PATCH] Fix a bug where a rigid body with multiple shapes would ignore all shapes except the first Signed-off-by: Yuriy Toporovskyy --- Gems/PhysX/Code/Source/Scene/PhysXScene.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp index 22fc665eec..0ae09d704b 100644 --- a/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp +++ b/Gems/PhysX/Code/Source/Scene/PhysXScene.cpp @@ -139,9 +139,8 @@ namespace PhysX else if (auto* shapeColliderPairList = AZStd::get_if>(&shapeData)) { bool shapeAdded = false; - if (!shapeColliderPairList->empty()) + for (const auto& shapeColliderConfigs : *shapeColliderPairList) { - const auto& shapeColliderConfigs = shapeColliderPairList->front(); auto shapePtr = AZStd::make_shared(*(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>(&shapeData)) {