Loading...
Searching...
No Matches
SpotLight.h
Go to the documentation of this file.
1//
2// Created by denzel on 08/08/2025.
3//
4
5#pragma once
6#include "hellfire/ecs/LightComponent.h"
7#include "../../ecs/Entity.h"
8
9namespace hellfire {
10 class SpotLight {
11 public:
12 static Entity *create(const std::string &name = "SpotLight",
13 const glm::vec3 &position = glm::vec3(0.0f),
14 const glm::vec3 &direction = glm::vec3(0.0f, -1.0f, 0.0f),
15 const glm::vec3 &color = glm::vec3(1.0f),
16 float intensity = 1.0f,
17 float range = 10.0f,
18 float inner_angle = 30.0f,
19 float outer_angle = 45.0f) {
20 Entity *entity = new Entity(name);
21 auto *light = entity->add_component<LightComponent>(LightComponent::LightType::SPOT);
22
23 light->set_direction(direction);
24 light->set_color(color);
25 light->set_intensity(intensity);
26 light->set_range(range);
27 light->set_inner_cone_angle(inner_angle);
28 light->set_outer_cone_angle(outer_angle);
29
31
32 return entity;
33 }
34 };
35}
TransformComponent * transform()
Definition Entity.cpp:42
static Entity * create(const std::string &name="SpotLight", const glm::vec3 &position=glm::vec3(0.0f), const glm::vec3 &direction=glm::vec3(0.0f, -1.0f, 0.0f), const glm::vec3 &color=glm::vec3(1.0f), float intensity=1.0f, float range=10.0f, float inner_angle=30.0f, float outer_angle=45.0f)
Definition SpotLight.h:12
void set_position(float x, float y, float z)