Minor UI improvements.

AnimGraphEditor
Martin Felis 2023-03-16 23:51:49 +01:00
parent aa9ab1def1
commit 8a91c7700a
1 changed files with 38 additions and 12 deletions

View File

@ -28,7 +28,9 @@ const int MaxIndices = MaxVertices * 3;
uint64_t last_time = 0; uint64_t last_time = 0;
bool show_imgui_demo_window = false; bool show_imgui_demo_window = false;
bool show_another_window = false; bool show_another_window = false;
bool show_graph_editor = true; bool show_graph_editor = false;
bool show_camera_dialog = false;
bool show_skinned_mesh_dialog = false;
sg_pass_action pass_action; sg_pass_action pass_action;
sg_pipeline pip; sg_pipeline pip;
@ -420,27 +422,51 @@ int main() {
} }
if (ImGui::BeginMainMenuBar()) { if (ImGui::BeginMainMenuBar()) {
ImGui::Text("AnimTestbed"); if (ImGui::BeginMenu("File"))
ImGui::Checkbox("Graph Editor", &show_graph_editor); {
ImGui::Checkbox("ImGui Demo", &show_imgui_demo_window); if (ImGui::MenuItem("Quit")) {
glfwSetWindowShouldClose(w, true);
}
ImGui::EndMenu();
}
if (ImGui::BeginMenu("View"))
{
ImGui::Checkbox("Graph Editor", &show_graph_editor);
ImGui::Checkbox("Camera Settings", &show_camera_dialog);
ImGui::Checkbox("Skinned Mesh", &show_skinned_mesh_dialog);
ImGui::Separator();
ImGui::Checkbox("ImGui Demo", &show_imgui_demo_window);
ImGui::EndMenu();
}
ImGui::EndMainMenuBar(); ImGui::EndMainMenuBar();
} }
// Animation Runtime // Animation Runtime
{ {
ImGui::Begin("Camera"); if (show_camera_dialog) {
ImGui::SliderFloat3("pos", state.camera.pos, -100.f, 100.f); ImGui::SetNextWindowPos(ImVec2(600, 30), ImGuiCond_FirstUseEver);
ImGui::SliderFloat("near", &state.camera.near, 0.001f, 10.f); ImGui::SetNextWindowSize(ImVec2(300, 170), ImGuiCond_FirstUseEver);
ImGui::SliderFloat("far", &state.camera.far, 1.0f, 10000.f);
ImGui::SliderFloat("heading", &state.camera.heading, -180.0f, 180.f); ImGui::Begin("Camera", &show_camera_dialog);
ImGui::SliderFloat("pitch", &state.camera.pitch, -179.0f, 179.f); ImGui::SliderFloat3("pos", state.camera.pos, -100.f, 100.f);
ImGui::End(); ImGui::SliderFloat("near", &state.camera.near, 0.001f, 10.f);
ImGui::SliderFloat("far", &state.camera.far, 1.0f, 10000.f);
ImGui::SliderFloat("heading", &state.camera.heading, -180.0f, 180.f);
ImGui::SliderFloat("pitch", &state.camera.pitch, -179.0f, 179.f);
ImGui::End();
}
ImGui::SetNextWindowPos(ImVec2(600, 60), ImGuiCond_FirstUseEver); ImGui::SetNextWindowPos(ImVec2(600, 60), ImGuiCond_FirstUseEver);
ImGui::SetNextWindowSize(ImVec2(300, 400), ImGuiCond_FirstUseEver); ImGui::SetNextWindowSize(ImVec2(300, 400), ImGuiCond_FirstUseEver);
draw_grid(); draw_grid();
skinned_mesh.DrawDebugUi();
if (show_skinned_mesh_dialog) {
skinned_mesh.DrawDebugUi();
}
// TODO: add AnimGraph to calculate pose // TODO: add AnimGraph to calculate pose
// skinned_mesh.CalcModelMatrices(); // skinned_mesh.CalcModelMatrices();