Add mjv_copyModel to copy mjModel, skipping large arrays not required for abstract visualization.

This functionality is meant for fast copying of `mjModel` when synchronizing the visualization state, as in the Python passive viewer.

PiperOrigin-RevId: 699199743
Change-Id: I13a5160063eb09139ec1aee9c4969bc1c6f547f1
This commit is contained in:
Yuval Tassa
2024-11-22 09:37:18 -08:00
committed by Copybara-Service
parent 74dcd51d83
commit 1d64362adc
9 changed files with 147 additions and 32 deletions
+3
View File
@@ -69,6 +69,9 @@ void mj_makeModel(mjModel** dest,
// copy mjModel; allocate new if dest is NULL
MJAPI mjModel* mj_copyModel(mjModel* dest, const mjModel* src);
// copy mjModel, skip large arrays not required for abstract visualization
MJAPI void mjv_copyModel(mjModel* dest, const mjModel* src);
// save model to binary file
MJAPI void mj_saveModel(const mjModel* m, const char* filename, void* buffer, int buffer_sz);