Description
The FromPositionAndSize
method is a static method of the BBox
struct that creates a new axis-aligned bounding box (AABB) based on a specified center position and a uniform size. This method is useful for generating a bounding box when you have a central point and want the box to extend equally in all directions from that point.
Usage
To use the FromPositionAndSize
method, provide a reference to a Vector3
representing the center of the bounding box and a float
value for the size. The size represents the length of each side of the bounding box, extending equally from the center.
Example
// Example of creating a BBox using FromPositionAndSize
Vector3 center = new Vector3(0, 0, 0);
float size = 10.0f;
BBox boundingBox = BBox.FromPositionAndSize(ref center, size);
// The bounding box will be centered at (0, 0, 0) with each side of length 10.