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
+11
View File
@@ -536,12 +536,16 @@ int mjCBoundingVolumeHierarchy::MakeBVH(
//------------------------- class mjCDef implementation --------------------------------------------
// constructor
mjCDef::mjCDef() {
name.clear();
id = 0;
parent = nullptr;
model = 0;
child.clear();
elemtype = mjOBJ_DEFAULT;
mjs_defaultJoint(&joint_.spec);
mjs_defaultGeom(&geom_.spec);
mjs_defaultSite(&site_.spec);
@@ -561,6 +565,13 @@ mjCDef::mjCDef() {
// constructor with model
mjCDef::mjCDef(mjCModel* _model) : mjCDef() {
model = _model;
}
// copy constructor
mjCDef::mjCDef(const mjCDef& other) {
*this = other;