setCenterAndHalfExtents method

void setCenterAndHalfExtents(
  1. Vector2 center,
  2. Vector2 halfExtents
)

Set the AABB by a center and halfExtents.

Implementation

void setCenterAndHalfExtents(Vector2 center, Vector2 halfExtents) {
  _min
    ..setFrom(center)
    ..sub(halfExtents);
  _max
    ..setFrom(center)
    ..add(halfExtents);
}