Loading...
Searching...
No Matches
PointLight.cpp
Go to the documentation of this file.
1//
2// Created by denzel on 29/09/2025.
3//
4#include "hellfire/graphics/lighting/PointLight.h"
5
6#include "hellfire/scene/Scene.h"
7
8namespace hellfire {
9 EntityID PointLight::create(Scene *scene, const std::string &name, const glm::vec3 &position,
10 const glm::vec3 &color, float intensity, float range) {
11 EntityID id = scene->create_entity(name);
12 Entity *entity = scene->get_entity(id);
13
14 auto *light = entity->add_component<LightComponent>(LightComponent::LightType::POINT);
15 light->set_color(color);
16 light->set_intensity(intensity);
17 light->set_range(range);
18
20
21 return id;
22 }
23}
TransformComponent * transform()
Definition Entity.cpp:42
Manages a collection of entities and their hierarchical relationships.
Definition Scene.h:24
Entity * get_entity(EntityID id)
Retrieves an entity by its ID.
Definition Scene.cpp:81
EntityID create_entity(const std::string &name="GameObject")
Creates a new entity in the scene.
Definition Scene.cpp:29
void set_position(float x, float y, float z)