static BBox FromHeightAndRadius( float height, float radius )

book_4_sparkGenerated
code_blocksInput

Description

The FromHeightAndRadius method is a static method of the BBox struct that creates an axis-aligned bounding box (AABB) based on a specified height and radius. This method is useful for generating a bounding box that encapsulates a cylindrical shape, where the height represents the vertical extent and the radius represents the horizontal extent from the center to the edge.

Usage

To use the FromHeightAndRadius method, call it statically from the BBox struct, passing in the desired height and radius as parameters. The method will return a BBox instance that represents the bounding box for the specified dimensions.

Example

// Example of creating a bounding box from height and radius
float height = 10.0f;
float radius = 5.0f;

BBox boundingBox = BBox.FromHeightAndRadius(height, radius);

// Use the bounding box for further operations
Vector3 center = boundingBox.Center;
Vector3 size = boundingBox.Size;