From bb5c2ac4625214a3577e9d55c8ee2e65ff17a003 Mon Sep 17 00:00:00 2001 From: greerdv Date: Tue, 30 Nov 2021 15:52:34 +0000 Subject: [PATCH] fix alignment of autosized ragdoll colliders Signed-off-by: greerdv --- Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp index 02b3fd7649..14618b1736 100644 --- a/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp +++ b/Gems/EMotionFX/Code/EMotionFX/Source/PhysicsSetup.cpp @@ -299,7 +299,7 @@ namespace EMotionFX { Physics::CapsuleShapeConfiguration* capsule = static_cast(collider.second.get()); capsule->m_height = boneDirection.GetLength(); - if (AZ::IsClose(localBoneDirection.GetLength(), 1.0f)) + if (!localBoneDirection.IsZero()) { collider.first->m_rotation = AZ::Quaternion::CreateShortestArc(AZ::Vector3::CreateAxisZ(), localBoneDirection.GetNormalized()); } @@ -309,7 +309,7 @@ namespace EMotionFX } else if (colliderType == azrtti_typeid()) { - if (AZ::IsClose(localBoneDirection.GetLength(), 1.0f)) + if (!localBoneDirection.IsZero()) { collider.first->m_rotation = AZ::Quaternion::CreateShortestArc(AZ::Vector3::CreateAxisZ(), localBoneDirection.GetNormalized()); }