[EMotionFX] Avoid using invalid Aabbs #3048

Merge pull request #3048 from aws-lumberyard-dev/burelc/SPEC-7957
monroegm-disable-blank-issue-2
Benjamin Jillich 4 years ago committed by GitHub
commit 1f23297abb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -621,7 +621,7 @@ namespace EMotionFX
} }
// Expand the bounding volume by a tolerance area in case set. // 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 center = m_aabb.GetCenter();
const AZ::Vector3 halfExtents = m_aabb.GetExtents() * 0.5f; const AZ::Vector3 halfExtents = m_aabb.GetExtents() * 0.5f;
@ -1416,8 +1416,12 @@ namespace EMotionFX
*outResult = m_staticAabb; *outResult = m_staticAabb;
EMFX_SCALECODE( EMFX_SCALECODE(
outResult->SetMin(m_staticAabb.GetMin() * m_worldTransform.m_scale); if (m_staticAabb.IsValid())
outResult->SetMax(m_staticAabb.GetMax() * m_worldTransform.m_scale);) {
outResult->SetMin(m_staticAabb.GetMin() * m_worldTransform.m_scale);
outResult->SetMax(m_staticAabb.GetMax() * m_worldTransform.m_scale);
}
)
outResult->Translate(m_worldTransform.m_position); outResult->Translate(m_worldTransform.m_position);
} }

Loading…
Cancel
Save