Add AddDrawableIfParentless function
This commit is contained in:
@@ -74,6 +74,12 @@ namespace OpenVulkano::Scene
|
|||||||
drawables.push_back(drawable);
|
drawables.push_back(drawable);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Node::AddDrawableIfParentless(Drawable* drawable)
|
||||||
|
{
|
||||||
|
if (drawable->GetNodes().empty())
|
||||||
|
AddDrawable(drawable);
|
||||||
|
}
|
||||||
|
|
||||||
void Node::RemoveDrawable(Drawable* drawable)
|
void Node::RemoveDrawable(Drawable* drawable)
|
||||||
{
|
{
|
||||||
drawable->RemoveNode(this);
|
drawable->RemoveNode(this);
|
||||||
|
|||||||
@@ -57,6 +57,8 @@ namespace OpenVulkano::Scene
|
|||||||
|
|
||||||
void RemoveDrawable(Drawable* drawable);
|
void RemoveDrawable(Drawable* drawable);
|
||||||
|
|
||||||
|
void AddDrawableIfParentless(Drawable* drawable);
|
||||||
|
|
||||||
void SetMatrix(const Math::Matrix4f& mat);
|
void SetMatrix(const Math::Matrix4f& mat);
|
||||||
|
|
||||||
[[nodiscard]] Math::Matrix3f GetRotationMatrix() const { return static_cast<const Math::Matrix3f>(localMat); }
|
[[nodiscard]] Math::Matrix3f GetRotationMatrix() const { return static_cast<const Math::Matrix3f>(localMat); }
|
||||||
|
|||||||
Reference in New Issue
Block a user