Edge shape configuration. More...
#include <EdgeShapeConf.hpp>
Public Member Functions | |
EdgeShapeConf (Length2 vA, Length2 vB, const EdgeShapeConf &conf=GetDefaultConf()) noexcept | |
Initializing constructor. | |
EdgeShapeConf & | Set (Length2 vA, Length2 vB) noexcept |
Sets both vertices in one call. | |
EdgeShapeConf & | UseVertexRadius (NonNegative< Length > value) noexcept |
Uses the given vertex radius. | |
EdgeShapeConf & | Transform (const Mat22 &m) noexcept |
Transforms both vertices by the given transformation matrix. More... | |
Length2 | GetVertexA () const noexcept |
Gets vertex A. | |
Length2 | GetVertexB () const noexcept |
Gets vertex B. | |
DistanceProxy | GetChild () const noexcept |
Gets the "child" shape. | |
Public Member Functions inherited from playrho::d2::ShapeBuilder< EdgeShapeConf > | |
constexpr | ShapeBuilder ()=default |
Default constructor. | |
constexpr | ShapeBuilder (const BaseShapeConf &value) noexcept |
Initializing constructor. | |
constexpr EdgeShapeConf & | UseFriction (NonNegative< Real > value) noexcept |
Uses the given friction. | |
constexpr EdgeShapeConf & | UseRestitution (Finite< Real > value) noexcept |
Uses the given restitution. | |
constexpr EdgeShapeConf & | UseDensity (NonNegative< AreaDensity > value) noexcept |
Uses the given density. | |
Static Public Member Functions | |
static constexpr NonNegative< Length > | GetDefaultVertexRadius () noexcept |
Gets the default vertex radius. | |
static EdgeShapeConf | GetDefaultConf () noexcept |
Gets the default configuration. | |
Public Attributes | |
NonNegative< Length > | vertexRadius = GetDefaultVertexRadius() |
Vertex radius. More... | |
Public Attributes inherited from playrho::d2::BaseShapeConf | |
NonNegative< Real > | friction = NonNegative<Real>{Real{2} / Real{10}} |
Friction coefficient. More... | |
Finite< Real > | restitution = Finite<Real>{0} |
Restitution (elasticity) of the associated shape. More... | |
NonNegative< AreaDensity > | density = NonNegative<AreaDensity>{0_kgpm2} |
Area density of the associated shape. More... | |
Private Attributes | |
Length2 | m_vertices [2] = {Length2{}, Length2{}} |
Vertices. | |
UnitVec | m_normals [2] = {UnitVec{}, UnitVec{}} |
Normals. | |
Edge shape configuration.
A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. The connectivity information is used to ensure correct contact normals.
|
noexcept |
Transforms both vertices by the given transformation matrix.
NonNegative<Length> playrho::d2::EdgeShapeConf::vertexRadius = GetDefaultVertexRadius() |
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 GetChild().