static BBox FromPositionAndSize( Vector3& center, float size )
static BBox FromPositionAndSize( Vector3 center, Vector3 size )

robot_2Generated
code_blocksInput

Description

The FromPositionAndSize method creates a new BBox (Axis Aligned Bounding Box) 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 by a given size.

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 method will return a BBox that is centered at the specified position and extends equally in all directions by half of the size value.

Example

// Example of using BBox.FromPositionAndSize
Vector3 center = new Vector3(0, 0, 0);
float size = 10.0f;
BBox boundingBox = BBox.FromPositionAndSize(ref center, size);

// The bounding box is now centered at (0, 0, 0) with a size of 10 units in each direction.