summaryrefslogtreecommitdiffstats
path: root/src/render/jobs/frustumcullingjob_p.h
diff options
context:
space:
mode:
authorMike Krus <mike.krus@kdab.com>2019-04-03 21:20:53 +0100
committerMike Krus <mike.krus@kdab.com>2019-05-25 09:28:33 +0100
commit861a73b5328334ebf076d3dd6b2ad6c17bdc0700 (patch)
treeeecd01b77c76c4376813b59da63484bd866af813 /src/render/jobs/frustumcullingjob_p.h
parentd108987a6ce9087908a14396ac90c8d9bb0860cb (diff)
Iterate on child handles
Resolving list of handles as list of node pointers introduces extra heap memory allocation (via QVector) which can cause locking with high number of threads. Added Entity::traverse() methods to apply a functor to all entitied in a sub-tree. Change-Id: I239ab30ac8ac53ba83666a147015d58465d76eb2 Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/jobs/frustumcullingjob_p.h')
-rw-r--r--src/render/jobs/frustumcullingjob_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/render/jobs/frustumcullingjob_p.h b/src/render/jobs/frustumcullingjob_p.h
index f81e4c5b9..cddbbd409 100644
--- a/src/render/jobs/frustumcullingjob_p.h
+++ b/src/render/jobs/frustumcullingjob_p.h
@@ -63,6 +63,7 @@ namespace Render {
class Entity;
class EntityManager;
+class NodeManagers;
struct Plane;
class FrustumCullingJob : public Qt3DCore::QAspectJob
@@ -73,6 +74,7 @@ public:
QT3D_ALIGNED_MALLOC_AND_FREE()
inline void setRoot(Entity *root) Q_DECL_NOTHROW { m_root = root; }
+ inline void setManagers(NodeManagers *manager) Q_DECL_NOTHROW { m_manager = manager; }
inline void setActive(bool active) Q_DECL_NOTHROW { m_active = active; }
inline bool isActive() const Q_DECL_NOTHROW { return m_active; }
inline void setViewProjection(const Matrix4x4 &viewProjection) Q_DECL_NOTHROW { m_viewProjection = viewProjection; }
@@ -86,6 +88,7 @@ private:
void cullScene(Entity *e, const Plane *planes);
Matrix4x4 m_viewProjection;
Entity *m_root;
+ NodeManagers *m_manager;
QVector<Entity *> m_visibleEntities;
bool m_active;
};