PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::DiskShapeConf Struct Reference

Disk shape configuration. More...

#include <playrho/d2/DiskShapeConf.hpp>

Inheritance diagram for playrho::d2::DiskShapeConf:
[legend]
Collaboration diagram for playrho::d2::DiskShapeConf:
[legend]

Public Member Functions

constexpr DiskShapeConf (NonNegative< Length > r)
 Initializing constructor.
 
Length2 GetLocation () const noexcept
 Gets the location.
 
NonNegative< LengthGetRadius () const noexcept
 Gets the radius property.
 
constexpr DiskShapeConfRotate (const UnitVec &value) noexcept
 Rotates the location by the given amount.
 
constexpr DiskShapeConfScale (const Vec2 &value) noexcept
 Scales the location by the given amount.
 
constexpr DiskShapeConfTranslate (const Length2 &value) noexcept
 Translates the location by the given amount.
 
constexpr DiskShapeConfUseLocation (const Length2 &value) noexcept
 Uses the given value as the location.
 
constexpr DiskShapeConfUseRadius (NonNegative< Length > r) noexcept
 Uses the given value as the radius.
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< DiskShapeConf >
constexpr DiskShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 
constexpr DiskShapeConfUseFilter (Filter value) noexcept
 Uses the given filter.
 
constexpr DiskShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr DiskShapeConfUseIsSensor (bool value) noexcept
 Uses the given is-sensor value.
 
constexpr DiskShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 

Static Public Member Functions

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

Public Attributes

Length2 location = Length2{}
 Location for the disk shape to be centered at.
 
NonNegative< LengthvertexRadius = GetDefaultRadius()
 Vertex radius. More...
 
- Public Attributes inherited from playrho::d2::BaseShapeConf
NonNegative< AreaDensitydensity = DefaultDensity
 Area density of the associated shape. More...
 
Filter filter = DefaultFilter
 Filtering data for contacts.
 
NonNegative< Realfriction = DefaultFriction
 Friction coefficient. More...
 
bool isSensor = DefaultIsSensor
 A sensor shape collects contact information but never generates a collision response.
 
Finite< Realrestitution = 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

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)

Member Function Documentation

◆ GetDefaultRadius()

static constexpr NonNegative<Length> playrho::d2::DiskShapeConf::GetDefaultRadius ( )
inlinestaticconstexprnoexcept

Gets the default radius.

Note
This is just a backward compatibility interface for getting the default radius. The new way is to use DefaultRadius directly.
Returns
DefaultRadius.

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.

Referenced by playrho::d2::GetChild(), playrho::d2::GetMassData(), GetRadius(), playrho::d2::SetVertexRadius(), and UseRadius().


The documentation for this struct was generated from the following file: