PhysicsQuery
Various physics queries.
Read time 2 minutesLast updated 5 days ago
Definition
- Type: Struct
- Namespace: Unity.U2D.Physics
- Assembly: UnityEngine.PhysicsCore2DModule
public readonly struct PhysicsQuery
Static Methods
Method | Description |
|---|---|
| CapsuleAndCapsule | Check the intersection between Capsule and Capsule geometries. |
| CapsuleAndCircle | Check the intersection between Capsule and Circle geometries. |
| CastShapes | 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 | Check the intersection between ChainSegment and Capsule geometries. |
| ChainSegmentAndCircle | Check the intersection between ChainSegment and Circle geometries. |
| ChainSegmentAndPolygon | Check the intersection between ChainSegment and Polygon geometries. |
| CircleAndCircle | Check the intersection between Circle and Circle geometries. |
| PolygonAndCapsule | Check the intersection between Polygon and Capsule geometries. |
| PolygonAndCircle | Check the intersection between Polygon and Circle geometries. |
| PolygonAndPolygon | Check the intersection between Polygon and Polygon geometries. |
| SegmentAndCapsule | Check the intersection between Segment and Capsule geometries. |
| SegmentAndCircle | Check the intersection between Segment and Circle geometries. |
| SegmentAndPolygon | Check the intersection between Segment and Polygon geometries. |
| SegmentDistance | Calculate the distance and closest points between two segments. |
| ShapeAndShape | Check the intersection between two shapes (PhysicsShape). |
| ShapeDistance | Calculate the distance and closest points between two shape proxies. |
| ShapeTimeOfImpact | 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 | Cast-Ray arguments used by CastRay queries. |
| PhysicsQuery.CastResult | Cast result when performing cast-ray or cast-shape queries against geometry. |
| PhysicsQuery.CastShapeInput | 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 | 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 | An input used for shape distance queries. |
| PhysicsQuery.DistanceResult | Distance result from shape distance queries. |
| PhysicsQuery.QueryFilter | 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 | Segment distance result from segment distance queries. |
| PhysicsQuery.ShapeSweep | Describes the motion of a shape for a time-of-impact calculation. The shape is defined with respect to the body origin. |
| PhysicsQuery.TimeOfImpactInput | The input for time-of-impact query. |
| PhysicsQuery.TimeOfImpactResult | Time-of-impact result from time-of-impact query. |
| PhysicsQuery.WorldCastResult | The results from performing any Cast query against the PhysicsWorld. |
| PhysicsQuery.WorldMoverInput | The world mover arguments used by the world mover. |
| PhysicsQuery.WorldMoverResult | The world mover result used by the world mover. |
| PhysicsQuery.WorldOverlapResult | The results from performing any Overlap query. |
Enums
Enum | Description |
|---|---|
| PhysicsQuery.WorldCastMode | Controls what results are returned from a cast query against the PhysicsWorld. |