[EMotionFX] Avoid using invalid Aabbs

Signed-off-by: Chris Burel <burelc@amazon.com>
This commit is contained in:
Chris Burel
2021-08-11 10:35:13 -07:00
parent 36c639e417
commit c28026a022
@@ -621,7 +621,7 @@ namespace EMotionFX
}
// Expand the bounding volume by a tolerance area in case set.
if (!AZ::IsClose(m_boundsExpandBy, 0.0f))
if (!AZ::IsClose(m_boundsExpandBy, 0.0f) && m_aabb.IsValid())
{
const AZ::Vector3 center = m_aabb.GetCenter();
const AZ::Vector3 halfExtents = m_aabb.GetExtents() * 0.5f;
@@ -1416,8 +1416,12 @@ namespace EMotionFX
*outResult = m_staticAabb;
EMFX_SCALECODE(
outResult->SetMin(m_staticAabb.GetMin() * m_worldTransform.m_scale);
outResult->SetMax(m_staticAabb.GetMax() * m_worldTransform.m_scale);)
if (m_staticAabb.IsValid())
{
outResult->SetMin(m_staticAabb.GetMin() * m_worldTransform.m_scale);
outResult->SetMax(m_staticAabb.GetMax() * m_worldTransform.m_scale);
}
)
outResult->Translate(m_worldTransform.m_position);
}