setCenterAndHalfExtents method

void setCenterAndHalfExtents (Vector2 center, 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);
}