summaryrefslogtreecommitdiffstats
path: root/src/render/backend/entity.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/render/backend/entity.cpp')
-rw-r--r--src/render/backend/entity.cpp20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/render/backend/entity.cpp b/src/render/backend/entity.cpp
index d8d04aef1..bf128b508 100644
--- a/src/render/backend/entity.cpp
+++ b/src/render/backend/entity.cpp
@@ -289,6 +289,26 @@ QVector<Entity *> Entity::children() const
return childrenVector;
}
+void Entity::traverse(const std::function<void(Entity *)> &operation)
+{
+ operation(this);
+ for (const HEntity &handle : qAsConst(m_childrenHandles)) {
+ Entity *child = m_nodeManagers->renderNodesManager()->data(handle);
+ if (child != nullptr)
+ child->traverse(operation);
+ }
+}
+
+void Entity::traverse(const std::function<void(const Entity *)> &operation) const
+{
+ operation(this);
+ for (const HEntity &handle : m_childrenHandles) {
+ const Entity *child = m_nodeManagers->renderNodesManager()->data(handle);
+ if (child != nullptr)
+ child->traverse(operation);
+ }
+}
+
Matrix4x4 *Entity::worldTransform()
{
return m_nodeManagers->worldMatrixManager()->data(m_worldTransform);