Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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 8 minutesLast updated 10 days ago

Definition

  • Type: Method
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule

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.

allocator

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(ReadOnlySpan<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(ReadOnlySpan<CircleGeometry> geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)

Parameters

The Circle geometry used to check overlap. These must be in world-space.

The filter to control what results are returned.

allocator

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.

allocator

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(ReadOnlySpan<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(ReadOnlySpan<CapsuleGeometry> geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)

Parameters

The Capsule geometry used to check overlap. These must be in world-space.

The filter to control what results are returned.

allocator

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.

allocator

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(ReadOnlySpan<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(ReadOnlySpan<PolygonGeometry> geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)

Parameters

The Polygon geometry used to check overlap. These must be in world-space.

The filter to control what results are returned.

allocator

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.

allocator

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(ReadOnlySpan<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(ReadOnlySpan<SegmentGeometry> geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)

Parameters

The Segment geometry used to check overlap. These must be in world-space.

The filter to control what results are returned.

allocator

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.

allocator

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(ReadOnlySpan<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(ReadOnlySpan<ChainSegmentGeometry> geometry, PhysicsQuery.QueryFilter filter, Allocator allocator = Allocator.Temp)

Parameters

The Chain-Segment geometry used to check overlap. These must be in world-space.

The filter to control what results are returned.

allocator

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.