feat: Add "simple" inspector to the imgui panels
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
#include "destrum/ObjectModel/GameObject.h"
|
||||
#include "destrum/Util/GameState.h"
|
||||
|
||||
#include <imgui.h>
|
||||
|
||||
#include <stdexcept>
|
||||
|
||||
MeshRendererComponent::MeshRendererComponent(GameObject& parent): Component(parent, "MeshRendererComponent") {
|
||||
@@ -139,6 +141,30 @@ void MeshRendererComponent::ResolveReferences(const ObjectMap&) {
|
||||
}
|
||||
}
|
||||
|
||||
void MeshRendererComponent::ImGuiInspector() {
|
||||
if (meshID == NULL_MESH_ID) {
|
||||
ImGui::TextDisabled("Mesh: <none>");
|
||||
} else {
|
||||
ImGui::Text("Mesh ID: %zu", meshID);
|
||||
ImGui::TextWrapped(
|
||||
"Mesh key: %s",
|
||||
meshKey.empty() ? "<not resolved>" : meshKey.c_str());
|
||||
}
|
||||
|
||||
if (materialID == NULL_MATERIAL_ID) {
|
||||
ImGui::TextDisabled("Material: <none>");
|
||||
} else {
|
||||
ImGui::Text("Material ID: %u", materialID);
|
||||
ImGui::TextWrapped(
|
||||
"Material key: %s",
|
||||
materialKey.empty() ? "<not resolved>" : materialKey.c_str());
|
||||
}
|
||||
|
||||
ImGui::Text(
|
||||
"Skinning: %s",
|
||||
m_skinnedMesh != nullptr ? "active" : "static");
|
||||
}
|
||||
|
||||
void MeshRendererComponent::SetMeshID(MeshID id) {
|
||||
meshID = id;
|
||||
meshKey.clear();
|
||||
|
||||
Reference in New Issue
Block a user