public static Vector2 GetAveragePosition(LinkedList <GameObject> SelectObjects) { Vector2 val = Vector2.Zero; int Count = 0; foreach (GameObject g in SelectObjects) { if (g.GetType().IsSubclassOf(typeof(Basic2DObject))) { Basic2DObject b = (Basic2DObject)g; val += b.getPosition(); Count++; } } return(val / Count); }
public bool CheckCircle(Basic2DObject g) { return(Logic.DistanceLineSegmentToPoint(getPosition(), PreviousPosition, g.getPosition()) < (g.Size.get().X + Size.get().X) / 2); }
public override bool CheckCollision(Basic2DObject Tester) { return(Vector2.Distance(getPosition(), Tester.getPosition()) < Tester.getSize().X + getSize().X); }