Пример #1
0
 public bool Intersects(Polygon Polygon, ref Vector2 Intersection)
 {
     Intersection = End;
     return (Polygon == Obstacle);
 }
Пример #2
0
 public bool Intersects(Polygon Polygon, ref Vector2 Intersection)
 {
     for (uint i = 0; i < Rays.Length; i++)
         if ((Rays[i] != null) && (Rays[i].Intersects(Polygon, ref Intersection))) return true;
     return false;
 }
Пример #3
0
 public bool Intersects(Polygon Polygon)
 {
     return (Polygon == Obstacle);
 }
Пример #4
0
 public bool Intersects(Polygon Polygon, ref Vector2 Intersection)
 {
     for (uint i = 0; i < Lines.Length; i++)
         for (uint j = 0; j < Polygon.Lines.Length; j++)
             if (Lines[i].Offset(Position)
                 .Intersects(Polygon.Lines[j].Offset(Polygon.Position), ref Intersection))
                 return true;
     return false;
 }
Пример #5
0
 public static void Write(this NetBuffer Message, Polygon Variable)
 {
     Message.Write((byte) Variable.Lines.Length);
     for (byte i = 0; i < Variable.Lines.Length; i++)
         Message.Write(Variable.Lines[i]);
     //Message.Write(Variable.Origin);
     //Message.Write(Variable.Position);
     //Message.Write(Variable.Angle);
 }
Пример #6
0
 public static Polygon ReadPolygon(this NetBuffer Message)
 {
     var Polygon = new Polygon(new Line[Message.ReadByte()]);
     for (byte i = 0; i < Polygon.Lines.Length; i++)
         Polygon.Lines[i] = ReadLine(Message);
     //Polygon.Origin = ReadVector2(Message);
     //Polygon.Position = ReadVector2(Message);
     //Polygon.Angle = Message.ReadFloat();
     return Polygon;
 }
Пример #7
0
 public void Load()
 {
     Scale = .6f;
     Mask = Polygon.CreateCircle((28 * Scale), Vector2.Zero);
     Position = new Vector2((Screen.ViewportWidth / 2f), (Screen.ViewportHeight / 2f));
     bool T = Collides;
 }