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

Definition

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

capsuleGeometryGet a CapsuleGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 2.
circleGeometryGet a CircleGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 1.
countThe number of vertices.
polygonGeometryGet a PolygonGeometry from the shape proxy.
radiusThe radius around the vertices.
segmentGeometryGet a SegmentGeometry from the shape proxy. The PhysicsShape.ShapeProxy.count must be 2.
verticesThe shape vertices.