improved model loading and added model component

This commit is contained in:
Erris
2026-03-09 16:37:30 +01:00
parent ac18bb6f00
commit a0c900166f
15 changed files with 486 additions and 146 deletions

View File

@@ -28,6 +28,7 @@ namespace OpenEngine {
RegisterDrawer<SphereShapeComponent>("Sphere Shape", &SphereShapeOnImGuiRender);
RegisterDrawer<BoxShapeComponent>("Box Shape", &BoxShapeOnImGuiRender);
RegisterDrawer<PlaneShapeComponent>("Plane Shape", &PlaneShapeOnImGuiRender);
RegisterDrawer<ModelComponent>("Model", &ModelOnImGuiRender);
scene = context;
selected_context = {};
@@ -81,6 +82,11 @@ namespace OpenEngine {
selected_context.AddComponent<PlaneShapeComponent>();
ImGui::CloseCurrentPopup();
}
if (!selected_context.HasComponent<ModelComponent>())
if (ImGui::MenuItem("Model")) {
selected_context.AddComponent<ModelComponent>();
ImGui::CloseCurrentPopup();
}
}
void EntityPopup(Ref<Scene>& scene)