Cleanup model loading flow.

Inlines the platform::LoadMujocoModel into the App class which simplifies
the logic and allows us to correctly display loading errors.

Also updates shortcuts:

Load Model (Ctrl+L) -> Open File (Ctrl+O)
Reload Model (Ctrl+R) -> Reload Model (Ctrl+L)

PiperOrigin-RevId: 840232553
Change-Id: I957d29046ae681d2aeb69310c3a2eec64d042d49
This commit is contained in:
Haroon Qureshi
2025-12-04 07:17:45 -08:00
committed by Copybara-Service
parent 8823e9fedf
commit c5cd276e1f
4 changed files with 67 additions and 74 deletions
+3 -1
View File
@@ -130,8 +130,9 @@ class App {
std::string last_print_data_file;
};
void OnModelLoaded(std::string_view model_file);
void ClearModel();
void ProcessPendingLoad();
bool IsModelLoaded() const;
void ResetPhysics();
void UpdatePhysics();
@@ -173,6 +174,7 @@ class App {
platform::SimProfiler profiler_;
platform::SimHistory history_;
mjSpec* spec_ = nullptr;
mjModel* model_ = nullptr;
mjData* data_ = nullptr;