Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CapsuleGeometry

The geometry of a closed capsule which can be viewed as two semi-circles connected by a rectangle. See PhysicsBody.CreateShape.
Read time 1 minuteLast updated 10 days ago

Definition

public struct CapsuleGeometry

Static Fields

Value

Description

defaultGeometryGet the default Capsule.

Constructors

Constructor

Description

CapsuleGeometry()Create a default Capsule. See CapsuleGeometry.defaultGeometry.

Properties

Property

Description

center1Local center of the first semi-circle.
center2Local center of the second semi-circle.
isValidCheck if the geometry is valid or not.
radiusThe radius of the semi-circles.

Methods

Method

Description

CalculateAABBCalculate the AABB of the geometry.
CalculateMassConfigurationCalculate the mass configuration of the geometry.
CastRayCalculate if a world ray intersects the geometry. See PhysicsQuery.CastResult.
CastShapeCalculate if a cast shape intersects the geometry. Initially touching shapes are treated as a miss. You should check for overlap first if initial overlap is required. See PhysicsQuery.CastShapeInput and PhysicsQuery.CastResult.
ClosestPointCalculate the closest point on this geometry to the specified point.
IntersectCheck the intersection between this geometry and another.
InverseTransformInverse-Transform the geometry.
OverlapPointCalculate if a point overlaps the geometry.
ToPolygonsCreates multiple PolygonGeometry from the geometry. A limit is imposed on small vertex distances so it is recommended that the geometry is scaled appropriately rather than on the returned geometry so geometry is not discarded due to it being invalid.
TransformTransform the geometry.
ValidateGet a validated version of the geometry, if possible.

Static Methods

Method

Description

CreateCreate a Capsule.