copyCenterAndHalfExtents method

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

Copy the center and the halfExtents of this.

Implementation

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