2022-06-04 16:26:58 +00:00
|
|
|
#include "GUI.h"
|
|
|
|
|
2022-07-10 13:52:25 +00:00
|
|
|
void SceneExplorer(Scene& scene, std::string PanelName) {
|
2022-08-06 16:21:42 +00:00
|
|
|
if (ImGui::Begin(PanelName.c_str())) {
|
|
|
|
ImGui::ListBoxHeader("##ObjectList");
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
Node& current = scene.GetRoot();
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
Node* next = ¤t;
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
// Show first node
|
|
|
|
ImGui::Selectable(next->name.c_str(), true);
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
ImGui::Indent();
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
if (next->children.size() != 0) {
|
|
|
|
for (auto child : next->children)
|
|
|
|
{
|
|
|
|
std::string& name = child->name;
|
|
|
|
ImGui::Selectable(name.c_str(), false);
|
|
|
|
}
|
2022-07-10 13:52:25 +00:00
|
|
|
}
|
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
ImGui::ListBoxFooter();
|
2022-07-10 13:52:25 +00:00
|
|
|
|
2022-08-06 16:21:42 +00:00
|
|
|
|
|
|
|
}
|
2022-07-10 13:52:25 +00:00
|
|
|
ImGui::End();
|
2022-08-06 16:21:42 +00:00
|
|
|
|
|
|
|
|
2022-07-10 13:52:25 +00:00
|
|
|
}
|
|
|
|
|
2022-06-04 16:26:58 +00:00
|
|
|
void CameraTool(Camera* cam) {
|
|
|
|
|
|
|
|
ImGui::Begin("Camera");
|
|
|
|
|
|
|
|
ImGui::SliderFloat("Zoom:", &cam->Zoom, 10, 190);
|
|
|
|
|
|
|
|
ImGui::InputFloat3("Position:", &cam->Position[0]);
|
|
|
|
|
|
|
|
ImGui::InputFloat3("Rotation:", &cam->Rotation[0]);
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
}
|
|
|
|
|
|
|
|
void ScriptingTool(char* code) {
|
|
|
|
ImGui::Begin("Scripting");
|
|
|
|
|
|
|
|
ImGui::InputTextMultiline("Lua Script", code, 255);
|
|
|
|
bool runCode = ImGui::Button("Run");
|
|
|
|
|
|
|
|
|
|
|
|
ImGui::End();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void transformWindow(Transform& transform, std::string PanelName) {
|
|
|
|
ImGui::Begin(PanelName.c_str());
|
|
|
|
ImGui::InputFloat3("Position:", (float*)&transform.Position[0]);
|
|
|
|
ImGui::InputFloat3("Rotation:", (float*)&transform.Rotation[0]);
|
|
|
|
ImGui::InputFloat3("Scale:", (float*)&transform.Scale[0]);
|
|
|
|
ImGui::End();
|
|
|
|
|
2022-06-04 23:44:54 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void materialWindow(Material& material, std::string PanelName) {
|
|
|
|
ImGui::Begin(PanelName.c_str());
|
|
|
|
ImGui::ColorPicker3("Color:", &material.Color[0]);
|
|
|
|
ImGui::End();
|
2022-05-29 13:23:08 +00:00
|
|
|
}
|