Add AddDrawableIfParentless function

This commit is contained in:
Georg Hagen
2024-06-23 10:53:05 +02:00
parent 9692ecf89d
commit ef666fae8f
2 changed files with 8 additions and 0 deletions

View File

@@ -74,6 +74,12 @@ namespace OpenVulkano::Scene
drawables.push_back(drawable);
}
void Node::AddDrawableIfParentless(Drawable* drawable)
{
if (drawable->GetNodes().empty())
AddDrawable(drawable);
}
void Node::RemoveDrawable(Drawable* drawable)
{
drawable->RemoveNode(this);