! * \brief Operation to perform when an entity is removed * * \param entity Pointer to the entity */
| 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 |