Files
sophia/editor/panels/inspector_panel.cpp
T
burkkyy dffb7b7972 Changes:
- editor project
- build system fixes
- dummy data editor panels mock
2026-09-16 02:28:42 -07:00

37 lines
989 B
C++

#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();
}