3#include "Engine/Component/LogicComponent.h"
29 const glm::vec3 & color = glm::vec3( 1.0f ),
30 float intensity = 1.0f,
32 float angularDiameterDegrees = 0.53f
const glm::vec3 & getDirectionOverride() const
Gets the explicit light direction override.
bool hasDirectionOverride_
bool castsShadows() const
Checks whether this light casts shadows.
static constexpr const char * ComponentName
Component type name.
void setCastsShadows(bool castsShadows)
Enables or disables shadow casting and syncs ECS data.
std::string disableReason_
void setAngularDiameterDegrees(float angularDiameterDegrees)
Sets the apparent angular diameter and syncs ECS data.
void setDisableReason(std::string reason)
Sets the reason this light is disabled.
void clearDirectionOverride()
Clears the explicit light direction override and syncs ECS data.
void disableIfConflicting()
void setEnabled(bool enabled)
Enables or disables the light and syncs ECS data.
void setIntensity(float intensity)
Sets the light intensity and syncs ECS data.
bool hasActiveEnabledConflict() const
static constexpr bool IsUnique
Only one directional light may be active per entity.
glm::vec3 directionOverride_
void clearDisableReason()
Clears the stored disable reason.
bool hasDisableReason() const
Checks whether a disable reason is set.
const std::string & getDebugName() const
Gets the optional debug name appended to the component name.
void endPlay() override
Called when the component is removed or the game ends.
void beginPlay() override
Called when the component is added to the scene or the game starts.
const glm::vec3 & getColor() const
Gets the light color multiplier.
bool isEnabled() const
Checks whether this light is enabled for rendering.
DirectionalLight(Entities::Scene *owningScene, const glm::vec3 &color=glm::vec3(1.0f), float intensity=1.0f, bool castsShadows=true, float angularDiameterDegrees=0.53f)
Creates a directional light component.
std::string getComponentName() const override
Gets the component type name for debugging/UI.
float getAngularDiameterDegrees() const
Gets the apparent angular diameter used for light softness.
void setDirectionOverride(const glm::vec3 &direction)
Sets an explicit normalized light direction and syncs ECS data.
float angularDiameterDegrees_
bool hasDirectionOverride() const
Checks whether an explicit light direction override is active.
const std::string & getDisableReason() const
Gets the reason this light was disabled.
float getIntensity() const
Gets the light intensity.
void setDebugName(std::string name)
Sets the debug name appended to the component name.
void setColor(const glm::vec3 &color)
Sets the light color multiplier and syncs ECS data.
Logic(Entities::Scene *owningScene)
Constructs a logic component owned by a scene.
Owns scene entities, actor lifetime, and the scene graph root.