Example #1
0
        public static bool Intersects(CircleShape a, ShapePrimitive b)
        {
            var bCircle = b as CircleShape;
            if (bCircle != null) { return Intersects(a, bCircle); }

            return CantCollide(a, b);
        }
Example #2
0
 public static bool Intersects(CircleShape a, CircleShape b)
 {
     float centerDist2 = (a.Center - b.Center).LengthSquared();
     float minDist = a.Radius + b.Radius;
     return centerDist2 <= minDist * minDist;
 }