Polygon

data class Polygon(val vertices: List<PhysicsVector2>, val space: PhysicsShape.Polygon.VertexSpace = VertexSpace.Normalized) : PhysicsShape

Convex polygon shape (Box2D/jbox2d-style).

IMPORTANT:

  • Only convex polygons are supported by PolygonShape.

  • Vertex count is limited by the physics backend (typically <= 8).

  • Vertices must be non-self-intersecting and should not be degenerate (zero area).

Vertex coordinates are expressed in local body space relative to the body's center.

Constructors

Link copied to clipboard
constructor(vertices: List<PhysicsVector2>, space: PhysicsShape.Polygon.VertexSpace = VertexSpace.Normalized)

Types

Properties

Link copied to clipboard

How to interpret vertices:

Link copied to clipboard

Polygon vertices in local space (see space).