> For the complete documentation index, see [llms.txt](https://kinematicsoup.gitbook.io/reactor/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://kinematicsoup.gitbook.io/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md).

# Struct ksBounds

Namespace: [KS.Reactor](/reactor/api-reference/ks.reactor.md)\
Assembly: KSCommon.dll

A struct that defines an axis aligned bounding box (AABB).

```csharp
public struct ksBounds : IEquatable<ksBounds>
```

#### Implements

[IEquatable\<ksBounds>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

#### Inherited Members

[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)), [object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)), [object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode), [object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype), [object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals), [object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)

## Constructors

### ksBounds(ksVector3, ksVector3) <a href="#ks_reactor_ksbounds__ctor_ks_reactor_ksvector3_ks_reactor_ksvector3" id="ks_reactor_ksbounds__ctor_ks_reactor_ksvector3_ks_reactor_ksvector3"></a>

Constructor.

```csharp
public ksBounds(ksVector3 min, ksVector3 max)
```

#### Parameters

`min` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

Min value.

`max` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

Max value.

## Properties

### Center <a href="#ks_reactor_ksbounds_center" id="ks_reactor_ksbounds_center"></a>

Get/Set the center of the bounds

```csharp
public ksVector3 Center { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

### IsEmpty <a href="#ks_reactor_ksbounds_isempty" id="ks_reactor_ksbounds_isempty"></a>

The bounds are empty if any of the size dimensions are less than or equal to 0.

```csharp
public bool IsEmpty { get; }
```

#### Property Value

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

### Max <a href="#ks_reactor_ksbounds_max" id="ks_reactor_ksbounds_max"></a>

Get the maxmimum coordinates contained by the bounds. The min value of the bounds will extend to accomodate the new max value when it is contains smaller values than the current min values.

```csharp
public ksVector3 Max { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

### Min <a href="#ks_reactor_ksbounds_min" id="ks_reactor_ksbounds_min"></a>

Get/Set the minimum coordinates contained by the bounds. The max value of the bounds will extend to accomodate the new min value when it contains larger values than the current max values.

```csharp
public ksVector3 Min { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

### Size <a href="#ks_reactor_ksbounds_size" id="ks_reactor_ksbounds_size"></a>

Get/Set the size of the bounds. The new size will recalculate the min and max values from the existing bounds center.

```csharp
public ksVector3 Size { get; set; }
```

#### Property Value

[ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

## Methods

### Contains(ksVector3) <a href="#ks_reactor_ksbounds_contains_ks_reactor_ksvector3" id="ks_reactor_ksbounds_contains_ks_reactor_ksvector3"></a>

Check if a point is contained by the bounds.

```csharp
public bool Contains(ksVector3 point)
```

#### Parameters

`point` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

Point to test.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the point is contained or on the edge of the bounds.

### Contains(ksBounds) <a href="#ks_reactor_ksbounds_contains_ks_reactor_ksbounds" id="ks_reactor_ksbounds_contains_ks_reactor_ksbounds"></a>

Check if another set of bounds is contained by the bounds.

```csharp
public bool Contains(ksBounds bounds)
```

#### Parameters

`bounds` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Bounds to test.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the other bounds are contained.

### Encapsulate(ksVector3) <a href="#ks_reactor_ksbounds_encapsulate_ks_reactor_ksvector3" id="ks_reactor_ksbounds_encapsulate_ks_reactor_ksvector3"></a>

Expand the volume to include a point.

```csharp
public void Encapsulate(ksVector3 point)
```

#### Parameters

`point` [ksVector3](/reactor/api-reference/ks.reactor/ks.reactor.ksvector3.md)

Point to encapsulate.

### Encapsulate(ksBounds) <a href="#ks_reactor_ksbounds_encapsulate_ks_reactor_ksbounds" id="ks_reactor_ksbounds_encapsulate_ks_reactor_ksbounds"></a>

Expand the volume to include another set of bounds.

```csharp
public void Encapsulate(ksBounds bounds)
```

#### Parameters

`bounds` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Bounds to encapsulate.

### Equals(ksBounds) <a href="#ks_reactor_ksbounds_equals_ks_reactor_ksbounds" id="ks_reactor_ksbounds_equals_ks_reactor_ksbounds"></a>

Check if this bounds is equal to another bounds.

```csharp
public bool Equals(ksBounds other)
```

#### Parameters

`other` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Other bounds to compare with this bounds.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds have the same min and max values.

### Equals(object) <a href="#ks_reactor_ksbounds_equals_system_object" id="ks_reactor_ksbounds_equals_system_object"></a>

Check if this bounds is equal to an object.

```csharp
public override bool Equals(object obj)
```

#### Parameters

`obj` [object](https://learn.microsoft.com/dotnet/api/system.object)

Object to compare with this bounds.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the object is a [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md) and they have the same min and max values.

### GetHashCode() <a href="#ks_reactor_ksbounds_gethashcode" id="ks_reactor_ksbounds_gethashcode"></a>

Get the hash code for the bounds.

```csharp
public override int GetHashCode()
```

#### Returns

[int](https://learn.microsoft.com/dotnet/api/system.int32)

### Intersects(ksBounds) <a href="#ks_reactor_ksbounds_intersects_ks_reactor_ksbounds" id="ks_reactor_ksbounds_intersects_ks_reactor_ksbounds"></a>

Check if another bounds intersects this bounds.

```csharp
public bool Intersects(ksBounds bounds)
```

#### Parameters

`bounds` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Bounds to test against.

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds overlap.

### ToString() <a href="#ks_reactor_ksbounds_tostring" id="ks_reactor_ksbounds_tostring"></a>

Construct a string the describes the bounds.

```csharp
public override string ToString()
```

#### Returns

[string](https://learn.microsoft.com/dotnet/api/system.string)

String describing the min and max coordinates of the bounds.

## Operators

### operator ==(ksBounds, ksBounds) <a href="#ks_reactor_ksbounds_op_equality_ks_reactor_ksbounds_ks_reactor_ksbounds" id="ks_reactor_ksbounds_op_equality_ks_reactor_ksbounds_ks_reactor_ksbounds"></a>

Check if two bounds are equal

```csharp
public static bool operator ==(ksBounds lhs, ksBounds rhs)
```

#### Parameters

`lhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

`rhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds have the same min and max values.

### operator ==(ksBounds, Bounds) <a href="#ks_reactor_ksbounds_op_equality_ks_reactor_ksbounds_unityengine_bounds" id="ks_reactor_ksbounds_op_equality_ks_reactor_ksbounds_unityengine_bounds"></a>

Equality comparison between Reactor bounds and Unity bounds.

```csharp
public static bool operator ==(ksBounds lhs, Bounds rhs)
```

#### Parameters

`lhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Reactor bounds

`rhs` Bounds

Unity bounds

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds are equal.

### operator ==(Bounds, ksBounds) <a href="#ks_reactor_ksbounds_op_equality_unityengine_bounds_ks_reactor_ksbounds" id="ks_reactor_ksbounds_op_equality_unityengine_bounds_ks_reactor_ksbounds"></a>

Equality comparison between Unity bounds and Reactor bounds.

```csharp
public static bool operator ==(Bounds lhs, ksBounds rhs)
```

#### Parameters

`lhs` Bounds

Unity bounds

`rhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Reactor bounds

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds are equal.

### implicit operator Bounds(ksBounds) <a href="#ks_reactor_ksbounds_op_implicit_ks_reactor_ksbounds__unityengine_bounds" id="ks_reactor_ksbounds_op_implicit_ks_reactor_ksbounds__unityengine_bounds"></a>

Implicit conversion from ksBounds to Unity Bounds.

```csharp
public static implicit operator Bounds(ksBounds value)
```

#### Parameters

`value` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Reactor bounds to convert to Unity bounds.

#### Returns

Bounds

### implicit operator ksBounds(Bounds) <a href="#ks_reactor_ksbounds_op_implicit_unityengine_bounds__ks_reactor_ksbounds" id="ks_reactor_ksbounds_op_implicit_unityengine_bounds__ks_reactor_ksbounds"></a>

Implicit conversion from Unity Bounds to ksBounds.

```csharp
public static implicit operator ksBounds(Bounds value)
```

#### Parameters

`value` Bounds

Unity bounds to convert to Reactor bounds

#### Returns

[ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

### operator !=(ksBounds, ksBounds) <a href="#ks_reactor_ksbounds_op_inequality_ks_reactor_ksbounds_ks_reactor_ksbounds" id="ks_reactor_ksbounds_op_inequality_ks_reactor_ksbounds_ks_reactor_ksbounds"></a>

Check if two bounds are not equal

```csharp
public static bool operator !=(ksBounds lhs, ksBounds rhs)
```

#### Parameters

`lhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

`rhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds have different min or max values.

### operator !=(ksBounds, Bounds) <a href="#ks_reactor_ksbounds_op_inequality_ks_reactor_ksbounds_unityengine_bounds" id="ks_reactor_ksbounds_op_inequality_ks_reactor_ksbounds_unityengine_bounds"></a>

Inequality comparison between Reactor bounds and Unity bounds.

```csharp
public static bool operator !=(ksBounds lhs, Bounds rhs)
```

#### Parameters

`lhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Reactor bounds

`rhs` Bounds

Unity bounds

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds are not equal.

### operator !=(Bounds, ksBounds) <a href="#ks_reactor_ksbounds_op_inequality_unityengine_bounds_ks_reactor_ksbounds" id="ks_reactor_ksbounds_op_inequality_unityengine_bounds_ks_reactor_ksbounds"></a>

Inequality comparison between Unity bounds and Reactor bounds.

```csharp
public static bool operator !=(Bounds lhs, ksBounds rhs)
```

#### Parameters

`lhs` Bounds

Unity bounds

`rhs` [ksBounds](/reactor/api-reference/ks.reactor/ks.reactor.ksbounds.md)

Reactor bounds

#### Returns

[bool](https://learn.microsoft.com/dotnet/api/system.boolean)

True if the bounds are not equal.
