Add Foliage.RemoveAllInstances to clear all instances of foliage

#2957
This commit is contained in:
Wojtek Figat
2024-10-01 23:07:47 +02:00
parent c597c38705
commit 7f7549d2f7
2 changed files with 11 additions and 0 deletions

View File

@@ -986,6 +986,12 @@ void Foliage::UpdateCullDistance()
#endif
}
void Foliage::RemoveAllInstances()
{
Instances.Clear();
RebuildClusters();
}
static float GlobalDensityScale = 1.0f;
float Foliage::GetGlobalDensityScale()

View File

@@ -134,6 +134,11 @@ public:
/// </summary>
API_FUNCTION() void UpdateCullDistance();
/// <summary>
/// Clears all foliage instances. Preserves the foliage types and other properties.
/// </summary>
API_FUNCTION() void RemoveAllInstances();
public:
/// <summary>
/// Gets the global density scale for all foliage instances. The default value is 1. Use values from range 0-1. Lower values decrease amount of foliage instances in-game. Use it to tweak game performance for slower devices.