Mesh_Entities!

This commit is contained in:
2025-03-26 23:40:35 +01:00
parent 74268015a0
commit b6b1371af5
12 changed files with 145 additions and 31 deletions

View File

@@ -54,6 +54,33 @@ editor_ui :: () {
}
ImGui.End();
ImGui.Begin("Create Mesh Entity", flags=ImGui.WindowFlags.NoResize);
for mesh_entity_files {
ImGui.PushID(to_temp_c_string(it.full_path)) ;
defer ImGui.PopID();
if ImGui.Button(to_temp_c_string(it.full_path)) {
mesh_entity := new_mesh_entity(init=false);
mesh_entity.model_path = it.full_path;
init_entity(mesh_entity);
new_entity = mesh_entity;
break;
}
}
//set_position(*new_entity.transform, engine.editor.camera.position + engine.editor.camera.forward * 20.0);
//engine.editor.selected_entities.count = 0;
//array_add(*engine.editor.selected_entities, new_entity);
ImGui.End();
if new_entity != null {
set_position(*new_entity.transform, engine.editor.camera.position + engine.editor.camera.forward * 20.0);
engine.editor.selected_entities.count = 0;
array_add(*engine.editor.selected_entities, new_entity);
}
}
ImGui.Begin("Entities");