ShapeDefinition Class
Describes the geometry of a Box2D shape. Passed to Shape or AddSubShape(ShapeDefinition, bool, Nullable<float>, Nullable<float>).
Shape definitions are immutable records. Changing a property (e.g. Radius,
Width, Height) creates a new record value — it does not automatically
update a live Box2D body. To resize a shape at runtime you must reassign
Shape (or the sub-shape's
Brine2D.ECS.Components.SubShape.Definition) with the new record.
The physics system detects the assignment and triggers a full body rebuild on the next tick,
which resets all shape IDs and clears sub-step kinematic state.
Set shape dimensions once at construction time where possible.
public abstract record ShapeDefinition : System.IEquatable<Brine2D.Physics.ShapeDefinition>
Inheritance System.Object → ShapeDefinition
Derived
↳ BoxShape
↳ CapsuleShape
↳ ChainShape
↳ CircleShape
↳ PolygonShape
↳ SegmentShape
Implements System.IEquatable<ShapeDefinition>
| Fields | |
|---|---|
| MaxPolygonVertices | Maximum polygon vertices supported by Box2D. |