Added spot light type 🔦 & light direction now using global rotation

This commit is contained in:
Antoine Pilote
2024-07-28 11:50:14 -04:00
parent d4feaa15ec
commit 516a93a7f0
6 changed files with 873 additions and 757 deletions

View File

@@ -63,6 +63,7 @@ public:
ComponentTableReset(component.Type, Nuake::LightType::Point);
}
ImGui::TableNextColumn();
if (component.Type == Nuake::LightType::Directional)
{
{
@@ -100,6 +101,33 @@ public:
}
}
}
else if (component.Type == Nuake::LightType::Spot)
{
{
ImGui::Text("Cutoff");
ImGui::TableNextColumn();
ImGui::DragFloat("##cutoff", &component.Cutoff, 1.0f, 0.0f, 360.0f);
ImGui::TableNextColumn();
// Clamp inner angle so it doesnt exceed outer angle.
component.Cutoff = glm::min(component.Cutoff, component.OuterCutoff);
ComponentTableReset(component.Cutoff, 12.5f);
ImGui::TableNextColumn();
}
{
ImGui::Text("Outer Cutoff");
ImGui::TableNextColumn();
ImGui::DragFloat("##outercutoff", &component.OuterCutoff, 1.0f, component.Cutoff, 360.0f);
ImGui::TableNextColumn();
ComponentTableReset(component.OuterCutoff, 30.0f);
ImGui::TableNextColumn();
}
}
}
EndComponentTable();
}