Convex hull. More...
#include <MultiShapeConf.hpp>
Public Member Functions | |
DistanceProxy | GetDistanceProxy () const |
Gets the distance proxy for this convex hull. | |
NonNegative< Length > | GetVertexRadius () const noexcept |
Gets the vertex radius of this convex hull. More... | |
ConvexHull & | Transform (const Mat22 &m) noexcept |
Transforms all the vertices by the given transformation matrix. More... | |
Static Public Member Functions | |
static ConvexHull | Get (const VertexSet &pointSet, NonNegative< Length > vertexRadius=NonNegative< Length >{DefaultLinearSlop *Real{2}}) |
Gets the convex hull for the given set of vertices. | |
Private Member Functions | |
ConvexHull (std::vector< Length2 > verts, std::vector< UnitVec > norms, NonNegative< Length > vr) | |
Initializing constructor. | |
Private Attributes | |
std::vector< Length2 > | vertices |
Array of vertices. More... | |
std::vector< UnitVec > | normals |
Normals of edges. More... | |
NonNegative< Length > | vertexRadius |
Vertex radius. More... | |
Friends | |
bool | operator== (const ConvexHull &lhs, const ConvexHull &rhs) noexcept |
Equality operator. | |
bool | operator!= (const ConvexHull &lhs, const ConvexHull &rhs) noexcept |
Inequality operator. | |
Convex hull.
|
inlinenoexcept |
Gets the vertex radius of this convex hull.
|
noexcept |
Transforms all the vertices by the given transformation matrix.
Referenced by playrho::d2::MultiShapeConf::Transform().
|
private |
Normals of edges.
These are 90-degree clockwise-rotated unit-vectors of the vectors defined by consecutive pairs of elements of vertices.
Referenced by GetDistanceProxy().
|
private |
Vertex radius.
This is the radius from the vertex that the shape's "skin" should extend outward by. While any edges — line segments between multiple vertices — are straight, corners between them (the vertices) are rounded and treated as rounded. Shapes with larger vertex radiuses compared to edge lengths therefore will be more prone to rolling or having other shapes more prone to roll off of them.
Referenced by GetDistanceProxy(), and GetVertexRadius().
|
private |
Array of vertices.
Consecutive vertices constitute "edges" of the polygon.
Referenced by GetDistanceProxy().