33 auto itInv = _lightsInverse.find(light);
34 if (itInv != _lightsInverse.end())
44 const size_t id = _IDctr++;
45 _lights.insert({id, light});
46 _lightsInverse.insert({light,
id});
53 auto it = _lights.find(
id);
54 if (it != _lights.end())
56 auto light = it->second;
58 auto itInv = _lightsInverse.find(light);
59 assert(itInv != _lightsInverse.end());
60 if (itInv != _lightsInverse.end())
61 _lightsInverse.erase(itInv);
71 auto itInv = _lightsInverse.find(light);
73 if (itInv != _lightsInverse.end())
75 const size_t id = itInv->second;
76 auto it = _lights.find(
id);
77 assert(it != _lights.end());
78 if (it != _lights.end())
85 auto it = _lights.find(
id);
86 if (it != _lights.end())
100 _lightsInverse.clear();
void markModified(const bool triggerCallback=true)
PLATFORM_API void clearLights()
clearLights Removes all light sources managed by the LightManager object.
PLATFORM_API void removeLight(const size_t id)
removeLight Removes a light source from the scene for a given ID.
PLATFORM_API const std::map< size_t, LightPtr > & getLights() const
getLights Gets all light sources currently managed by the LightManager object.
PLATFORM_API size_t addLight(LightPtr light)
addLight Attaches a light source to the scene.
PLATFORM_API LightPtr getLight(const size_t id)
getLight Gets a light source from the scene for a given ID. Note: If changing the light then call mar...
std::shared_ptr< Light > LightPtr