Graphics/GraphicsComponent: Add visibility control

This commit is contained in:
Jérôme Leclercq
2021-11-24 22:07:56 +01:00
parent c9aba016a8
commit d2cfc5fdf5
5 changed files with 105 additions and 5 deletions

View File

@@ -41,6 +41,7 @@ namespace Nz
void OnGraphicsDestroy(entt::registry& registry, entt::entity entity);
void OnNodeDestroy(entt::registry& registry, entt::entity entity);
void UpdateInstances(entt::registry& registry);
void UpdateVisibility(entt::registry& registry);
struct CameraEntity
{
@@ -51,6 +52,7 @@ namespace Nz
{
NazaraSlot(GraphicsComponent, OnRenderableAttached, onRenderableAttached);
NazaraSlot(GraphicsComponent, OnRenderableDetach, onRenderableDetach);
NazaraSlot(GraphicsComponent, OnVisibilityUpdate, onVisibilityUpdate);
NazaraSlot(Node, OnNodeInvalidation, onNodeInvalidation);
};
@@ -64,6 +66,8 @@ namespace Nz
std::unique_ptr<FramePipeline> m_pipeline;
std::unordered_map<entt::entity, CameraEntity> m_cameraEntities;
std::unordered_map<entt::entity, GraphicsEntity> m_graphicsEntities;
std::unordered_set<entt::entity> m_newlyHiddenEntities;
std::unordered_set<entt::entity> m_newlyVisibleEntities;
};
}