Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


TestOverlapGeometry

Tests if the provided Circle geometry overlaps any shapes. A circle with a radius of zero is equivalent to PhysicsWorld.TestOverlapPoint. See CircleGeometry and PhysicsQuery.QueryFilter.
Read time 8 minutesLast updated 5 days ago

Definition

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

TestOverlapGeometry(CircleGeometry, QueryFilter)

Tests if the provided Circle geometry overlaps any shapes. A circle with a radius of zero is equivalent to PhysicsWorld.TestOverlapPoint. See CircleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(CircleGeometry geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<CircleGeometry>, QueryFilter)

Tests if the provided Circle geometry overlaps any shapes. A circle with a radius of zero is equivalent to PhysicsWorld.TestOverlapPoint. See CircleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<CircleGeometry> geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(CircleGeometry, Vector2, QueryFilter)

Tests if the provided Circle geometry overlaps any shapes. A circle with a radius of zero is equivalent to PhysicsWorld.TestOverlapPoint. See CircleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(CircleGeometry geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Circle geometry used to check overlap. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<CircleGeometry>, Vector2, QueryFilter)

Tests if the provided Circle geometry overlaps any shapes. A circle with a radius of zero is equivalent to PhysicsWorld.TestOverlapPoint. See CircleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<CircleGeometry> geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Circle geometry used to check overlap. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(CapsuleGeometry, QueryFilter)

Tests if the provided Capsule geometry overlaps any shapes. See CapsuleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(CapsuleGeometry geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<CapsuleGeometry>, QueryFilter)

Tests if the provided Capsule geometry overlaps any shapes. See CapsuleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<CapsuleGeometry> geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(CapsuleGeometry, Vector2, QueryFilter)

Tests if the provided Capsule geometry overlaps any shapes. See CapsuleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(CapsuleGeometry geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Capsule geometry used to check overlap. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<CapsuleGeometry>, Vector2, QueryFilter)

Tests if the provided Capsule geometry overlaps any shapes. See CapsuleGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<CapsuleGeometry> geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Capsule geometry used to check overlap. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(PolygonGeometry, QueryFilter)

Tests if the provided Polygon geometry overlaps any shapes. See PolygonGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(PolygonGeometry geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<PolygonGeometry>, QueryFilter)

Tests if the provided Polygon geometry overlaps any shapes. See PolygonGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<PolygonGeometry> geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(PolygonGeometry, Vector2, QueryFilter)

Tests if the provided Polygon geometry overlaps any shapes. See PolygonGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(PolygonGeometry geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Polygon geometry used to check overlap. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<PolygonGeometry>, Vector2, QueryFilter)

Tests if the provided Polygon geometry overlaps any shapes. See PolygonGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<PolygonGeometry> geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Polygon geometry used to check overlap. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(SegmentGeometry, QueryFilter)

Tests if the provided Segment geometry overlaps any shapes. See SegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(SegmentGeometry geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<SegmentGeometry>, QueryFilter)

Tests if the provided Segment geometry overlaps any shapes. See SegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<SegmentGeometry> geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(SegmentGeometry, Vector2, QueryFilter)

Tests if the provided Segment geometry overlaps any shapes. See SegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(SegmentGeometry geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Segment geometry used to check overlap. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<SegmentGeometry>, Vector2, QueryFilter)

Tests if the provided Segment geometry overlaps any shapes. See SegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<SegmentGeometry> geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Segment geometry used to check overlap. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ChainSegmentGeometry, QueryFilter)

Tests if the provided Chain-Segment geometry overlaps any shapes. See ChainSegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ChainSegmentGeometry geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<ChainSegmentGeometry>, QueryFilter)

Tests if the provided Chain-Segment geometry overlaps any shapes. See ChainSegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<ChainSegmentGeometry> geometry, PhysicsQuery.QueryFilter filter)

Parameters

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

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ChainSegmentGeometry, Vector2, QueryFilter)

Tests if the provided Chain-Segment geometry overlaps any shapes. See ChainSegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ChainSegmentGeometry geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Chain-Segment geometry used to check overlap. This must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.

TestOverlapGeometry(ReadOnlySpan<ChainSegmentGeometry>, Vector2, QueryFilter)

Tests if the provided Chain-Segment geometry overlaps any shapes. See ChainSegmentGeometry and PhysicsQuery.QueryFilter.
public bool TestOverlapGeometry(ReadOnlySpan<ChainSegmentGeometry> geometry, Vector2 origin, PhysicsQuery.QueryFilter filter)

Parameters

The Chain-Segment geometry used to check overlap. These must be in local-space, relative to
origin
.

origin

The point, in world space, that the geometry is defined relative to. This lets the geometry be authored in a local frame instead of being translated into world space before the query.

The filter to control the result returned.

Returns

Type

Description

boolIf the query overlaps anything.