# BoundsInt

> Represents an axis aligned bounding box with all values as integers.

## Definition

* **Type:** Struct
* **Namespace:** [UnityEngine](/engine/6000.5/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule
* **Implements:** [IEquatable\<BoundsInt>](https://learn.microsoft.com/dotnet/api/system.iequatable-1), [IFormattable](https://learn.microsoft.com/dotnet/api/system.iformattable)

```csharp
public struct BoundsInt : IEquatable<BoundsInt>, IFormattable
```

## Remarks

An axis-aligned bounding box, or AABB for short, is a box aligned with coordinate axes and fully enclosing some object. As the box is never rotated with respect to the axes, it can be defined by [BoundsInt.min](/engine/6000.5/script-reference/unityengine/boundsint/min.md) and [BoundsInt.max](/engine/6000.5/script-reference/unityengine/boundsint/max.md) points.

## Properties

| Property                                                                                          | Description                                                                                                                        |
| ------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
| [allPositionsWithin](/engine/6000.5/script-reference/unityengine/boundsint/allpositionswithin.md) | A PositionCollection that contains all positions within the [BoundsInt](/engine/6000.5/script-reference/unityengine/boundsint.md). |
| [center](/engine/6000.5/script-reference/unityengine/boundsint/center.md)                         | The center of the bounding box.                                                                                                    |
| [max](/engine/6000.5/script-reference/unityengine/boundsint/max.md)                               | The maximal point of the box.                                                                                                      |
| [min](/engine/6000.5/script-reference/unityengine/boundsint/min.md)                               | The minimal point of the box.                                                                                                      |
| [position](/engine/6000.5/script-reference/unityengine/boundsint/position.md)                     | The position of the bounding box.                                                                                                  |
| [size](/engine/6000.5/script-reference/unityengine/boundsint/size.md)                             | The total size of the box.                                                                                                         |
| [x](/engine/6000.5/script-reference/unityengine/boundsint/x.md)                                   | X value of the minimal point of the box.                                                                                           |
| [xMax](/engine/6000.5/script-reference/unityengine/boundsint/xmax.md)                             | The maximal x point of the box.                                                                                                    |
| [xMin](/engine/6000.5/script-reference/unityengine/boundsint/xmin.md)                             | The minimal x point of the box.                                                                                                    |
| [y](/engine/6000.5/script-reference/unityengine/boundsint/y.md)                                   | Y value of the minimal point of the box.                                                                                           |
| [yMax](/engine/6000.5/script-reference/unityengine/boundsint/ymax.md)                             | The maximal y point of the box.                                                                                                    |
| [yMin](/engine/6000.5/script-reference/unityengine/boundsint/ymin.md)                             | The minimal y point of the box.                                                                                                    |
| [z](/engine/6000.5/script-reference/unityengine/boundsint/z.md)                                   | Z value of the minimal point of the box.                                                                                           |
| [zMax](/engine/6000.5/script-reference/unityengine/boundsint/zmax.md)                             | The maximal z point of the box.                                                                                                    |
| [zMin](/engine/6000.5/script-reference/unityengine/boundsint/zmin.md)                             | The minimal z point of the box.                                                                                                    |

## Methods

| Method                                                                                  | Description                                                            |
| --------------------------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [ClampToBounds](/engine/6000.5/script-reference/unityengine/boundsint/clamptobounds.md) | Clamps the position and size of this bounding box to the given bounds. |
| [Contains](/engine/6000.5/script-reference/unityengine/boundsint/contains.md)           | Is `point` contained in the bounding box?                              |
| [SetMinMax](/engine/6000.5/script-reference/unityengine/boundsint/setminmax.md)         | Sets the bounds to the `min` and `max` value of the box.               |
| [ToString](/engine/6000.5/script-reference/unityengine/boundsint/tostring.md)           | Returns a formatted string for the bounds.                             |

## Structs

| Struct                                                                                                      | Description                                                                                                                                 |
| ----------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| [BoundsInt.PositionEnumerator](/engine/6000.5/script-reference/unityengine/boundsint/positionenumerator.md) | An iterator that allows you to iterate over all positions within the [BoundsInt](/engine/6000.5/script-reference/unityengine/boundsint.md). |
