public static AttachPolygon ( Vertices vertices, float density, |
||
vertices | Vertices | |
density | float | |
body | ||
userData | object | |
return |
public static Body CreatePolygon(World world, Vertices vertices, float density, Vector2 position, object userData = null) { Body body = CreateBody(world, position); FixtureFactory.AttachPolygon(vertices, density, body, userData); return(body); }
public static Body CreatePolygon(World world, Vertices vertices, float density, Vector2 position = new Vector2(), float rotation = 0, BodyType bodyType = BodyType.Static, object userData = null) { var body = CreateBody(world, position, rotation, bodyType); FixtureFactory.AttachPolygon(vertices, density, body, userData); return(body); }
public static Body CreatePolygon(World world, Vertices vertices, float density, Vector2 position, PressPlay.FFWD.Component userData) { Body body = CreateBody(world, position); FixtureFactory.AttachPolygon(vertices, density, body, userData); return(body); }
public static Body CreateRectangle(World world, float width, float height, float density, Vector2 position = new Vector2(), float rotation = 0, BodyType bodyType = BodyType.Static, object userData = null) { if (width <= 0) { throw new ArgumentOutOfRangeException("width", "Width must be more than 0 meters"); } if (height <= 0) { throw new ArgumentOutOfRangeException("height", "Height must be more than 0 meters"); } Body body = CreateBody(world, position, rotation, bodyType, userData); Vertices rectangleVertices = PolygonTools.CreateRectangle(width / 2, height / 2); FixtureFactory.AttachPolygon(rectangleVertices, density, body); return(body); }