Beispiel #1
0
 public override CollisionData Collide(Shape other)
 {
                 #if PLATFORM_IOS
     // Generic Virtual Methods cannot be called in iOS, due to iOS not allowing JIT-compiling
     if (other is Circle)
     {
         return(CollisionChecks.CircleCircle(this, (Circle)other));
     }
     else if (other is OABB)
     {
         return(CollisionChecks.CirclePolygon(this, (OABB)other));
     }
     else if (other is Polygon)
     {
         return(CollisionChecks.CirclePolygon(this, (Polygon)other));
     }
     else if (other is CompoundShape)
     {
         return(CollisionData.Empty);
     }
     else
     {
         return(CollisionData.Empty);
     }
                 #else
     return(other.Accept <CollisionData, Circle>(visitor, this));
                 #endif
 }
Beispiel #2
0
        public CollisionData Visit(Circle other, Polygon self)
        {
            CollisionData r = CollisionChecks.CirclePolygon(other, self);

            r.Invert();
            return(r);
        }
Beispiel #3
0
 public CollisionData Visit(Circle other, Circle self)
 {
     return(CollisionChecks.CircleCircle(self, other));
 }
Beispiel #4
0
 public CollisionData Visit(Polygon other, Circle self)
 {
     return(CollisionChecks.CirclePolygon(self, other));
 }
Beispiel #5
0
 public CollisionData Visit(Polygon other, Polygon self)
 {
     return(CollisionChecks.PolygonPolygon(self, other));
 }