Handle the implicit auto value for limits now written by the compiler to the xml
This commit is contained in:
@@ -82,13 +82,10 @@ public class MjActuator : MjComponent {
|
||||
LengthRange = mjcf.GetVector2Attribute("lengthrange", defaultValue: Vector2.zero);
|
||||
Gear = mjcf.GetFloatArrayAttribute("gear", defaultValue: new float[] { 1.0f }).ToList();
|
||||
|
||||
bool autolimits = (mjcf.OwnerDocument.GetElementsByTagName("compiler")[0]?["compiler"])
|
||||
?.GetBoolAttribute("autolimits", true) ??
|
||||
false;
|
||||
CtrlLimited = mjcf.GetBoolAttribute("ctrllimited",
|
||||
defaultValue: autolimits ? CtrlRange != Vector2.zero : false);
|
||||
ForceLimited = mjcf.GetBoolAttribute("forcelimited",
|
||||
defaultValue: autolimits ? ForceRange != Vector2.zero : false);
|
||||
CtrlLimited = mjcf.GetLimitedAttribute("ctrllimited",
|
||||
rangeDefined: mjcf.HasAttribute("ctrlrange"));
|
||||
ForceLimited = mjcf.GetLimitedAttribute("forcelimited",
|
||||
rangeDefined: mjcf.HasAttribute("forcerange"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user