> 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.client.unity/ks.reactor.client.unity.ksconvexhull.md).

# Class ksConvexHull

Namespace: [KS.Reactor.Client.Unity](/reactor/api-reference/ks.reactor.client.unity.md)\
Assembly: KSUnity-Source.dll

Stores a convex hull created from a mesh.

```csharp
public class ksConvexHull
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) â† [ksConvexHull](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksconvexhull.md)

#### 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.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone), [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

### ksConvexHull(List\<Vector3>, ksVector3, float) <a href="#ks_reactor_client_unity_ksconvexhull__ctor_system_collections_generic_list_unityengine_vector3__ks_r" id="ks_reactor_client_unity_ksconvexhull__ctor_system_collections_generic_list_unityengine_vector3__ks_r"></a>

Construct a convex hull with a known center of mass and volume.

```csharp
public ksConvexHull(List<Vector3> vertices, ksVector3 centerOfMass, float volume)
```

#### Parameters

`vertices` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)\<Vector3>

Vertices to generate convex hull from.

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

Center of mass.

`volume` [float](https://learn.microsoft.com/dotnet/api/system.single)

Volume of convex hull.

### ksConvexHull(List\<Vector3>, float) <a href="#ks_reactor_client_unity_ksconvexhull__ctor_system_collections_generic_list_unityengine_vector3__syst" id="ks_reactor_client_unity_ksconvexhull__ctor_system_collections_generic_list_unityengine_vector3__syst"></a>

Construct a scaled convex hull.

```csharp
public ksConvexHull(List<Vector3> vertices, float scale)
```

#### Parameters

`vertices` [List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)\<Vector3>

Vertices to generate convex null from.

`scale` [float](https://learn.microsoft.com/dotnet/api/system.single)

Scale the vertices before and after convex hull calculations.

## Properties

### GeometricCenter <a href="#ks_reactor_client_unity_ksconvexhull_geometriccenter" id="ks_reactor_client_unity_ksconvexhull_geometriccenter"></a>

Geometric center of the convex hull.

```csharp
public Vector3 GeometricCenter { get; }
```

#### Property Value

Vector3

### Vertices <a href="#ks_reactor_client_unity_ksconvexhull_vertices" id="ks_reactor_client_unity_ksconvexhull_vertices"></a>

Convex hull vertices.

```csharp
public List<Vector3> Vertices { get; }
```

#### Property Value

[List](https://learn.microsoft.com/dotnet/api/system.collections.generic.list-1)\<Vector3>

### Volume <a href="#ks_reactor_client_unity_ksconvexhull_volume" id="ks_reactor_client_unity_ksconvexhull_volume"></a>

Convex hull volume.

```csharp
public float Volume { get; }
```

#### Property Value

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

## Methods

### ClearDestroyedMeshes() <a href="#ks_reactor_client_unity_ksconvexhull_cleardestroyedmeshes" id="ks_reactor_client_unity_ksconvexhull_cleardestroyedmeshes"></a>

Removes destroyed meshes from the cache.

```csharp
public static void ClearDestroyedMeshes()
```

### ClearRejects() <a href="#ks_reactor_client_unity_ksconvexhull_clearrejects" id="ks_reactor_client_unity_ksconvexhull_clearrejects"></a>

Clear the list of rejected convex hull.

```csharp
public static void ClearRejects()
```

### Get(Mesh) <a href="#ks_reactor_client_unity_ksconvexhull_get_unityengine_mesh" id="ks_reactor_client_unity_ksconvexhull_get_unityengine_mesh"></a>

Gets a convex hull from a mesh. Convex hulls are cached so calling [Get](#KS_Reactor_Client_Unity_ksConvexHull_Get_UnityEngine_Mesh_) with the same mesh multiple times will always return the same object.

```csharp
public static ksConvexHull Get(Mesh mesh)
```

#### Parameters

`mesh` Mesh

Mesh to get convex hull for.

#### Returns

[ksConvexHull](/reactor/api-reference/ks.reactor.client.unity/ks.reactor.client.unity.ksconvexhull.md)

Convex hull
