HughPH.Box2D
Organised dotnet bindings for Box2D 3.1.0
|
A convex hull. Used to create convex polygons. More...
Public Member Functions | |
Hull (Span< Vec2 > points) | |
Computes a hull from a set of points. This is a copy constructor. | |
Static Public Member Functions | |
static unsafe Hull | Compute (ReadOnlySpan< Vec2 > points) |
Compute the convex hull of a set of points. Returns an empty hull if it fails. Some failure cases: | |
Properties | |
unsafe ReadOnlySpan< Vec2 > | Points [get] |
The final points of the hull. | |
bool | Valid [get] |
Determines if this hull is valid. Checks for: | |
A convex hull. Used to create convex polygons.
Warning: Do not modify these values directly, instead use Hull.Compute(System.Span<System.Numerics.Vector2>)
|
inline |
Computes a hull from a set of points. This is a copy constructor.
points | The points to compute the hull from |
This is a copy constructor. The hull will be computed and stored in this instance.
|
inlinestatic |
Compute the convex hull of a set of points. Returns an empty hull if it fails. Some failure cases:
This welds close points and removes collinear points.
Warning: Do not modify a hull once it has been computed
|
get |
Determines if this hull is valid. Checks for:
This is expensive and should not be called at runtime.