Farseer physics body generation from voronoi cells

This commit is contained in:
Regalis11
2015-06-22 16:55:42 +03:00
parent b45073fdec
commit 8bc65f983d
5 changed files with 47 additions and 34 deletions
+8 -3
View File
@@ -117,9 +117,14 @@ namespace Voronoi2
public class VoronoiCell
{
public List<GraphEdge> edges;
public int site;
public Site site;
public VoronoiCell(int site)
public Vector2 Center
{
get { return new Vector2((float)site.coord.x, (float)site.coord.y); }
}
public VoronoiCell(Site site)
{
edges = new List<GraphEdge>();
this.site = site;
@@ -129,7 +134,7 @@ namespace Voronoi2
public class GraphEdge
{
public Vector2 point1, point2;
public int site1, site2;
public Site site1, site2;
}
// للترتيب