Skip to content

Commit 0065adb

Browse files
committed
update visualizer_gui.cpp
1 parent 8363ad8 commit 0065adb

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/candlewick/multibody/internal/visualizer_gui.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -73,22 +73,24 @@ void Visualizer::defaultGuiCallback() {
7373
guiAddLightControls(light);
7474
guiAddCameraParams(controller, cameraParams);
7575

76-
auto add_env_checkbox = [this](const char *title, entt::entity ent) {
76+
auto addDebugCheckbox = [this](const char *title,
77+
entt::entity ent) -> auto & {
7778
char label[32];
7879
SDL_snprintf(label, sizeof(label), "hud.%s", title);
7980
auto &dmc = registry.get<DebugMeshComponent>(ent);
8081
ImGui::Checkbox(label, &dmc.enable);
82+
return dmc;
8183
};
8284
if (ImGui::CollapsingHeader("Settings (HUD and env)",
8385
ImGuiTreeNodeFlags_DefaultOpen)) {
84-
add_env_checkbox("grid", m_grid);
85-
ImGui::SameLine();
8686
{
87-
auto &dmc = registry.get<DebugMeshComponent>(m_grid);
87+
auto &dmc = addDebugCheckbox("grid", m_grid);
88+
ImGui::SameLine();
8889
ImGui::ColorEdit4("hud.grid.color", dmc.colors[0].data(),
8990
ImGuiColorEditFlags_AlphaPreview);
9091
}
91-
add_env_checkbox("triad", m_triad);
92+
addDebugCheckbox("triad", m_triad);
93+
ImGui::SameLine();
9294
guiAddDisableCheckbox("Render plane", registry, m_plane,
9395
envStatus.show_plane);
9496
}

0 commit comments

Comments
 (0)