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 DiskShapeConfUseLocation (Length2 value) noexcept
 Uses the given value as the location. More...
 
PLAYRHO_CONSTEXPR DiskShapeConfUseRadius (NonNegative< Length > r) noexcept
 Uses the given value as the radius. More...
 
PLAYRHO_CONSTEXPR DiskShapeConfTransform (const Mat22 &m) noexcept
 Transforms the location by the given transformation matrix. More...
 
NonNegative< LengthGetRadius () 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 DiskShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction. More...
 
PLAYRHO_CONSTEXPR DiskShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution. More...
 
PLAYRHO_CONSTEXPR DiskShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density. More...
 

Static Public Member Functions

static PLAYRHO_CONSTEXPR NonNegative< LengthGetDefaultRadius () noexcept
 Gets the default radius. More...
 

Public Attributes

NonNegative< LengthvertexRadius = 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< Realfriction = NonNegative<Real>{Real{2} / Real{10}}
 Friction coefficient. More...
 
Finite< Realrestitution = Finite<Real>{0}
 Restitution (elasticity) of the associated shape. More...
 
NonNegative< AreaDensitydensity = 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.

See also
https://en.wikipedia.org/wiki/Disk_(mathematics)
Examples
Body.cpp, Contact.cpp, HelloWorld.cpp, and World.cpp.

Definition at line 41 of file DiskShapeConf.hpp.

Constructor & Destructor Documentation

◆ DiskShapeConf() [1/2]

PLAYRHO_CONSTEXPR playrho::d2::DiskShapeConf::DiskShapeConf ( )
default

◆ DiskShapeConf() [2/2]

PLAYRHO_CONSTEXPR playrho::d2::DiskShapeConf::DiskShapeConf ( NonNegative< Length r)
inline

Initializing constructor.

Definition at line 52 of file DiskShapeConf.hpp.

Member Function Documentation

◆ GetDefaultRadius()

static PLAYRHO_CONSTEXPR NonNegative<Length> playrho::d2::DiskShapeConf::GetDefaultRadius ( )
inlinestaticnoexcept

Gets the default radius.

Definition at line 44 of file DiskShapeConf.hpp.

◆ UseLocation()

PLAYRHO_CONSTEXPR DiskShapeConf& playrho::d2::DiskShapeConf::UseLocation ( Length2  value)
inlinenoexcept

Uses the given value as the location.

Definition at line 58 of file DiskShapeConf.hpp.

◆ UseRadius()

PLAYRHO_CONSTEXPR DiskShapeConf& playrho::d2::DiskShapeConf::UseRadius ( NonNegative< Length r)
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()

PLAYRHO_CONSTEXPR DiskShapeConf& playrho::d2::DiskShapeConf::Transform ( const Mat22 m)
inlinenoexcept

Transforms the location by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Definition at line 73 of file DiskShapeConf.hpp.

◆ GetRadius()

NonNegative<Length> playrho::d2::DiskShapeConf::GetRadius ( ) const
inlinenoexcept

Gets the radius property.

Definition at line 80 of file DiskShapeConf.hpp.

◆ GetLocation()

Length2 playrho::d2::DiskShapeConf::GetLocation ( ) const
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

Length2 playrho::d2::DiskShapeConf::location = Length2{}

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: