public addBreakableBody ( |
||
breakableBody | ||
리턴 | void |
public static BreakableBody CreateBreakableBody( World world, IEnumerable<Shape> shapes, Vector2 position = new Vector2(), float rotation = 0 ) { var breakableBody = new BreakableBody( world, shapes, position, rotation ); breakableBody.mainBody.position = position; world.addBreakableBody( breakableBody ); return breakableBody; }
public static BreakableBody CreateBreakableBody( World world, Vertices vertices, float density, Vector2 position = new Vector2(), float rotation = 0 ) { //TODO: Implement a Voronoi diagram algorithm to split up the vertices List<Vertices> triangles = Triangulate.convexPartition( vertices, TriangulationAlgorithm.Earclip ); var breakableBody = new BreakableBody( world, triangles, density, position, rotation ); breakableBody.mainBody.position = position; world.addBreakableBody( breakableBody ); return breakableBody; }