expand static method

Shape expand(
  1. Shape moving,
  2. Shape target
)

Implementation

static Shape expand(Shape moving, Shape target) {
  return switch ((moving, target)) {
    (AABB movingAABB, AABB targetAABB) => expandAABB(movingAABB, targetAABB),
    (Circle movingCircle, Circle targetCircle) => expandCircle(movingCircle, targetCircle),
    (AABB movingAABB, Circle targetCircle) => expandAABBAndCircle(movingAABB, targetCircle),
    (Circle movingCircle, AABB targetAABB) => expandCircleAndAABB(movingCircle, targetAABB),
    _ => throw UnimplementedError(
        '${moving.runtimeType} and ${target.runtimeType} is not defined for Sweep.',
      ),
  };
}