Add mjs_detachBody to C API.

PiperOrigin-RevId: 626947850
Change-Id: I7c897048098ecd4f2247725ef2d378dbd00ef4a0
This commit is contained in:
Alessio Quaglino
2024-04-22 01:10:13 -07:00
committed by Copybara-Service
parent 34a61ae42f
commit cc78db41f4
7 changed files with 193 additions and 13 deletions
+7 -2
View File
@@ -158,12 +158,14 @@ class mjCModel : public mjCModel_, private mjSpec {
public:
mjCModel();
mjCModel(const mjCModel& other);
mjCModel& operator=(const mjCModel& other);
mjCModel& operator+=(const mjCModel& other);
~mjCModel();
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
mjSpec spec;
mjModel* Compile(const mjVFS* vfs = nullptr); // construct mjModel
@@ -196,6 +198,9 @@ class mjCModel : public mjCModel_, private mjSpec {
std::map<mjCDef*, int>& def_map,
const std::vector<mjCDef*>& defaults);
// delete from list the elements that are compatible with other but not this model
template <class T> void RemoveFromList(std::vector<T*>& list, const mjCModel& other);
// delete elements marked as discard=true
template <class T> void Delete(std::vector<T*>& elements,
const std::vector<bool>& discard);