Dynamic model editing.

PiperOrigin-RevId: 640838852
Change-Id: I559b1d60f2a3a2d866788d4006be31757454c619
This commit is contained in:
Alessio Quaglino
2024-06-06 03:29:56 -07:00
committed by Copybara-Service
parent 40755e165d
commit ba8a2d4c8a
9 changed files with 239 additions and 13 deletions
+10
View File
@@ -83,6 +83,16 @@ mjModel* mjs_compile(mjSpec* s, const mjVFS* vfs) {
// recompile spec into existing model and data while preserving the state
void mjs_recompile(mjSpec* s, const mjVFS* vfs, mjModel* m, mjData* d) {
mjCModel* modelC = static_cast<mjCModel*>(s->element);
modelC->SaveState(d);
modelC->Compile(vfs, &m);
modelC->RestoreState(m, &d);
}
// attach body to a frame of the parent
int mjs_attachBody(mjsFrame* parent, const mjsBody* child,
const char* prefix, const char* suffix) {