MCPcopy Create free account
hub / github.com/NazaraEngine/NazaraEngine / OnEntityRemoved

Method OnEntityRemoved

SDK/src/NDK/Systems/RenderSystem.cpp:50–68  ·  view source on GitHub ↗

! * \brief Operation to perform when an entity is removed * * \param entity Pointer to the entity */

Source from the content-addressed store, hash-verified

48 * \param entity Pointer to the entity
49 */
50 void RenderSystem::OnEntityRemoved(Entity* entity)
51 {
52 m_forceRenderQueueInvalidation = true; //< Hackfix until lights and particles are handled by culling list
53
54 for (auto it = m_cameras.begin(); it != m_cameras.end(); ++it)
55 {
56 if (it->GetObject() == entity)
57 {
58 m_cameras.erase(it);
59 break;
60 }
61 }
62
63 if (entity->HasComponent<GraphicsComponent>())
64 {
65 GraphicsComponent& gfxComponent = entity->GetComponent<GraphicsComponent>();
66 gfxComponent.RemoveFromCullingList(&m_drawableCulling);
67 }
68 }
69
70 /*!
71 * \brief Operation to perform when entity is validated for the system

Callers

nothing calls this directly

Calls 2

beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected