Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


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 8 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsShape.ShapeProxy

Constructors

Constructor

Description

ShapeProxy(Unity.U2D.Physics.CapsuleGeometry)Create a shape proxy using the specified Capsule.
ShapeProxy(Unity.U2D.Physics.ChainSegmentGeometry)Create a shape proxy using the specified ChainSegment.
ShapeProxy(Unity.U2D.Physics.CircleGeometry)Create a shape proxy using the specified Circle.
ShapeProxy(Unity.U2D.Physics.PolygonGeometry)Create a shape proxy using the specified Polygon.
ShapeProxy(Unity.U2D.Physics.SegmentGeometry)Create a shape proxy using the specified Segment.
ShapeProxy(UnityEngine.Vector2)Create a shape proxy representing a single point.

Properties

Property

Description

aabbGet the AABB that bounds the shape proxy.
capsuleGeometryGet a CapsuleGeometry from the shape proxy. The _count must be 2.
circleGeometryGet a CircleGeometry from the shape proxy. The _count must be 1.
countThe number of vertices.
isValidCheck if the shape proxy is valid.
polygonGeometryGet a PolygonGeometry from the shape proxy.
radiusThe radius around the vertices.
segmentGeometryGet a SegmentGeometry from the shape proxy. The _count must be 2.
shapeTypeThe shape type represented.
verticesThe shape vertices.

Methods

Method

Description

AsSpanGet the convex-hull vertices as a span.