예제 #1
0
        public override bool CollidesWithShape(Shape other, out CollisionResult result)
        {
            if (other is Box && (other as Box).IsUnrotated)
            {
                return(ShapeCollisions.CircleToBox(this, other as Box, out result));
            }

            if (other is Circle)
            {
                return(ShapeCollisions.CircleToCircle(this, other as Circle, out result));
            }

            if (other is Polygon)
            {
                return(ShapeCollisions.CircleToPolygon(this, other as Polygon, out result));
            }

            throw new NotImplementedException(string.Format("Collisions of Circle to {0} are not supported", other));
        }