Fix asset to be soft when transformation is nan or inf

#2742
This commit is contained in:
Wojtek Figat
2024-07-04 18:05:47 +02:00
parent f40cf6539a
commit d1e54b821b
2 changed files with 11 additions and 3 deletions

View File

@@ -136,7 +136,11 @@ void BoundingSphere::FromPoints(const Double3* points, int32 pointsCount, Boundi
void BoundingSphere::FromBox(const BoundingBox& box, BoundingSphere& result)
{
ASSERT(!box.Minimum.IsNanOrInfinity() && !box.Maximum.IsNanOrInfinity());
if (box.Minimum.IsNanOrInfinity() || box.Maximum.IsNanOrInfinity())
{
result = Empty;
return;
}
const Real x = box.Maximum.X - box.Minimum.X;
const Real y = box.Maximum.Y - box.Minimum.Y;
const Real z = box.Maximum.Z - box.Minimum.Z;