BEPUutilities2.BoundingBox.CreateFromPoints C# (CSharp) Метод

CreateFromPoints() публичный статический Метод

Creates the smallest possible bounding box that contains a list of points.
public static CreateFromPoints ( IList points ) : BoundingBox
points IList Points to enclose with a bounding box.
Результат BoundingBox
        public static BoundingBox CreateFromPoints(IList<Vector3> points)
        {
            BoundingBox aabb;
            if (points.Count == 0)
                throw new Exception("Cannot construct a bounding box from an empty list.");
            aabb.Min = points[0];
            aabb.Max = aabb.Min;
            for (int i = points.Count - 1; i >= 1; i--)
            {
                aabb.Min = Vector3.Min(points[i], aabb.Min);
                aabb.Max = Vector3.Max(points[i], aabb.Max);
            }
            return aabb;
        }