protected override bool CollideRectangle(RectangleCollider other, out CollisionData data)
 {
     Vector2 depth = AABB.GetIntersectionDepth(Bounds, other.Bounds);
     if (depth != Vector2.Zero && (Math.Abs(depth.X) > 1 || Math.Abs(depth.Y) > 1))
     {
         data = new CollisionData(depth);
         return true;
     }
     data = new CollisionData(Vector2.Zero);
     return false;
 }
예제 #2
0
 // ABSTRACT METHODS
 protected abstract bool CollideRectangle(RectangleCollider other, out CollisionData data);
 protected override bool CollideRectangle(RectangleCollider other, out CollisionData data)
 {
     // TODO: check collision
     data = new CollisionData(Vector2.Zero);
     return false;
 }