# OverlapGeometry

> Returns all shapes that overlap the provided Circle geometry. A circle with a radius of zero is equivalent to PhysicsWorld.OverlapPoint. See CircleGeometry, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine.LowLevelPhysics2D](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d.md)
* **Assembly:** UnityEngine.Physics2DModule

## OverlapGeometry(CircleGeometry, QueryFilter, Allocator)

Returns all shapes that overlap the provided Circle geometry. A circle with a radius of zero is equivalent to [PhysicsWorld.OverlapPoint](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsworld/overlappoint.md). See [CircleGeometry](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/circlegeometry.md), [PhysicsQuery.QueryFilter](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter.md), [PhysicsQuery.WorldOverlapResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/worldoverlapresult.md) and [Allocator](/engine/6000.3/script-reference/unity/collections/allocator.md)

```csharp
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(CircleGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[CircleGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/circlegeometry)): The Circle geometry used to check overlap. This must be in world-space.**** (\[QueryFilter]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter)): The filter to control what results are returned.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                                  | Description                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<WorldOverlapResult>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The query overlap results. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## OverlapGeometry(CapsuleGeometry, QueryFilter, Allocator)

Returns all shapes that overlap the provided Capsule geometry. See [CapsuleGeometry](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/capsulegeometry.md), [PhysicsQuery.QueryFilter](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter.md), [PhysicsQuery.WorldOverlapResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/worldoverlapresult.md) and [Allocator](/engine/6000.3/script-reference/unity/collections/allocator.md).

```csharp
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(CapsuleGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[CapsuleGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/capsulegeometry)): The Capsule geometry used to check overlap. This must be in world-space.**** (\[QueryFilter]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter)): The filter to control what results are returned.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                                  | Description                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<WorldOverlapResult>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The query overlap results. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## OverlapGeometry(PolygonGeometry, QueryFilter, Allocator)

Returns all shapes that overlap the provided Polygon geometry. See [PolygonGeometry](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/polygongeometry.md), [PhysicsQuery.QueryFilter](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter.md), [PhysicsQuery.WorldOverlapResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/worldoverlapresult.md) and [Allocator](/engine/6000.3/script-reference/unity/collections/allocator.md).

```csharp
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(PolygonGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[PolygonGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/polygongeometry)): The Polygon geometry used to check overlap. This must be in world-space.**** (\[QueryFilter]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter)): The filter to control what results are returned.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                                  | Description                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<WorldOverlapResult>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The query overlap results. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## OverlapGeometry(SegmentGeometry, QueryFilter, Allocator)

Returns all shapes that overlap the provided Segment geometry. See [SegmentGeometry](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/segmentgeometry.md), [PhysicsQuery.QueryFilter](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter.md), [PhysicsQuery.WorldOverlapResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/worldoverlapresult.md) and [Allocator](/engine/6000.3/script-reference/unity/collections/allocator.md).

```csharp
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(SegmentGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[SegmentGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/segmentgeometry)): The Segment geometry used to check overlap. This must be in world-space.**** (\[QueryFilter]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter)): The filter to control what results are returned.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                                  | Description                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<WorldOverlapResult>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The query overlap results. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |

## OverlapGeometry(ChainSegmentGeometry, QueryFilter, Allocator)

Returns all shapes that overlap the provided Chain-Segment geometry. See [ChainSegmentGeometry](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/chainsegmentgeometry.md), [PhysicsQuery.QueryFilter](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter.md), [PhysicsQuery.WorldOverlapResult](/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/worldoverlapresult.md) and [Allocator](/engine/6000.3/script-reference/unity/collections/allocator.md).

```csharp
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(ChainSegmentGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
```

### Parameters

**** (\[ChainSegmentGeometry]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/chainsegmentgeometry)): The Chain-Segment geometry used to check overlap. This must be in world-space.**** (\[QueryFilter]\(/engine/6000.3/script-reference/unityengine/lowlevelphysics2d/physicsquery/queryfilter)): The filter to control what results are returned.**** (\[Allocator]\(/engine/6000.3/script-reference/unity/collections/allocator)): The memory allocator to use for the results. This can only be [Allocator.Temp](/engine/6000.3/script-reference/unity/collections/allocator/temp.md), [Allocator.TempJob](/engine/6000.3/script-reference/unity/collections/allocator/tempjob.md) or [Allocator.Persistent](/engine/6000.3/script-reference/unity/collections/allocator/persistent.md).

### Returns

| Type                                                                                                  | Description                                                                                                                                           |
| ----------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| [NativeArray\<WorldOverlapResult>](/engine/6000.3/script-reference/unity/collections/nativearray1.md) | The query overlap results. This NativeArray must be disposed of after use otherwise leaks will occur. The exception to this is if the array is empty. |
