cleanup and removing nasty segv upon entity deletion

+ Fixing bug where clicking an entity in the hierarchy didn't update the
stats
This commit is contained in:
Erris
2026-02-24 18:10:39 +01:00
parent 38b92611be
commit e69764e149
8 changed files with 96 additions and 148 deletions

View File

@@ -14,7 +14,6 @@
#include <ImGuizmo.h>
#include <cstdint>
#include <imgui.h>
#include <vector>
#include <string>
@@ -148,6 +147,7 @@ namespace OpenEngine {
clicked = true;
} else {
clicked = false;
selected_entity = scene_hierarchy.GetSelectedEntity();
}
framebuffer->Unbind();
@@ -310,7 +310,7 @@ namespace OpenEngine {
glm::mat4 camera_view = editor_camera.GetViewMatrix();
auto& transform_comp = selected_entity.GetComponents<TransformComponent>();
glm::mat4 transform = transform_comp.GetTransform();
glm::mat4 transform = GetTransformFromComp(transform_comp);
bool snap = Input::IsKeyPressed(KeyCode::LeftControl);
float snap_value = 0.1f;
@@ -333,7 +333,8 @@ namespace OpenEngine {
transform_comp.rotation += delta_rotation;
transform_comp.scale = scale;
}
}
} else
guizmo_operation = -1;
};
void OnImGuiRender() override