Track authored flags for global attributes
PiperOrigin-RevId: 931585539 Change-Id: Ifdc8c59de6c5a553daf6e0af09d8192aff6b0610
This commit is contained in:
committed by
Copybara-Service
parent
0ea9c7cb3a
commit
67a1ea6dca
+3
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user