Add update_{hfield,mesh,texture} methods to the passive viewer.

Fixes #812.
Fixes #958.
Fixes #965.

PiperOrigin-RevId: 548181282
Change-Id: I6eb0cd2ce52c66083e83dd08d69e0cfb4178dbba
This commit is contained in:
Saran Tunyasuvunakool
2023-07-14 11:42:55 -07:00
committed by Copybara-Service
parent b5bef1b639
commit 0ccfef7314
6 changed files with 153 additions and 55 deletions
+10
View File
@@ -58,6 +58,10 @@ class Simulate {
// visualization.
void Sync();
void UpdateHField(int hfieldid);
void UpdateMesh(int meshid);
void UpdateTexture(int texid);
// Request that the Simulate UI thread render a new model
// optionally delete the old model and data when done
void Load(mjModel* m, mjData* d, const char* displayed_filename);
@@ -279,6 +283,12 @@ class Simulate {
// info strings
char info_title[Simulate::kMaxFilenameLength] = {0};
char info_content[Simulate::kMaxFilenameLength] = {0};
// pending uploads
std::condition_variable_any cond_upload_;
int texture_upload_ = -1;
int mesh_upload_ = -1;
int hfield_upload_ = -1;
};
} // namespace mujoco