- editor project
- build system fixes
- dummy data editor panels mock
This commit is contained in:
2026-09-16 02:28:42 -07:00
parent 169ff4a277
commit dffb7b7972
11 changed files with 241 additions and 9 deletions
+36
View File
@@ -0,0 +1,36 @@
#include "inspector_panel.hpp"
#include <imgui.h>
#include <cstdio>
void InspectorPanel::onUpdate(const sophia::FrameInfo&) {
ImGui::Begin("Inspector");
char nameBuf[128];
std::snprintf(nameBuf, sizeof(nameBuf), "%s", name.c_str());
if (ImGui::InputText("Name", nameBuf, sizeof(nameBuf))) {
name = nameBuf;
}
ImGui::Text("Tag: %s", tag.c_str());
ImGui::Separator();
if (ImGui::CollapsingHeader("Transform", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::DragFloat3("Position", &position.x, 0.1f);
ImGui::DragFloat3("Rotation", &rotation.x, 0.1f);
ImGui::DragFloat3("Scale", &scale.x, 0.1f);
}
if (ImGui::CollapsingHeader("Mesh Renderer",
ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::Text("Mesh: %s", meshName.c_str());
ImGui::Text("Material: %s", materialName.c_str());
}
if (ImGui::CollapsingHeader("Script", ImGuiTreeNodeFlags_DefaultOpen)) {
ImGui::Text("%s", scriptName.c_str());
}
ImGui::End();
}