add mjs_detachDefault to delete a default class from mjSpec

PiperOrigin-RevId: 738452369
Change-Id: I5a53a6dc8f89e1e8136aeefc09d7d9b7b7204e1f
This commit is contained in:
Tom Power
2025-03-19 10:30:08 -07:00
committed by Copybara-Service
parent a1b9ffd124
commit be64747166
18 changed files with 261 additions and 24 deletions
+8 -4
View File
@@ -183,10 +183,11 @@ class mjCModel : public mjCModel_, private mjSpec {
void CopyFromSpec(); // copy spec to private attributes
void PointToLocal();
mjCModel& operator=(const mjCModel& other); // copy other into this, if they are not the same
mjCModel& operator+=(const mjCModel& other); // add other into this, even if they are the same
mjCModel& operator-=(const mjCBody& subtree); // remove subtree and all references from model
mjCModel_& operator+=(mjCDef& subtree); // add default tree to this model
mjCModel& operator=(const mjCModel& other); // copy other into this, if they are not the same
mjCModel& operator+=(const mjCModel& other); // add other into this, even if they are the same
mjCModel& operator-=(const mjCBody& subtree); // remove subtree and all references from model
mjCModel_& operator+=(mjCDef& subtree); // add default tree to this model
mjCModel& operator-=(const mjCDef& subtree); // remove default tree from this model
mjSpec spec;
@@ -225,6 +226,9 @@ class mjCModel : public mjCModel_, private mjSpec {
// delete object from the corresponding list
void DeleteElement(mjsElement* el);
// delete default and all descendants
void RemoveDefault(mjCDef* def);
// detach subtree from model
void Detach(mjCBody* subtree);