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

Edge shape configuration. More...

#include <playrho/d2/EdgeShapeConf.hpp>

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

Public Member Functions

 EdgeShapeConf (const Length2 &vA, const Length2 &vB, const EdgeShapeConf &conf=GetDefaultConf()) noexcept
 Initializing constructor.
 
Length2 GetVertexA () const noexcept
 Gets vertex A.
 
Length2 GetVertexB () const noexcept
 Gets vertex B.
 
EdgeShapeConfRotate (const UnitVec &value) noexcept
 Rotates the vertices by the given amount.
 
EdgeShapeConfScale (const Vec2 &value) noexcept
 Scales the vertices by the given amount.
 
EdgeShapeConfSet (const Length2 &vA, const Length2 &vB) noexcept
 Sets both vertices in one call.
 
EdgeShapeConfTranslate (const Length2 &value) noexcept
 Translates the vertices by the given amount.
 
EdgeShapeConfUseVertexRadius (NonNegative< Length > value) noexcept
 Uses the given vertex radius.
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< EdgeShapeConf >
constexpr EdgeShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 
constexpr EdgeShapeConfUseFilter (Filter value) noexcept
 Uses the given filter.
 
constexpr EdgeShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr EdgeShapeConfUseIsSensor (bool value) noexcept
 Uses the given is-sensor value.
 
constexpr EdgeShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 

Static Public Member Functions

static EdgeShapeConf GetDefaultConf () noexcept
 Gets the default configuration.
 
static constexpr NonNegative< LengthGetDefaultVertexRadius () noexcept
 Gets the default vertex radius. More...
 

Public Attributes

NgonWithFwdNormals< 2 > ngon
 N-gon value of the object.
 
NonNegativeFF< LengthvertexRadius = GetDefaultVertexRadius()
 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 DefaultVertexRadius = NonNegative<Length>{DefaultLinearSlop * Real{2}}
 Default vertex 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

Edge shape configuration.

A line segment (edge) shape. These can be connected in chains or loops to other edge shapes. The connectivity information is used to ensure correct contact normals.

Member Function Documentation

◆ GetDefaultVertexRadius()

static constexpr NonNegative<Length> playrho::d2::EdgeShapeConf::GetDefaultVertexRadius ( )
inlinestaticconstexprnoexcept

Gets the default vertex radius.

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

Member Data Documentation

◆ vertexRadius

NonNegativeFF<Length> playrho::d2::EdgeShapeConf::vertexRadius = GetDefaultVertexRadius()

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(), and playrho::d2::SetVertexRadius().


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