Disk shape configuration. More...
#include <DiskShapeConf.hpp>
Public Member Functions | |
constexpr | DiskShapeConf (NonNegative< Length > r) |
Initializing constructor. | |
constexpr DiskShapeConf & | UseLocation (Length2 value) noexcept |
Uses the given value as the location. | |
constexpr DiskShapeConf & | UseRadius (NonNegative< Length > r) noexcept |
Uses the given value as the radius. | |
constexpr DiskShapeConf & | Transform (const Mat22 &m) noexcept |
Transforms the location by the given transformation matrix. More... | |
NonNegative< Length > | GetRadius () const noexcept |
Gets the radius property. | |
Length2 | GetLocation () const noexcept |
Gets the location. | |
Public Member Functions inherited from playrho::d2::ShapeBuilder< DiskShapeConf > | |
constexpr | ShapeBuilder ()=default |
Default constructor. | |
constexpr | ShapeBuilder (const BaseShapeConf &value) noexcept |
Initializing constructor. | |
constexpr DiskShapeConf & | UseFriction (NonNegative< Real > value) noexcept |
Uses the given friction. | |
constexpr DiskShapeConf & | UseRestitution (Finite< Real > value) noexcept |
Uses the given restitution. | |
constexpr DiskShapeConf & | UseDensity (NonNegative< AreaDensity > value) noexcept |
Uses the given density. | |
Static Public Member Functions | |
static constexpr NonNegative< Length > | GetDefaultRadius () noexcept |
Gets the default radius. | |
Public Attributes | |
NonNegative< Length > | vertexRadius = GetDefaultRadius() |
Vertex radius. More... | |
Length2 | location = Length2{} |
Location for the disk shape to be centered at. | |
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... | |
Disk shape configuration.
A disk shape "is the region in a plane bounded by a circle". This is a two-dimensional solid round shape. This used to be called the circle shape but that's now used for hollow round shapes.
|
inlineconstexprnoexcept |
Transforms the location by the given transformation matrix.
NonNegative<Length> playrho::d2::DiskShapeConf::vertexRadius = GetDefaultRadius() |
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 playrho::d2::GetChild(), GetRadius(), and UseRadius().