1#ifndef __LIGHT_COMPONENTS_HPP__
2#define __LIGHT_COMPONENTS_HPP__ 1
5#include <glm/gtc/matrix_transform.hpp>
6#include <glm/gtx/quaternion.hpp>
7#include <glm/gtc/matrix_access.hpp>
47 return glm::normalize(glm::column(
transform, 1));
55 return glm::normalize(glm::column(
transform, 0));
63 return glm::normalize(glm::column(
transform, 2));
84 auto quat = glm::quat(glm::radians(
rotation));
85 glm::mat4 rotationMatrix = glm::mat4_cast(quat);
87 transform = translationMatrix * rotationMatrix * scaleMatrix;
187 LightComponent(
LightType lt, glm::vec3 color_,
float intensity_,
float range_,
float inner_,
float outer_, glm::ivec2 screenSize);
Camera class for handling movement and view transformations.
ScriptComponent(const std::string &script)
Constructs a script component with the given script code.
~ScriptComponent()
Destructor that cleans up the Lua state.
void ExecuteFunction(const std::string &functionName)
Executes a Lua function within the script.
Defines the Vertex, Mesh, and MeshFactory for handling and rendering 3D mesh data.
Header file for managing the shadow map in OpenGL.
BasicComponent()
Default constructor.
void SetName(std::string n_)
Sets the name of the component.
std::unique_ptr< ShadowMap > shadowMap
void move(LightComponent &other)
Moves the attributes of another LightComponent instance.
std::vector< glm::mat4 > lightSpaceMatrix
void CalculateShadowMatrix(const TransformComponent &tr, const class Camera &cam)
Calculates the shadow matrix for the light.
LightComponent(LightType lt, glm::vec3 color_, float intensity_, float range_, float inner_, float outer_, glm::ivec2 screenSize)
Constructs a light component with given parameters.
LightType
Enumeration of light types.
Represents a mesh component.
std::weak_ptr< Mesh > mesh
RenderComponent(bool vis)
Constructor for render component.