A rectangle is defined by two points, the top left point, called topLeft, and the bottom right point called bottomRight.

Constructors

Properties

bottomRight: Point
topLeft: Point

Methods

  • Method that checks if a point is inside this rectangle. If the point is on the edge it is not considered inside.

    Parameters

    • p: Point

      the point to check.

    Returns boolean

    true if the point is inside the rectangle, false otherwise.

  • Check if there is an overlap between this and another rectangle.

    Parameters

    Returns boolean

  • Method that gets the vector needed to separate this rectangle from another rectangle. If there is no overlap a null vector is returned.

    Parameters

    Returns Vector

Generated using TypeDoc