Add Model SDF generation utilities

This commit is contained in:
Wojciech Figat
2022-03-24 11:32:02 +01:00
parent d5060e9067
commit b08d2001fd
24 changed files with 696 additions and 323 deletions

View File

@@ -600,6 +600,21 @@ bool MaterialSlotEntry::UsesProperties() const
Normals.TextureIndex != -1;
}
BoundingBox ModelLodData::GetBox() const
{
if (Meshes.IsEmpty())
return BoundingBox::Empty;
BoundingBox bounds;
Meshes[0]->CalculateBox(bounds);
for (int32 i = 1; i < Meshes.Count(); i++)
{
BoundingBox b;
Meshes[i]->CalculateBox(b);
BoundingBox::Merge(bounds, b, bounds);
}
return bounds;
}
void ModelData::CalculateLODsScreenSizes()
{
const float autoComputeLodPowerBase = 0.5f;

View File

@@ -409,6 +409,11 @@ public:
{
Meshes.ClearDelete();
}
/// <summary>
/// Gets the bounding box combined for all meshes in this model LOD.
/// </summary>
BoundingBox GetBox() const;
};
/// <summary>