Beispiel #1
0
 public Polygon(Vector3 pos, float range, PolygonConstants pc)
 {
     polygon = new List<IntPoint>();
     float d = range / pc.lineDetail;
     for (int i = 0; i < pc.circleDetail; i++)
     {
         innerLoop(i, pos, pc, d);
     }
 }
Beispiel #2
0
 private void innerLoop(int i, Vector3 pos, PolygonConstants pc, float d)
 {
     for (int j = 0; j < pc.lineDetail; j++)
     {
         pos.X += pc.cosTable[i] * d;
         pos.Y += pc.sinTable[i] * d;
         if (blocksSight(pos))
         {
             polygon.Add(new IntPoint(pos.X,pos.Y));
             return;
         }
     }
     polygon.Add(new IntPoint(pos.X, pos.Y));
 }
Beispiel #3
0
 public PolygonManager()
 {
     solution = new Paths();
     pc = new PolygonConstants();
     polygons = new List<Polygon>();
 }