Graphics/Model: Fix model not invalidating their bounding volume when their mesh AABB got updated

This commit is contained in:
Jérôme Leclercq
2018-05-03 13:32:53 +02:00
parent d94baf133b
commit d53c245c78
4 changed files with 26 additions and 6 deletions

View File

@@ -252,9 +252,15 @@ namespace Nz
m_mesh = mesh;
if (m_mesh)
{
ResetMaterials(mesh->GetMaterialCount());
m_meshAABBInvalidationSlot.Connect(m_mesh->OnMeshInvalidateAABB, [this](const Nz::Mesh*) { InvalidateBoundingVolume(); });
}
else
{
ResetMaterials(0);
m_meshAABBInvalidationSlot.Disconnect();
}
InvalidateBoundingVolume();
}