class Meta: color = XmlAttr("color", List(Float())) name = XmlAttr("name", String()) typ = XmlAttr("type", Choice("static", "kinematic", "dynamic"), required=True) fixtures = XmlChildren("fixture", lambda: XmlFixture) position = XmlAttr("position", Point2D())
class Meta: typ = XmlAttr("type", Choice("force", "torque"), required=True) body = XmlAttr("body", String(), help="name of the body to apply force on") bodies = XmlAttr("bodies", List(String()), help="names of the bodies to apply force on") joint = XmlAttr("joint", String(), help="name of the joint") anchor = XmlAttr( "anchor", Point2D(), help="location of the force in local coordinate frame") direction = XmlAttr( "direction", Point2D(), help="direction of the force in local coordinate frame") ctrllimit = XmlAttr("ctrllimit", Tuple(Float(), Float()), help="limit of the control input in Newton")
class Meta: bodies = XmlChildren("body", lambda: XmlBody) gravity = XmlAttr("gravity", Point2D()) joints = XmlChildren("joint", lambda: XmlJoint) states = XmlChildren("state", lambda: XmlState) controls = XmlChildren("control", lambda: XmlControl) warmStarting = XmlAttr("warmstart", Bool()) continuousPhysics = XmlAttr("continuous", Bool()) subStepping = XmlAttr("substepping", Bool()) velocityIterations = XmlAttr("velitr", Int()) positionIterations = XmlAttr("positr", Int()) timeStep = XmlAttr("timestep", Float())
class Meta: bodyA = XmlAttr("bodyA", String(), required=True) bodyB = XmlAttr("bodyB", String(), required=True) anchor = XmlAttr("anchor", Tuple(Float(), Float())) localAnchorA = XmlAttr("localAnchorA", Tuple(Float(), Float())) localAnchorB = XmlAttr("localAnchorB", Tuple(Float(), Float())) axis = XmlAttr("axis", Tuple(Float(), Float())) limit = XmlAttr("limit", Tuple(Angle(), Angle())) ctrllimit = XmlAttr("ctrllimit", Tuple(Angle(), Angle())) typ = XmlAttr("type", Choice("revolute", "friction", "prismatic"), required=True) name = XmlAttr("name", String()) motor = XmlAttr("motor", Bool())
class Meta: shape = XmlAttr("shape", Choice("polygon", "circle", "edge", "sine_chain"), required=True) vertices = XmlAttr("vertices", List(Point2D())) box = XmlAttr( "box", Either(Point2D(), Tuple(Float(), Float(), Point2D(), Angle()))) radius = XmlAttr("radius", Float()) width = XmlAttr("width", Float()) height = XmlAttr("height", Float()) center = XmlAttr("center", Point2D()) angle = XmlAttr("angle", Angle()) position = XmlAttr("position", Point2D()) friction = XmlAttr("friction", Float()) density = XmlAttr("density", Float()) category_bits = XmlAttr("category_bits", Hex()) mask_bits = XmlAttr("mask_bits", Hex()) group = XmlAttr("group", Int())