# PhysicsQuery

> Various physics queries.

## Definition

* **Type:** Struct
* **Namespace:** [Unity.U2D.Physics](/engine/6000.7/script-reference/unity/u2d/physics.md)
* **Assembly:** UnityEngine.PhysicsCore2DModule
* **Implements:** [IEquatable\<PhysicsQuery>](https://learn.microsoft.com/dotnet/api/system.iequatable-1)

```csharp
public readonly struct PhysicsQuery : IEquatable<PhysicsQuery>
```

## Static Methods

| Method                                                                                                             | Description                                                                                                                                                                                                                                                 |
| ------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [CapsuleAndCapsule](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/capsuleandcapsule.md)           | Check the intersection between Capsule and Capsule geometries.                                                                                                                                                                                              |
| [CapsuleAndCircle](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/capsuleandcircle.md)             | Check the intersection between Capsule and Circle geometries.                                                                                                                                                                                               |
| [CastShapes](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castshapes.md)                         | Cast two shape proxies against each other. Initially touching shapes are treated as a miss. You should check for overlap first if initial overlap is required.                                                                                              |
| [ChainSegmentAndCapsule](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/chainsegmentandcapsule.md) | Check the intersection between ChainSegment and Capsule geometries.                                                                                                                                                                                         |
| [ChainSegmentAndCircle](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/chainsegmentandcircle.md)   | Check the intersection between ChainSegment and Circle geometries.                                                                                                                                                                                          |
| [ChainSegmentAndPolygon](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/chainsegmentandpolygon.md) | Check the intersection between ChainSegment and Polygon geometries.                                                                                                                                                                                         |
| [CircleAndCircle](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/circleandcircle.md)               | Check the intersection between Circle and Circle geometries.                                                                                                                                                                                                |
| [PolygonAndCapsule](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/polygonandcapsule.md)           | Check the intersection between Polygon and Capsule geometries.                                                                                                                                                                                              |
| [PolygonAndCircle](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/polygonandcircle.md)             | Check the intersection between Polygon and Circle geometries.                                                                                                                                                                                               |
| [PolygonAndPolygon](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/polygonandpolygon.md)           | Check the intersection between Polygon and Polygon geometries.                                                                                                                                                                                              |
| [SegmentAndCapsule](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/segmentandcapsule.md)           | Check the intersection between Segment and Capsule geometries.                                                                                                                                                                                              |
| [SegmentAndCircle](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/segmentandcircle.md)             | Check the intersection between Segment and Circle geometries.                                                                                                                                                                                               |
| [SegmentAndPolygon](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/segmentandpolygon.md)           | Check the intersection between Segment and Polygon geometries.                                                                                                                                                                                              |
| [SegmentDistance](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/segmentdistance.md)               | Calculate the distance and closest points between two segments.                                                                                                                                                                                             |
| [ShapeAndShape](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/shapeandshape.md)                   | Check the intersection between two shapes ([PhysicsShape](/engine/6000.7/script-reference/unity/u2d/physics/physicsshape.md)).                                                                                                                              |
| [ShapeDistance](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/shapedistance.md)                   | Calculate the distance and closest points between two shape proxies.                                                                                                                                                                                        |
| [ShapeTimeOfImpact](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/shapetimeofimpact.md)           | Calculate the upper bound on time before two shape proxies penetrate i.e. the time-of-impact. Time is represented as a fraction in the range \[0, maxInterval]. This uses a swept separating axis and may miss some intermediate, non-tunneling collisions. |

## Structs

| Struct                                                                                                                        | Description                                                                                                                                                                              |
| ----------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PhysicsQuery.CastRayInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castrayinput.md)                   | Cast-Ray arguments used by CastRay queries.                                                                                                                                              |
| [PhysicsQuery.CastResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castresult.md)                       | Cast result when performing cast-ray or cast-shape queries against geometry.                                                                                                             |
| [PhysicsQuery.CastShapeInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castshapeinput.md)               | Cast shape arguments used by CastShape queries. To use existing shape geometries, use the helper constructors that allow creation via a specific shape geometry type.                    |
| [PhysicsQuery.CastShapePairInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/castshapepairinput.md)       | Cast two shape proxies against each other. To use existing shape geometries, use the helper constructors that allow creation via a specific shape geometry type.                         |
| [PhysicsQuery.DistanceInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/distanceinput.md)                 | An input used for shape distance queries.                                                                                                                                                |
| [PhysicsQuery.DistanceResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/distanceresult.md)               | Distance result from shape distance queries.                                                                                                                                             |
| [PhysicsQuery.QueryFilter](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/queryfilter.md)                     | A query filter is used to filter query results known as "hits". For example, you may want a ray-cast representing a projectile to hit players and the static environment but not debris. |
| [PhysicsQuery.SegmentDistanceResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/segmentdistanceresult.md) | Segment distance result from segment distance queries.                                                                                                                                   |
| [PhysicsQuery.ShapeSweep](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/shapesweep.md)                       | Describes the motion of a shape for a time-of-impact calculation. The shape is defined with respect to the body origin.                                                                  |
| [PhysicsQuery.TimeOfImpactInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/timeofimpactinput.md)         | The input for time-of-impact query.                                                                                                                                                      |
| [PhysicsQuery.TimeOfImpactResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/timeofimpactresult.md)       | Time-of-impact result from time-of-impact query.                                                                                                                                         |
| [PhysicsQuery.WorldCastResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/worldcastresult.md)             | The results from performing any Cast query against the [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md).                                                |
| [PhysicsQuery.WorldMoverInput](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/worldmoverinput.md)             | The world mover arguments used by the world mover.                                                                                                                                       |
| [PhysicsQuery.WorldMoverResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/worldmoverresult.md)           | The world mover result used by the world mover.                                                                                                                                          |
| [PhysicsQuery.WorldOverlapResult](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/worldoverlapresult.md)       | The results from performing any Overlap query.                                                                                                                                           |

## Enums

| Enum                                                                                                          | Description                                                                                                                                         |
| ------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| [PhysicsQuery.WorldCastMode](/engine/6000.7/script-reference/unity/u2d/physics/physicsquery/worldcastmode.md) | Controls what results are returned from a cast query against the [PhysicsWorld](/engine/6000.7/script-reference/unity/u2d/physics/physicsworld.md). |
