Track authored flags for global attributes

PiperOrigin-RevId: 931585539
Change-Id: Ifdc8c59de6c5a553daf6e0af09d8192aff6b0610
This commit is contained in:
Yuval Tassa
2026-06-13 02:57:52 -07:00
committed by Copybara-Service
parent 0ea9c7cb3a
commit 67a1ea6dca
21 changed files with 823 additions and 195 deletions
+3 -2
View File
@@ -845,14 +845,15 @@ template int mjXUtil::ReadAttr(XMLElement* elem, const char* attr, int len,
// throw error if identically zero
int mjXUtil::ReadQuat(XMLElement* elem, const char* attr, double* data, std::string& text,
bool required) {
ReadAttr(elem, attr, /*len=*/4, data, text, required, /*exact=*/true);
int n = ReadAttr(elem, attr, /*len=*/4, data, text, required, /*exact=*/true);
if (n == 0) return 0;
// check for 0 quaternion
if (data[0] == 0 && data[1] == 0 && data[2] == 0 && data[3] == 0) {
throw mjXError(elem, "zero quaternion is not allowed");
}
return 4;
return n;
}
// read DOUBLE array into C++ vector, return number read