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
+9
View File
@@ -2163,6 +2163,15 @@ Update entire scene given model state.
Update entire scene from a scene state, return the number of new mjWARN_VGEOMFULL warnings.
.. _mjv_copyModel:
`mjv_copyModel <#mjv_copyModel>`__
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.. mujoco-include:: mjv_copyModel
Copy mjModel, skip large arrays not required for abstract visualization.
.. _mjv_defaultSceneState:
`mjv_defaultSceneState <#mjv_defaultSceneState>`__
+1
View File
@@ -3347,6 +3347,7 @@ void mjv_updateScene(const mjModel* m, mjData* d, const mjvOption* opt,
int mjv_updateSceneFromState(const mjvSceneState* scnstate, const mjvOption* opt,
const mjvPerturb* pert, mjvCamera* cam, int catmask,
mjvScene* scn);
void mjv_copyModel(mjModel* dest, const mjModel* src);
void mjv_defaultSceneState(mjvSceneState* scnstate);
void mjv_makeSceneState(const mjModel* m, const mjData* d,
mjvSceneState* scnstate, int maxgeom);