The Grow
method of the BBox
struct is used to expand the bounding box by a specified amount, known as the "skin". This method modifies the bounding box to include a margin around its current extents, effectively increasing its size.
The Grow
method of the BBox
struct is used to expand the bounding box by a specified amount, known as the "skin". This method modifies the bounding box to include a margin around its current extents, effectively increasing its size.
To use the Grow
method, you need to pass a reference to a float
value representing the amount by which you want to expand the bounding box. The method returns a new BBox
instance that represents the expanded bounding box.
Note that the skin
parameter is passed by reference, so any changes to it within the method will affect the original variable.
// Example of using the Grow method BBox originalBox = new BBox(new Vector3(0, 0, 0), new Vector3(1, 1, 1)); float skin = 0.5f; BBox expandedBox = originalBox.Grow(ref skin); // The expandedBox now has larger dimensions than the originalBox.