Structure

# BoundingBox

An axis-aligned bounding box.

## Topics

### Creating a Bounding Box

`init()`

Creates an empty bounding box.

`init(min: SIMD3<Float>, max: SIMD3<Float>)`

Creates a bounding box with the given settings.

### Getting an Empty Box

`var isEmpty: Bool`

A Boolean that indicates whether a box is empty.

### Getting the Box Characteristics

`var max: SIMD3<Float>`

The position of the maximum corner of the box.

`var min: SIMD3<Float>`

The position of the minimum corner of the box.

`var center: SIMD3<Float>`

The center of the bounding box.

`var extents: SIMD3<Float>`

The extents of the bounding box.

`var boundingRadius: Float`

The radius of a bounding sphere that encompasses the bounding box.

### Expanding Boxes

`func union(BoundingBox) -> BoundingBox`

Creates a bounding box containing the current bounds and the specified bounds.

`func formUnion(BoundingBox)`

Expands the bounding box to contain the specified bounds.

`func union(SIMD3<Float>) -> BoundingBox`

Creates a bounding box containing the current bounds and the specified point.

`func formUnion(SIMD3<Float>)`

Expands the bounding box to contain the specified point.

### Checking for Overlap

`func contains(BoundingBox) -> Bool`

Checks whether the bounding box contains the specified bounds.

`func contains(SIMD3<Float>) -> Bool`

Checks whether the bounding box contains the specified point.

`func intersects(BoundingBox) -> Bool`

Checks whether the bounding box intersects the specified bounds.

### Checking for Separation

`func distanceSquared(toPoint: SIMD3<Float>) -> Float`

Calculates the distance from a point to the bounding box.

### Transforming a Bounding Box

`func transform(by: float4x4)`

Transforms the bounding box.

`func transformed(by: float4x4) -> BoundingBox`

Transforms the bounding box and finds the bounds of the result.

### Comparing Bounding Boxes

`static func == (BoundingBox, BoundingBox) -> Bool`

Indicates whether two bounding boxes are equal.

`static func != (BoundingBox, BoundingBox) -> Bool`

Indicates whether two bounding boxes are not equal.

`func hash(into: inout Hasher)`

Hashes the essential components of the bounding box by feeding them into the given hash function.

`var hashValue: Int`

The hashed value of the bounding box.

## Relationships

### Conforms To

`var bounds: BoundingBox`