editor: editing terrain grass will save chunk data in case it needs to be recreated later

This commit is contained in:
Turánszki János
2024-08-21 07:13:31 +02:00
parent ce40b2e7ed
commit 8162abb6eb
+16
View File
@@ -1317,6 +1317,22 @@ void PaintToolWindow::Update(float dt)
}
}
if (hair._flags & wi::HairParticleSystem::REBUILD_BUFFERS)
{
for (size_t i = 0; i < scene.terrains.GetCount(); ++i)
{
for (auto& it : scene.terrains[i].chunks)
{
if (scene.Entity_IsDescendant(hairEntity, it.second.entity))
{
// Save modified grass lengths for chunk:
it.second.grass.vertex_lengths = hair.vertex_lengths;
break;
}
}
}
}
if (wireframe)
{
uint32_t first_subset = 0;