# Struct BoundingBox

Contents
[ ]

## BoundingBox structure

The axis-aligned bounding box

``````public struct BoundingBox
``````

## Constructors

NameDescription
BoundingBox(Vector3, Vector3)Initialize a finite bounding box with given minimum and maximum corner
BoundingBox(double, double, double, double, double, double)Initialize a finite bounding box with given minimum and maximum corner

## Properties

NameDescription
static Infinite { get; }The infinite bounding box
static Null { get; }The null bounding box
Center { get; }The center of the bounding box.
Extent { get; }Gets the extent of the bounding box.
Maximum { get; }The maximum corner of the bounding box
Minimum { get; }The minimum corner of the bounding box
Size { get; }The size of the bounding box

## Methods

NameDescription
static FromGeometry(Geometry)Construct a bounding box from given geometry
Contains(Vector3)Check if the point p is inside the bounding box
override Equals(object)Determines if two objects are equal
override GetHashCode()Returns the hash code for this instance
Merge(BoundingBox)Merges the new box into the current bounding box.
Merge(Vector3)Merge current bounding box with given point
Merge(Vector4)Merge current bounding box with given point
Merge(double, double, double)Merge current bounding box with given point
OverlapsWith(BoundingBox)Check if current bounding box overlaps with specified bounding box.
Scale()Calculates the absolute largest coordinate value of any contained point.
override ToString()Gets the string representation of the bounding box.
operator *Operator overloading for multiply, new bounding box’s minimum and maximum corner will be transformed by the matrix.

### Examples

The following code shows how to get a bounding box from an Entity instance.

``````var sphere = new Sphere();
var boundingBox = sphere.GetBoundingBox();
Console.WriteLine("Bounding box = " + boundingBox);
``````