Add copy constructor and assignment to mjCModel.

PiperOrigin-RevId: 616850780
Change-Id: I7fedab2efa2a90fd7ce952eac4e195f77c5ff5bc
This commit is contained in:
Alessio Quaglino
2024-03-18 09:24:36 -07:00
committed by Copybara-Service
parent de918a8b2d
commit 372aa021d0
8 changed files with 766 additions and 333 deletions
+8
View File
@@ -36,6 +36,14 @@ mjSpec* mjm_createSpec() {
// copy model
mjSpec* mjm_copySpec(const mjSpec* s) {
mjCModel* modelC = new mjCModel(*reinterpret_cast<mjCModel*>(s->element));
return &modelC->spec;
}
// copy back model
void mjm_copyBack(mjSpec* s, const mjModel* m) {
mjCModel* modelC = reinterpret_cast<mjCModel*>(s->element);