public bool Intersects(Polygon Polygon, ref Vector2 Intersection) { Intersection = End; return (Polygon == Obstacle); }
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; }
public bool Intersects(Polygon Polygon) { return (Polygon == Obstacle); }
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; }
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); }
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; }
public void Load() { Scale = .6f; Mask = Polygon.CreateCircle((28 * Scale), Vector2.Zero); Position = new Vector2((Screen.ViewportWidth / 2f), (Screen.ViewportHeight / 2f)); bool T = Collides; }