Engine
Frameworkcreatedbymeusableforthecreationofsimplegames.CurrentlysupportsOpenGL(Verysimple)andVulkan.
LightComponent.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include "Engine/api.hpp"
7 
8 #include <ThirdParty/EASTL-master/include/EASTL/string.h>
9 #include <ThirdParty/glm/glm/detail/type_vec3.hpp>
10 
11 namespace Engine {
12 
13  class Renderer;
14 #ifdef USING_VULKAN
15  class VulkanRenderer;
16 #endif
17 
19  {
20  public:
21  ~LightComponent();
22 
33  void SetLightName(eastl::string name);
34 
39  eastl::string GetLightName() const;
40 
45  void SetLightType(LightType type);
46 
51  LightType GetLightType() const;
52 
58  void SetLightPosition(glm::vec3 position);
59 
64  glm::vec3 GetLightPosition();
65 
71  void SetLightDirection(glm::vec3 direction);
72 
77  glm::vec3 GetLightDirection();
78 
83  void SetLightColor(glm::vec3 color);
84 
89  glm::vec3 GetLightColor();
90 
96  void SetLightRadius(float radius);
97 
102  float GetLightRadius() const;
103 
109  void SetLightConeInnerAngle(float angle);
110 
115  float GetLightConeInnerAngle();
116 
122  void SetLightConeOuterAngle(float angle);
123 
128  float GetLightConeOuterAngle();
129 
145  explicit LightComponent(eastl::string name, LightType type, glm::vec3 position, glm::vec3 direction, glm::vec3 color,
146  float radius, float attunuation, float coneInnerAngle, float coneOuterAngle) noexcept;
147 
152  explicit LightComponent(eastl::string name) noexcept;
153 
154  private:
155  friend class Entity;
156 
157  void InitializeComponent() override;
158 
159  void Update() override;
160 
161  eastl::string lightName;
162 
163  bool vulkanEnabled;
164  bool active;
165  bool created;
166 
167 #ifdef USING_OPENGL
168  eastl::weak_ptr<Renderer> renderer;
169 #endif
170 #ifdef USING_VULKAN
171  eastl::weak_ptr<VulkanRenderer> renderer;
172 #endif
173 
174  Light lightInfo;
175  LightType lightType;
176  };
177 
178 }
This is the base class for components. NOTE: only the Entity class is allowed to create this object...
Definition: Component.hpp:16
Definition: Light.hpp:17
This object is able a holder object for components. NOTE: only the EntitySystem is allowed to create ...
Definition: Entity.hpp:13
#define ENGINE_API
Definition: api.hpp:25
enum ENGINE_API LightType
Enum containing the different types of lights that can be created.
Definition: Light.hpp:9