From 5506fbf506bad18d128f28f57dfd644e3dbe4a86 Mon Sep 17 00:00:00 2001 From: Haroon Qureshi Date: Thu, 5 Mar 2026 01:23:12 -0800 Subject: [PATCH] Rename member `history_` to `sim_history_`. PiperOrigin-RevId: 878906079 Change-Id: I1327f0216bc5042e62c598f2b7f15f6a26c192dc --- src/experimental/studio/app.cc | 24 ++++++++++++------------ src/experimental/studio/app.h | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/experimental/studio/app.cc b/src/experimental/studio/app.cc index 137797f0..36e0786a 100644 --- a/src/experimental/studio/app.cc +++ b/src/experimental/studio/app.cc @@ -154,7 +154,7 @@ void App::Recompile() { mj_recompile(model_holder_->spec(), model_holder_->vfs(), model_holder_->model(), model_holder_->data()); const int state_size = mj_stateSize(model(), mjSTATE_INTEGRATION); - history_.Init(state_size); + sim_history_.Init(state_size); } void App::RequestModelLoad(std::string model_file) { @@ -216,7 +216,7 @@ void App::OnModelLoaded(std::string filename, ModelKind model_kind) { mjModel* model = model_holder_->model(); renderer_->Init(model); const int state_size = mj_stateSize(model, mjSTATE_INTEGRATION); - history_.Init(state_size); + sim_history_.Init(state_size); if (!preserve_camera_on_load_) { const int model_cam = model->vis.global.cameraid; @@ -331,7 +331,7 @@ void App::UpdatePhysics() { if (stepped) { profiler_.Update(model(), data()); - std::span state = history_.AddToHistory(); + std::span state = sim_history_.AddToHistory(); if (!state.empty()) { mj_getState(model(), data(), state.data(), mjSTATE_INTEGRATION); } @@ -339,7 +339,7 @@ void App::UpdatePhysics() { } void App::LoadHistory(int offset) { - std::span state = history_.SetIndex(offset); + std::span state = sim_history_.SetIndex(offset); if (!state.empty()) { // Pause simulation when entering history mode. step_control_.SetPauseState(PauseState::kNormalPaused); @@ -611,14 +611,14 @@ void App::HandleKeyboardEvents() { SetSpeedIndex(tmp_.speed_index - 1); } else if (ImGui_IsChordJustPressed(ImGuiKey_LeftArrow)) { if (step_control_.GetPauseState() == PauseState::kNormalPaused) { - LoadHistory(history_.GetIndex() - 1); + LoadHistory(sim_history_.GetIndex() - 1); } } else if (ImGui_IsChordJustPressed(ImGuiKey_RightArrow)) { if (step_control_.GetPauseState() == PauseState::kNormalPaused) { - if (history_.GetIndex() == 0) { + if (sim_history_.GetIndex() == 0) { step_control_.RequestSingleStep(); } else { - LoadHistory(history_.GetIndex() + 1); + LoadHistory(sim_history_.GetIndex() + 1); } } } else if (ImGui_IsChordJustPressed(ImGuiMod_Ctrl | ImGuiKey_Space)) { @@ -1698,15 +1698,15 @@ void App::StatusBarGui() { style.Color(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_WindowBg]); ImGui::SameLine(); if (ImGui::Button(ICON_PREV_FRAME)) { - LoadHistory(history_.GetIndex() - 1); + LoadHistory(sim_history_.GetIndex() - 1); } ImGui::SetItemTooltip("%s", "Previous Frame"); style.Reset(); ImGui::SameLine(); ImGui::SetNextItemWidth(450); - int index = history_.GetIndex(); - if (ImGui::SliderInt("##ScrubIndex", &index, 1 - history_.Size(), 0)) { + int index = sim_history_.GetIndex(); + if (ImGui::SliderInt("##ScrubIndex", &index, 1 - sim_history_.Size(), 0)) { LoadHistory(index); } @@ -1714,10 +1714,10 @@ void App::StatusBarGui() { style.Color(ImGuiCol_Button, ImGui::GetStyle().Colors[ImGuiCol_WindowBg]); ImGui::SameLine(); if (ImGui::Button(ICON_NEXT_FRAME)) { - if (history_.GetIndex() == 0) { + if (sim_history_.GetIndex() == 0) { step_control_.RequestSingleStep(); } else { - LoadHistory(history_.GetIndex() + 1); + LoadHistory(sim_history_.GetIndex() + 1); } } ImGui::SetItemTooltip("%s", "Next Frame"); diff --git a/src/experimental/studio/app.h b/src/experimental/studio/app.h index 8edf1825..2fb1c767 100644 --- a/src/experimental/studio/app.h +++ b/src/experimental/studio/app.h @@ -251,7 +251,7 @@ class App { platform::StepControl step_control_; platform::SimProfiler profiler_; - platform::SimHistory history_; + platform::SimHistory sim_history_; platform::SpecEditor spec_editor_; std::vector search_paths_; std::vector pixels_;