PolygonShape Class

Convex polygon. Vertices are in local body space.

Box2D computes the convex hull of the supplied vertices — concave or self-intersecting vertex lists are silently reduced to their convex hull in all build configurations. Ensure your vertices are already convex and wound consistently (clockwise or counter-clockwise) if the exact shape matters; Box2D may discard vertices or reorder them during hull computation. In DEBUG builds a convexity assertion is raised when non-convex input is detected so issues surface during development, but in RELEASE builds the hull is computed silently with no warning. There is no runtime convex-decomposition; for concave shapes use multiple PhysicsBodyComponent.AddSubShape calls, each with a convex PolygonShape. Maximum of MaxPolygonVertices vertices (Box2D limit).

public sealed record PolygonShape : Brine2D.Physics.ShapeDefinition, System.IEquatable<Brine2D.Physics.PolygonShape>

Inheritance System.ObjectShapeDefinition → PolygonShape

Implements System.IEquatable<PolygonShape>

Properties
Offset Local-space offset applied to every vertex, shifting the entire polygon relative to the body origin in pixels. Use this to position the polygon away from the body pivot on compound bodies without recomputing all vertex positions manually. Default is System.Numerics.Vector2.Zero.
Radius Skin radius (polygon inflation) in pixels. Box2D uses this for numerical stability and continuous collision detection. Default is 0 (sharp edges).