Change mjSpec and mjModel signature mechanism.

The signature now contains the necessary information to safely perform `bind`. The private UIDs are now removed.

Fixes an issue of changing signature when compiling a copy of an mjSpec.

PiperOrigin-RevId: 744670626
Change-Id: Id3c66419cf2afbe78e91bc4b37d2299f5ec00ab1
This commit is contained in:
Alessio Quaglino
2025-04-07 04:20:17 -07:00
committed by Copybara-Service
parent 93251f07d9
commit cc2f57d820
7 changed files with 85 additions and 40 deletions
-2
View File
@@ -403,14 +403,12 @@ bool mjCFlexcomp::Make(mjsBody* body, char* error, int error_sz) {
mjCFlex* flex = model->AddFlex();
mjsFlex* pf = &flex->spec;
int id = flex->id;
int uid = flex->uid;
*flex = def.Flex();
flex->PointToLocal();
flex->model = model;
flex->id = id;
flex->uid = uid;
mjs_setString(pf->name, name.c_str());
mjs_setInt(pf->elem, element.data(), element.size());
mjs_setFloat(pf->texcoord, texcoord.data(), texcoord.size());