Disk shape configuration. More...
#include <DiskShapeConf.hpp>
Public Member Functions | |
PLAYRHO_CONSTEXPR | DiskShapeConf ()=default |
PLAYRHO_CONSTEXPR | DiskShapeConf (NonNegative< Length > r) |
Initializing constructor. More... | |
PLAYRHO_CONSTEXPR DiskShapeConf & | UseLocation (Length2 value) noexcept |
Uses the given value as the location. More... | |
PLAYRHO_CONSTEXPR DiskShapeConf & | UseRadius (NonNegative< Length > r) noexcept |
Uses the given value as the radius. More... | |
PLAYRHO_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. More... | |
Length2 | GetLocation () const noexcept |
Gets the location. More... | |
Public Member Functions inherited from playrho::d2::ShapeBuilder< DiskShapeConf > | |
PLAYRHO_CONSTEXPR | ShapeBuilder ()=default |
Default constructor. More... | |
PLAYRHO_CONSTEXPR | ShapeBuilder (const BaseShapeConf &value) noexcept |
Initializing constructor. More... | |
PLAYRHO_CONSTEXPR DiskShapeConf & | UseFriction (NonNegative< Real > value) noexcept |
Uses the given friction. More... | |
PLAYRHO_CONSTEXPR DiskShapeConf & | UseRestitution (Finite< Real > value) noexcept |
Uses the given restitution. More... | |
PLAYRHO_CONSTEXPR DiskShapeConf & | UseDensity (NonNegative< AreaDensity > value) noexcept |
Uses the given density. More... | |
Static Public Member Functions | |
static PLAYRHO_CONSTEXPR NonNegative< Length > | GetDefaultRadius () noexcept |
Gets the default radius. More... | |
Public Attributes | |
NonNegative< Length > | vertexRadius = GetDefaultRadius() |
Vertex radius. More... | |
Length2 | location = Length2{} |
Location for the disk shape to be centered at. 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
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.
- Examples
- Body.cpp, Contact.cpp, HelloWorld.cpp, and World.cpp.
Definition at line 41 of file DiskShapeConf.hpp.
Constructor & Destructor Documentation
◆ DiskShapeConf() [1/2]
|
default |
◆ DiskShapeConf() [2/2]
|
inline |
Initializing constructor.
Definition at line 52 of file DiskShapeConf.hpp.
Member Function Documentation
◆ GetDefaultRadius()
|
inlinestaticnoexcept |
Gets the default radius.
Definition at line 44 of file DiskShapeConf.hpp.
◆ UseLocation()
|
inlinenoexcept |
Uses the given value as the location.
Definition at line 58 of file DiskShapeConf.hpp.
◆ UseRadius()
|
inlinenoexcept |
Uses the given value as the radius.
- Examples
- Body.cpp, HelloWorld.cpp, and World.cpp.
Definition at line 65 of file DiskShapeConf.hpp.
◆ Transform()
|
inlinenoexcept |
Transforms the location by the given transformation matrix.
Definition at line 73 of file DiskShapeConf.hpp.
◆ GetRadius()
|
inlinenoexcept |
Gets the radius property.
Definition at line 80 of file DiskShapeConf.hpp.
◆ GetLocation()
|
inlinenoexcept |
Gets the location.
Definition at line 86 of file DiskShapeConf.hpp.
Member Data Documentation
◆ vertexRadius
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.
- Note
- This should be a non-negative value.
- Examples
- Body.cpp.
Definition at line 102 of file DiskShapeConf.hpp.
◆ location
Location for the disk shape to be centered at.
- Examples
- World.cpp.
Definition at line 105 of file DiskShapeConf.hpp.
The documentation for this struct was generated from the following file:
- Collision/Shapes/DiskShapeConf.hpp