Use std::vector instead of array in MJCF schema.
PiperOrigin-RevId: 831787681 Change-Id: I8093b8b10260daecb830e49319eda798e2dd2da5
This commit is contained in:
committed by
Copybara-Service
parent
26c1622ac8
commit
8b9fa2674c
+3
-3
@@ -321,15 +321,15 @@ XMLElement* NextSiblingElement(XMLElement* e, const char* name) {
|
||||
}
|
||||
|
||||
// constructor
|
||||
mjXSchema::mjXSchema(const char* schema[][mjXATTRNUM], unsigned nrow) {
|
||||
mjXSchema::mjXSchema(std::vector<const char*> schema[], unsigned nrow) {
|
||||
// set name and type
|
||||
name_ = schema[0][0];
|
||||
type_ = schema[0][1][0];
|
||||
|
||||
// set attributes
|
||||
int nattr = atoi(schema[0][2]);
|
||||
int nattr = schema[0].size() - 2;
|
||||
for (int i = 0; i < nattr; i++) {
|
||||
attr_.emplace(schema[0][3 + i]);
|
||||
attr_.emplace(schema[0][2 + i]);
|
||||
}
|
||||
|
||||
// process sub-elements of complex element
|
||||
|
||||
Reference in New Issue
Block a user