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")))); }
/// <summary> /// Parse a FilterData out from a string. /// </summary> /// <param name="value">The string to parse from.</param> /// <returns>The new FilterData.</returns> public static FilterData Parse(string value) { SimpleParser parser = new SimpleParser(value, true); return(new FilterData(ushort.Parse(parser.ValueFromKey("CategoryBits")), ushort.Parse(parser.ValueFromKey("MaskBits")), short.Parse(parser.ValueFromKey("GroupIndex")))); }