Loading...
Searching...
No Matches
DirectionalLight.cpp
Go to the documentation of this file.
1//
2// Created by denzel on 29/09/2025.
3//
4#include "hellfire/graphics/lighting/DirectionalLight.h"
5
6#include "hellfire/scene/Scene.h"
7
8namespace hellfire {
9 EntityID DirectionalLight::create(Scene *scene, const std::string &name, const glm::vec3 &direction,
10 const glm::vec3 &color, float intensity) {
11 EntityID id = scene->create_entity(name);
12 Entity* entity = scene->get_entity(id);
13
14 auto* light = entity->add_component<LightComponent>(LightComponent::LightType::DIRECTIONAL);
15 light->set_direction(direction);
16 light->set_color(color);
17 light->set_intensity(intensity);
18
19 return id;
20 }
21}
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