The Grow
method of the BBox
struct is used to expand the bounding box by a specified amount, referred to 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, referred to 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 will return a new BBox
instance that represents the expanded bounding box.
// 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); // expandedBox now represents a bounding box that is larger by 0.5 units on each side.