Disk shape configuration. More...
#include <playrho/d2/DiskShapeConf.hpp>
Public Member Functions | |
constexpr | DiskShapeConf (NonNegative< Length > r) |
Initializing constructor. | |
Length2 | GetLocation () const noexcept |
Gets the location. | |
NonNegative< Length > | GetRadius () const noexcept |
Gets the radius property. | |
constexpr DiskShapeConf & | Rotate (const UnitVec &value) noexcept |
Rotates the location by the given amount. | |
constexpr DiskShapeConf & | Scale (const Vec2 &value) noexcept |
Scales the location by the given amount. | |
constexpr DiskShapeConf & | Translate (const Length2 &value) noexcept |
Translates the location by the given amount. | |
constexpr DiskShapeConf & | UseLocation (const Length2 &value) noexcept |
Uses the given value as the location. | |
constexpr DiskShapeConf & | UseRadius (NonNegative< Length > r) noexcept |
Uses the given value as the radius. | |
Public Member Functions inherited from playrho::d2::ShapeBuilder< DiskShapeConf > | |
constexpr DiskShapeConf & | UseDensity (NonNegative< AreaDensity > value) noexcept |
Uses the given density. | |
constexpr DiskShapeConf & | UseFilter (Filter value) noexcept |
Uses the given filter. | |
constexpr DiskShapeConf & | UseFriction (NonNegative< Real > value) noexcept |
Uses the given friction. | |
constexpr DiskShapeConf & | UseIsSensor (bool value) noexcept |
Uses the given is-sensor value. | |
constexpr DiskShapeConf & | UseRestitution (Finite< Real > value) noexcept |
Uses the given restitution. | |
Static Public Member Functions | |
static constexpr NonNegative< Length > | GetDefaultRadius () noexcept |
Gets the default radius. More... | |
Public Attributes | |
Length2 | location = Length2{} |
Location for the disk shape to be centered at. | |
NonNegative< Length > | vertexRadius = GetDefaultRadius() |
Vertex radius. More... | |
Public Attributes inherited from playrho::d2::BaseShapeConf | |
NonNegative< AreaDensity > | density = DefaultDensity |
Area density of the associated shape. More... | |
Filter | filter = DefaultFilter |
Filtering data for contacts. | |
NonNegative< Real > | friction = DefaultFriction |
Friction coefficient. More... | |
bool | isSensor = DefaultIsSensor |
A sensor shape collects contact information but never generates a collision response. | |
Finite< Real > | restitution = DefaultRestitution |
Restitution (elasticity) of the associated shape. More... | |
Static Public Attributes | |
static constexpr auto | DefaultRadius = NonNegative<Length>{DefaultLinearSlop * 2} |
Default radius. | |
Static Public Attributes inherited from playrho::d2::BaseShapeConf | |
static constexpr auto | DefaultDensity = NonNegative<AreaDensity>{0_kgpm2} |
Default density value. | |
static constexpr auto | DefaultFilter = Filter{} |
Default filter value. | |
static constexpr auto | DefaultFriction = NonNegative<Real>{Real{2} / Real{10}} |
Default friction value. | |
static constexpr auto | DefaultIsSensor = false |
Default is-sensor value. | |
static const auto | DefaultRestitution = Finite<Real>{} |
Default restitution value. | |
Additional Inherited Members | |
Related Functions inherited from playrho::d2::BaseShapeConf | |
constexpr NonNegative< AreaDensity > | GetDensity (const BaseShapeConf &arg) noexcept |
Gets the density of the given shape configuration. | |
constexpr Filter | GetFilter (const BaseShapeConf &arg) noexcept |
Gets the filter of the given shape configuration. | |
constexpr NonNegativeFF< Real > | GetFriction (const BaseShapeConf &arg) noexcept |
Gets the friction of the given shape. | |
constexpr Finite< Real > | GetRestitution (const BaseShapeConf &arg) noexcept |
Gets the restitution of the given shape. | |
constexpr bool | IsSensor (const BaseShapeConf &arg) noexcept |
Gets the is-sensor state of the given shape configuration. | |
void | SetDensity (BaseShapeConf &arg, NonNegative< AreaDensity > value) |
Sets the density of the given shape configuration. | |
void | SetFilter (BaseShapeConf &arg, Filter value) |
Sets the filter of the given shape configuration. | |
void | SetFriction (BaseShapeConf &arg, NonNegative< Real > value) |
Sets the friction of the given shape. | |
void | SetRestitution (BaseShapeConf &arg, Real value) noexcept |
Sets the restitution of the given shape. | |
void | SetSensor (BaseShapeConf &arg, bool value) |
Sets the is-sensor state of the given shape configuration. | |
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.
|
inlinestaticconstexprnoexcept |
Gets the default radius.
DefaultRadius
directly. DefaultRadius
. 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(), playrho::d2::GetMassData(), GetRadius(), playrho::d2::SetVertexRadius(), and UseRadius().