Add frame support to the cable composite.

Also cleanup user_composite.cc includes.

PiperOrigin-RevId: 740730596
Change-Id: I05df59926d8e61de45fd6b2a3a63121b7a390448
This commit is contained in:
Alessio Quaglino
2025-03-26 05:35:33 -07:00
committed by Copybara-Service
parent d6943731b2
commit 5c955b8fe2
4 changed files with 13 additions and 14 deletions
+3 -2
View File
@@ -2388,7 +2388,7 @@ void mjXReader::OneActuator(XMLElement* elem, mjsActuator* actuator) {
// make composite
void mjXReader::OneComposite(XMLElement* elem, mjsBody* body, const mjsDefault* def) {
void mjXReader::OneComposite(XMLElement* elem, mjsBody* body, mjsFrame* frame, const mjsDefault* def) {
string text;
int n;
@@ -2402,6 +2402,7 @@ void mjXReader::OneComposite(XMLElement* elem, mjsBody* body, const mjsDefault*
}
ReadAttr(elem, "count", 3, comp.count, text, false, false);
ReadAttr(elem, "offset", 3, comp.offset, text);
comp.frame = frame;
// plugin
XMLElement* eplugin = FirstChildElement(elem, "plugin");
@@ -3467,7 +3468,7 @@ void mjXReader::Body(XMLElement* section, mjsBody* body, mjsFrame* frame,
// composite sub-element
else if (name == "composite") {
// parse composite
OneComposite(elem, body, def);
OneComposite(elem, body, frame, def);
}
// flexcomp sub-element