The AddPoint
method is used to expand the bounding box to include a specified point. This method modifies the bounding box such that it encompasses the given point, adjusting its minimum and maximum extents as necessary.
The AddPoint
method is used to expand the bounding box to include a specified point. This method modifies the bounding box such that it encompasses the given point, adjusting its minimum and maximum extents as necessary.
To use the AddPoint
method, you need to have an instance of BBox
and a Vector3
point that you want to include within the bounding box. The method will adjust the bounding box to ensure the point is within its bounds.
// Create a bounding box BBox bbox = new BBox(new Vector3(0, 0, 0), new Vector3(1, 1, 1)); // Define a point to add Vector3 point = new Vector3(2, 2, 2); // Add the point to the bounding box bbox = bbox.AddPoint(ref point); // The bounding box is now expanded to include the point (2, 2, 2)