Dynamic model editing.
PiperOrigin-RevId: 640838852 Change-Id: I559b1d60f2a3a2d866788d4006be31757454c619
This commit is contained in:
committed by
Copybara-Service
parent
40755e165d
commit
ba8a2d4c8a
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user