fromVertices static method
Creates an Aabb2 from a vertices list.
Implementation
static Aabb2 fromVertices(List<Vector2> vertices) {
if (vertices.isEmpty) {
return Aabb2();
}
final first = vertices.first;
final box = Aabb2.minMax(first, first);
if (vertices.length > 1) {
vertices.forEach(box.hullPoint);
}
return box;
}