AABB.withVec2 constructor

AABB.withVec2(
  1. Vector2 lowerVertex,
  2. Vector2 upperVertex
)

Creates an AABB object using the given bounding vertices. lowerVertex should be the bottom left vertex of the bounding box. upperVertex should be the top right vertex of the bounding box.

Implementation

AABB.withVec2(Vector2 lowerVertex, Vector2 upperVertex)
    : lowerBound = Vector2.copy(lowerVertex),
      upperBound = Vector2.copy(upperVertex);