PhysicsShape.ShapeProxy
A proxy of a shape in a generic form suited to representing all support shape types. You can provide between 1 and PhysicsConstants.MaxPolygonVertices and a radius. A CircleGeometry is a single point with a non-zero radius (zero radius is allowed however and defines a point). A CapsuleGeometry is two points with a non-zero radius. A PolygonGeometry box is the points with and an optional radius. A SegmentGeometry is two points with a zero radius. A ChainSegmentGeometry is two points with a zero radius. To create a proxy, simply provide the geometry to the constructor.
Read time 2 minutesLast updated 12 days ago
Definition
- Type: Struct
- Namespace: UnityEngine.LowLevelPhysics2D
- Assembly: UnityEngine.Physics2DModule
public struct PhysicsShape.ShapeProxy
Constructors
Constructor | Description |
|---|---|
| ShapeProxy(UnityEngine.LowLevelPhysics2D.CapsuleGeometry) | Create a shape proxy using the specified Capsule. |
| ShapeProxy(UnityEngine.LowLevelPhysics2D.ChainSegmentGeometry) | Create a shape proxy using the specified ChainSegment. |
| ShapeProxy(UnityEngine.LowLevelPhysics2D.CircleGeometry) | Create a shape proxy using the specified Circle. |
| ShapeProxy(UnityEngine.LowLevelPhysics2D.PolygonGeometry) | Create a shape proxy using the specified Polygon. |
| ShapeProxy(UnityEngine.LowLevelPhysics2D.SegmentGeometry) | Create a shape proxy using the specified Segment. |
| ShapeProxy(UnityEngine.Vector2) | Create a shape proxy representing a single point. |
Properties
Property | Description |
|---|---|
| capsuleGeometry | Get a CapsuleGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 2. |
| circleGeometry | Get a CircleGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 1. |
| count | The number of vertices. |
| polygonGeometry | Get a PolygonGeometry from the shape proxy. |
| radius | The radius around the vertices. |
| segmentGeometry | Get a SegmentGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 2. |
| vertices | The shape vertices. |