Edge shape configuration. More...
#include <EdgeShapeConf.hpp>
Public Member Functions | |
EdgeShapeConf ()=default | |
EdgeShapeConf (Length2 vA, Length2 vB, const EdgeShapeConf &conf=GetDefaultConf()) noexcept | |
Initializing constructor. More... | |
EdgeShapeConf & | Set (Length2 vA, Length2 vB) noexcept |
Sets both vertices in one call. More... | |
EdgeShapeConf & | UseVertexRadius (NonNegative< Length > value) noexcept |
Uses the given vertex radius. More... | |
EdgeShapeConf & | Transform (const Mat22 &m) noexcept |
Transforms both vertices by the given transformation matrix. More... | |
Length2 | GetVertexA () const noexcept |
Gets vertex A. More... | |
Length2 | GetVertexB () const noexcept |
Gets vertex B. More... | |
DistanceProxy | GetChild () const noexcept |
Gets the "child" shape. More... | |
Public Member Functions inherited from playrho::d2::ShapeBuilder< EdgeShapeConf > | |
PLAYRHO_CONSTEXPR | ShapeBuilder ()=default |
Default constructor. More... | |
PLAYRHO_CONSTEXPR | ShapeBuilder (const BaseShapeConf &value) noexcept |
Initializing constructor. More... | |
PLAYRHO_CONSTEXPR EdgeShapeConf & | UseFriction (NonNegative< Real > value) noexcept |
Uses the given friction. More... | |
PLAYRHO_CONSTEXPR EdgeShapeConf & | UseRestitution (Finite< Real > value) noexcept |
Uses the given restitution. More... | |
PLAYRHO_CONSTEXPR EdgeShapeConf & | UseDensity (NonNegative< AreaDensity > value) noexcept |
Uses the given density. More... | |
Static Public Member Functions | |
static PLAYRHO_CONSTEXPR NonNegative< Length > | GetDefaultVertexRadius () noexcept |
Gets the default vertex radius. More... | |
static EdgeShapeConf | GetDefaultConf () noexcept |
Gets the default configuration. More... | |
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... | |
Detailed Description
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.
- Note
- This data structure is 56-bytes.
- Examples
- World.cpp.
Definition at line 41 of file EdgeShapeConf.hpp.
Constructor & Destructor Documentation
◆ EdgeShapeConf() [1/2]
|
default |
◆ EdgeShapeConf() [2/2]
|
noexcept |
Initializing constructor.
Definition at line 25 of file EdgeShapeConf.cpp.
Member Function Documentation
◆ GetDefaultVertexRadius()
|
inlinestaticnoexcept |
Gets the default vertex radius.
Definition at line 45 of file EdgeShapeConf.hpp.
◆ GetDefaultConf()
|
inlinestaticnoexcept |
Gets the default configuration.
Definition at line 51 of file EdgeShapeConf.hpp.
◆ Set()
|
noexcept |
◆ UseVertexRadius()
|
inlinenoexcept |
◆ Transform()
|
noexcept |
Transforms both vertices by the given transformation matrix.
Definition at line 43 of file EdgeShapeConf.cpp.
◆ GetVertexA()
|
inlinenoexcept |
Gets vertex A.
Definition at line 72 of file EdgeShapeConf.hpp.
◆ GetVertexB()
|
inlinenoexcept |
Gets vertex B.
Definition at line 78 of file EdgeShapeConf.hpp.
◆ GetChild()
|
inlinenoexcept |
Gets the "child" shape.
Definition at line 84 of file EdgeShapeConf.hpp.
Member Data Documentation
◆ vertexRadius
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.
- Note
- This should be a non-negative value.
Definition at line 100 of file EdgeShapeConf.hpp.
The documentation for this class was generated from the following files:
- Collision/Shapes/EdgeShapeConf.hpp
- Collision/Shapes/EdgeShapeConf.cpp