1#include "Lighting/LightManager.h"
2#include "imgui/imgui.h"
4#include "glm/gtc/type_ptr.hpp"
10LightManager::LightManager()
12 lightManagerID = ID++;
14 position.x = position.z = 0.0f;
15 color[0] = color[1] = color[2] = color[3] = 0.8;
16 ambientColor[0] = ambientColor[1] = ambientColor[2] = ambientColor[3] = 0.8;
20LightManager::~LightManager()
24void LightManager::ShowSettings(
bool renderWindow,
bool *pOpen)
30 ImGui::Begin((
"Light Setting##" + std::to_string(lightManagerID)).c_str(), pOpen);
33 ImGui::Text(
"Strength");
34 ImGui::DragFloat(
"##lightStrength", &strength, 0.1f);
35 ImGui::Text(
"Position");
36 ImGui::DragFloat3(
"##lightPosition", &position[0], 0.01f);
39 ImGui::Text(
"Light Color");
40 ImGui::ColorEdit3(
"##lightColor", color);
52 tmp[
"x"] = position.x;
53 tmp[
"y"] = position.y;
54 tmp[
"z"] = position.z;
55 data[
"position"] = tmp;
62 data[
"strength"] = strength;
68 position[0] = data[
"position"][
"x"];
69 position[1] = data[
"position"][
"y"];
70 position[2] = data[
"position"][
"z"];
71 color[0] = data[
"color"][
"r"];
72 color[1] = data[
"color"][
"g"];
73 color[2] = data[
"color"][
"b"];
74 color[3] = data[
"color"][
"a"];
75 strength = data[
"strength"];
a class to store JSON values
basic_json<> json
default JSON class