public static PolygonShape Parse(string p) { SimpleParser parser = new SimpleParser(p, true); Vec2[] vertices = SimpleArrayParser.GenerateArray <Vec2>((parser.ValueFromKey("vertices")), delegate(string input) { return(Vec2.Parse(input)); }); return(new PolygonShape(vertices, Vec2.Parse(parser.ValueFromKey("Centroid")))); }
public static CircleShape Parse(string p) { SimpleParser parser = new SimpleParser(p, true); return(new CircleShape(Vec2.Parse(parser.ValueFromKey("Position")), float.Parse(parser.ValueFromKey("Radius")))); }
/// <summary> /// Parse a MassData from a string. /// </summary> /// <param name="value">The string to parse.</param> /// <returns>The new MassData.</returns> public static MassData Parse(string value) { SimpleParser parser = new SimpleParser(value, true); return(new MassData(float.Parse(parser.ValueFromKey("Mass")), Vec2.Parse(parser.ValueFromKey("Center")), float.Parse(parser.ValueFromKey("Inertia")))); }