Skip to content
Snippets Groups Projects
Commit ee25d70c authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Added optional childclass in addBody()

parent c2311ae5
No related branches found
No related tags found
No related merge requests found
......@@ -145,7 +145,7 @@ Body Worldbody::addMocapBody(const std::string& name, float geomSize)
return mocap;
}
Body Worldbody::addBody(const std::string& name)
Body Worldbody::addBody(const std::string& name, const std::string& childClass)
{
Body body = addChild<Body>();
......@@ -153,6 +153,10 @@ Body Worldbody::addBody(const std::string& name)
{
body.name = name;
}
if (!childClass.empty())
{
body.childclass = childClass;
}
return body;
}
......@@ -222,7 +222,7 @@ struct Worldbody : public Element<Worldbody>
mjcf_ElementDerivedConstructors(Worldbody)
/// Add a body element.
Body addBody(const std::string& name = "");
Body addBody(const std::string& name = "", const std::string& childClass = "");
/// Add a mocap body with the given name to the worldbody.
Body addMocapBody(const std::string& name, float geomSize);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment