Raise error if an invalid curve is specified for the cable composite.
PiperOrigin-RevId: 486967001 Change-Id: I7220966e172400542417d8f715dbee0c0f154d9b
This commit is contained in:
committed by
Copybara-Service
parent
9fc9823a8c
commit
7b7fc09d1f
@@ -1911,6 +1911,9 @@ void mjXReader::OneComposite(XMLElement* elem, mjCBody* pbody, mjCDef* def) {
|
|||||||
int i = 0;
|
int i = 0;
|
||||||
while (iss) {
|
while (iss) {
|
||||||
iss >> text;
|
iss >> text;
|
||||||
|
if (i>2) {
|
||||||
|
throw mjXError(elem, "The curve array must have a maximum of 3 components");
|
||||||
|
}
|
||||||
comp.curve[i++] = (mjtCompShape)FindKey(shape_map, mjNCOMPSHAPES, text);
|
comp.curve[i++] = (mjtCompShape)FindKey(shape_map, mjNCOMPSHAPES, text);
|
||||||
if (iss.eof()){
|
if (iss.eof()){
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user