Represents a light component with different light types. More...
#include <components.hpp>
Public Types | |
| enum class | LightType { DIRECTIONAL , POINT , SPOT , AMBIENT } |
| Enumeration of light types. More... | |
Public Member Functions | |
| void | CalculateShadowMatrix (const TransformComponent &tr, const class Camera &cam) |
| Calculates the shadow matrix for the light. | |
| void | move (LightComponent &other) |
| Moves the attributes of another LightComponent instance. | |
| LightComponent (LightType lt, glm::vec3 color_, float intensity_, float range_, float inner_, float outer_, glm::ivec2 screenSize) | |
| Constructs a light component with given parameters. | |
Public Attributes | |
| enum Raftel::LightComponent::LightType | type |
| glm::vec3 | color |
| float | intensity |
| float | range |
| float | innerCone |
| float | outerCone |
| float | near |
| float | far |
| std::unique_ptr< ShadowMap > | shadowMap |
| float | fov |
| std::vector< glm::mat4 > | lightSpaceMatrix |
Represents a light component with different light types.
Definition at line 141 of file components.hpp.
|
strong |
Enumeration of light types.
| Enumerator | |
|---|---|
| DIRECTIONAL | Directional light (like sunlight). |
| POINT | Point light emitting in all directions. |
| SPOT | Spot light with an adjustable cone. |
| AMBIENT | Ambient light affecting all objects equally. |
Definition at line 145 of file components.hpp.
| Raftel::LightComponent::LightComponent | ( | LightType | lt, |
| glm::vec3 | color_, | ||
| float | intensity_, | ||
| float | range_, | ||
| float | inner_, | ||
| float | outer_, | ||
| glm::ivec2 | screenSize ) |
Constructs a light component with given parameters.
| lt | Type of the light. |
| color_ | Color of the light. |
| intensity_ | Intensity of the light. |
| range_ | Range of the light. |
| inner_ | Inner cone angle (for spotlights). |
| outer_ | Outer cone angle (for spotlights). |
| screenSize | The screen size used for shadow mapping. |
| void Raftel::LightComponent::CalculateShadowMatrix | ( | const TransformComponent & | tr, |
| const class Camera & | cam ) |
Calculates the shadow matrix for the light.
| tr | The transform component of the light. |
| cam | The camera reference. |
| void Raftel::LightComponent::move | ( | LightComponent & | other | ) |
Moves the attributes of another LightComponent instance.
| other | The LightComponent to move from. |
| glm::vec3 Raftel::LightComponent::color |
Color of the light.
Definition at line 152 of file components.hpp.
| float Raftel::LightComponent::far |
Far plane distance for shadow mapping.
Definition at line 158 of file components.hpp.
| float Raftel::LightComponent::fov |
Field of view for spotlights.
Definition at line 174 of file components.hpp.
| float Raftel::LightComponent::innerCone |
Inner cone angle for spotlights.
Definition at line 155 of file components.hpp.
| float Raftel::LightComponent::intensity |
Intensity of the light.
Definition at line 153 of file components.hpp.
| std::vector<glm::mat4> Raftel::LightComponent::lightSpaceMatrix |
Shadow matrices.
Definition at line 175 of file components.hpp.
| float Raftel::LightComponent::near |
Near plane distance for shadow mapping.
Definition at line 157 of file components.hpp.
| float Raftel::LightComponent::outerCone |
Outer cone angle for spotlights.
Definition at line 156 of file components.hpp.
| float Raftel::LightComponent::range |
Range for point and spotlights.
Definition at line 154 of file components.hpp.
| std::unique_ptr<ShadowMap> Raftel::LightComponent::shadowMap |
Shadow map associated with the light.
Definition at line 159 of file components.hpp.
| enum Raftel::LightComponent::LightType Raftel::LightComponent::type |
Type of the light.