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
Read time 4 minutesLast updated 12 days ago
Definition
- Type: Method
- Namespace: UnityEngine.LowLevelPhysics2D
- 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. See CircleGeometry, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(CircleGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
Parameters
The Circle geometry used to check overlap. This must be in world-space.
The filter to control what results are returned.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<WorldOverlapResult> | 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, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator.
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(CapsuleGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
Parameters
The Capsule geometry used to check overlap. This must be in world-space.
The filter to control what results are returned.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<WorldOverlapResult> | 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, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator.
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(PolygonGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
Parameters
The Polygon geometry used to check overlap. This must be in world-space.
The filter to control what results are returned.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<WorldOverlapResult> | 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, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator.
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(SegmentGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
Parameters
The Segment geometry used to check overlap. This must be in world-space.
The filter to control what results are returned.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<WorldOverlapResult> | 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, PhysicsQuery.QueryFilter, PhysicsQuery.WorldOverlapResult and Allocator.
public NativeArray<PhysicsQuery.WorldOverlapResult> OverlapGeometry(ChainSegmentGeometry geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)
Parameters
The Chain-Segment geometry used to check overlap. This must be in world-space.
The filter to control what results are returned.
The memory allocator to use for the results. This can only be Allocator.Temp, Allocator.TempJob or Allocator.Persistent.
Returns
Type | Description |
|---|---|
| NativeArray<WorldOverlapResult> | 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. |