Don't save body gravcomp if 0.

PiperOrigin-RevId: 520592156
Change-Id: Ifb85c1e78498877bc576cfca224c41b3cf47c9ab
This commit is contained in:
Yuval Tassa
2023-03-30 03:33:13 -07:00
committed by Copybara-Service
parent e4d27d4b90
commit ddfcd3b325
2 changed files with 6 additions and 4 deletions
+3 -2
View File
@@ -1321,8 +1321,9 @@ void mjXWriter::Body(XMLElement* elem, mjCBody* body) {
}
// gravity compensation
WriteAttr(elem, "gravcomp", 1, &body->gravcomp);
if (body->gravcomp) {
WriteAttr(elem, "gravcomp", 1, &body->gravcomp);
}
// userdata
WriteVector(elem, "user", body->userdata);