Ejemplo n.º 1
0
 public override bool hit(RectangleCollider c, Vector2 p1, Vector2 p2)
 {
     foreach (Collider colin in within)
     {
         if(colin.hit(c,p1,p2)) return true;
     }
     return false;
 }
Ejemplo n.º 2
0
        public override bool hit(RectangleCollider c,Vector2 p1, Vector2 p2)
        {
            Vector2 pos1 = position + p1;
            Vector2 pos2 = c.position + p2;
            Vector2 size1 = dimentions;
            Vector2 size2 = c.dimentions;

            //check only in X
            return (((pos1.X + size1.X >= pos2.X) || (pos1.X <= pos2.X + size2.X)) && ((pos1.Y + size1.Y >= pos2.Y) || (pos1.Y <= pos2.Y + size2.Y)));
        }
Ejemplo n.º 3
0
 public override bool hit(RectangleCollider c, Vector2 p1, Vector2 p2)
 {
     return c.hit(this, p2, p1);
 }
Ejemplo n.º 4
0
 public abstract Boolean hit(RectangleCollider c, Vector2 p1,Vector2 p2);