1#include "PointLightComponent.h"
2#include "imgui/imgui/imgui.h"
3#include "core/renderer/shapes/Quad3d.h"
4#include "core/ecs/components/TransformComponent.h"
5#include "core/ecs/components/model/ModelComponent.h"
6#include "core/ecs/ECS.h"
7#include "common/maths/Vec.h"
11 PointLightComponent::PointLightComponent(Maths::Vec3 color)
16 void PointLightComponent::Draw(
Camera* camera)
18 auto component = ECS::GetComponent(ComponentType::TransformComponent, m_OwnerEntityID);
20 float scale =
dynamic_cast<TransformComponent*
>(component.get())->GetScale().x;
24 if (m_Shader ==
nullptr)
26 m_Shader = Vivid::Shader::Create(
"./../assets/shaders/basic.vertexShader.glsl",
27 "./../assets/shaders/basic.pixelShader.glsl");
31 m_Mesh->BindShader(m_Shader);
33 modelComponent->AddMesh(m_Mesh);
34 modelComponent->SetEntity(m_OwnerEntityID);
35 modelComponent->Draw(camera);
38 void PointLightComponent::ImGuiRender()
40 ImGui::ColorPicker3(
"Color", &m_Color.x);
41 ImGui::SliderFloat(
"Intensity", &m_Intensity, 0.0f, 10.0f);
A class that represents the camera.
Contains a ModelComponent.