Crimson Engine
1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Toggle main menu visibility
Loading...
Searching...
No Matches
LightComponent.hpp
Go to the documentation of this file.
1
#pragma once
2
#include <glm/glm.hpp>
3
#include "
core/EngineAPI.hpp
"
4
#include "
meta/ComponentReflection.hpp
"
5
6
7
namespace
Engine
{
8
13
enum class
LightType
{
15
Directional
= 0,
17
Point
= 1,
19
Spot
= 2
20
};
21
26
// [ReflectClass]
27
struct
ENGINE_API
LightComponent
{
29
LightType
type
=
LightType::Directional
;
31
// [ReflectField]
32
glm::vec3
color
{ 1.0f, 1.0f, 1.0f };
34
// [ReflectField]
35
float
intensity
= 1.0f;
37
// [ReflectField]
38
float
range
= 10.0f;
39
};
40
41
42
}
// namespace Engine
43
44
REGISTER_COMPONENT
(
Engine::LightComponent
,
"Rendering & Lights/Light"
);
45
46
47
ComponentReflection.hpp
REGISTER_COMPONENT
#define REGISTER_COMPONENT(Type, MenuPath)
Definition
ComponentReflection.hpp:156
EngineAPI.hpp
ENGINE_API
#define ENGINE_API
Definition
EngineAPI.hpp:10
Engine
Definition
Application.hpp:16
Engine::LightType
LightType
Type of light source calculation.
Definition
LightComponent.hpp:13
Engine::LightType::Point
@ Point
Omnidirectional point light source.
Definition
LightComponent.hpp:17
Engine::LightType::Spot
@ Spot
Cone-constrained spot light source.
Definition
LightComponent.hpp:19
Engine::LightType::Directional
@ Directional
Global directional light (e.g., Sun).
Definition
LightComponent.hpp:15
Engine::LightComponent
Component representing a light source in the scene.
Definition
LightComponent.hpp:27
Engine::LightComponent::type
LightType type
Type classification of the light source.
Definition
LightComponent.hpp:29
Engine::LightComponent::range
float range
Attenuation distance range for point and spot lights.
Definition
LightComponent.hpp:38
Engine::LightComponent::color
glm::vec3 color
RGB light color vector.
Definition
LightComponent.hpp:32
Engine::LightComponent::intensity
float intensity
Intensity multiplier for brightness.
Definition
LightComponent.hpp:35
engine
include
ecs
components
LightComponent.hpp
Generated by
1.17.0