Class PolygonCollider
Builds the convex hull collider of a flat polygon extruded along Z: the prism a 2D polygon shape collides as.
public static class PolygonCollider
- Inheritance
-
PolygonCollider
Methods
Create(PolygonShape, float)
Creates the collider of polygon, extruded depth along Z.
public static ConvexHullCollider Create(Primitive2D.PolygonShape polygon, float depth = 1)
Parameters
polygonPrimitive2D.PolygonShapedepthfloat
Returns
Create(RegularPolygonShape, float)
Creates the collider of polygon, extruded depth along Z.
public static ConvexHullCollider Create(Primitive2D.RegularPolygonShape polygon, float depth = 1)
Parameters
polygonPrimitive2D.RegularPolygonShapedepthfloat
Returns
Create(Vector2[], float)
Creates the collider of the convex polygon with the given corners, in order around the outline, extruded
depth along Z.
public static ConvexHullCollider Create(Vector2[] vertices, float depth = 1)
Parameters
Returns
Create(float, int, float)
Creates the collider of a regular polygon with sides corners on a circle of
radius, extruded depth along Z.
public static ConvexHullCollider Create(float radius, int sides, float depth = 1)