code refactoring
This commit is contained in:
@@ -110,6 +110,15 @@ namespace OpenVulkano::Scene
|
||||
UpdateWorldMatrix(parent ? parent->GetWorldMatrix() : Math::Matrix4f(1));
|
||||
}
|
||||
|
||||
Node* Node::GetRoot()
|
||||
{
|
||||
if (IsRoot() || !parent)
|
||||
{
|
||||
return this;
|
||||
}
|
||||
return parent->GetRoot();
|
||||
}
|
||||
|
||||
void Node::UpdateWorldMatrix(const Math::Matrix4f& parentWorldMat)
|
||||
{
|
||||
worldMat = parentWorldMat * localMat;
|
||||
|
||||
Reference in New Issue
Block a user