コード例 #1
0
ファイル: CircleBody.cs プロジェクト: Zuver/capture-the-flag
 /// <summary>
 /// Detect a collision with a rectangle body
 /// </summary>
 /// <param name="rectangleBody"></param>
 /// <returns></returns>
 protected override bool DetectCollision(RectangleBody rectangleBody)
 {
     return (rectangleBody.GetClosestPointOnPerimeter(this.Position) - this.Position).LengthSquared() < this.Radius * this.Radius;
 }