Add back in fixed margin code.

This commit is contained in:
Chandler Cox
2023-10-03 09:21:27 -05:00
parent d6861696a5
commit 9fbc51a22a

View File

@@ -537,6 +537,12 @@ void AnimatedModel::UpdateBounds()
// No animation asset applied
_box = SkinnedModel->GetBox(_transform.GetWorld());
}
// Apply margin based on model dimensions
const Vector3 modelBoxSize = SkinnedModel->GetBox(_transform.GetWorld()).GetSize();
const Vector3 center = _box.GetCenter();
const Vector3 sizeHalf = Vector3::Max(_box.GetSize() + modelBoxSize * 0.2f, modelBoxSize) * 0.5f;
_box = BoundingBox(center - sizeHalf, center + sizeHalf);
}
else
{