37 return _shadow_sources.size();
50 nassertr(index < _shadow_sources.size(),
nullptr);
51 return _shadow_sources[index];
61 for (
size_t i = 0; i < _shadow_sources.size(); ++i) {
62 delete _shadow_sources[i];
64 _shadow_sources.clear();
154 for (
size_t i = 0; i < _shadow_sources.size(); ++i) {
155 _shadow_sources[i]->set_needs_update(
true);
167 set_pos(pos.get_x(), pos.get_y(), pos.get_z());
179 _position.set(x, y, z);
208 _color /= 0.2126 * color.get_x() + 0.7152 * color.get_y() + 0.0722 * color.get_z();
281 std::cerr <<
"Light is already attached, can not call set_casts_shadows!" << std::endl;
284 _casts_shadows = flag;
295 return _casts_shadows;
311 nassertv(resolution >= 32 && resolution <= 16384);
312 _source_resolution = resolution;
325 return _source_resolution;
341 _ies_profile = profile;
364 return _ies_profile >= 0;
390 nassertv(near_plane > 0.00001);
391 _near_plane = near_plane;
get_ies_profile
Returns the lights ies profile.
set_energy
Sets the energy of the light.
get_light_type
Returns the type of the light.
set_pos
Sets the position of the light.
get_shadow_map_resolution
Returns the shadow map resolution.
void invalidate_shadows()
Invalidates the shadows.
void set_needs_update(bool flag)
Sets whether the light needs an update.
set_casts_shadows
Controls whether the light casts shadows.
set_ies_profile
Sets the ies profile.
size_t get_num_shadow_sources() const
RenderPipeline.
get_casts_shadows
Returns whether the light casts shadows.
ShadowSource * get_shadow_source(size_t index) const
Returns the n-th shadow source.
bool get_needs_update() const
Returns whether the light needs an update.
set_near_plane
Sets the near plane of the light.
set_color
Sets the lights color.
set_shadow_map_resolution
Sets the lights shadow map resolution.
get_energy
Returns the energy of the light.
void clear_shadow_sources()
Clears all shadow source.
get_color
Returns the lights color.
bool has_slot() const
Returns whether the light has a slot.
LightType
Different types of light.
void remove_slot()
Removes the light slot.
get_pos
Returns the position of the light.
void assign_slot(int slot)
Assigns a slot to the light.
int get_slot() const
Returns the slot of the light.
has_ies_profile
Returns whether the light has an ies profile assigned.
clear_ies_profile
Clears the ies profile.
get_near_plane
Returns the near plane of the light.