Edge shape configuration. More...

#include <EdgeShapeConf.hpp>

Public Member Functions

 EdgeShapeConf ()=default
 
 EdgeShapeConf (Length2 vA, Length2 vB, const EdgeShapeConf &conf=GetDefaultConf()) noexcept
 Initializing constructor. More...
 
EdgeShapeConfSet (Length2 vA, Length2 vB) noexcept
 Sets both vertices in one call. More...
 
EdgeShapeConfUseVertexRadius (NonNegative< Length > value) noexcept
 Uses the given vertex radius. More...
 
EdgeShapeConfTransform (const Mat22 &m) noexcept
 Transforms both vertices by the given transformation matrix. More...
 
Length2 GetVertexA () const noexcept
 Gets vertex A. More...
 
Length2 GetVertexB () const noexcept
 Gets vertex B. More...
 
DistanceProxy GetChild () const noexcept
 Gets the "child" shape. More...
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< EdgeShapeConf >
PLAYRHO_CONSTEXPR ShapeBuilder ()=default
 Default constructor. More...
 
PLAYRHO_CONSTEXPR ShapeBuilder (const BaseShapeConf &value) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR EdgeShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction. More...
 
PLAYRHO_CONSTEXPR EdgeShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution. More...
 
PLAYRHO_CONSTEXPR EdgeShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density. More...
 

Static Public Member Functions

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

Public Attributes

NonNegative< LengthvertexRadius = GetDefaultVertexRadius()
 Vertex radius. 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

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.

Note
This data structure is 56-bytes.
Examples
World.cpp.

Definition at line 41 of file EdgeShapeConf.hpp.

Constructor & Destructor Documentation

◆ EdgeShapeConf() [1/2]

playrho::d2::EdgeShapeConf::EdgeShapeConf ( )
default

◆ EdgeShapeConf() [2/2]

playrho::d2::EdgeShapeConf::EdgeShapeConf ( Length2  vA,
Length2  vB,
const EdgeShapeConf conf = GetDefaultConf() 
)
noexcept

Initializing constructor.

Definition at line 25 of file EdgeShapeConf.cpp.

Member Function Documentation

◆ GetDefaultVertexRadius()

static PLAYRHO_CONSTEXPR NonNegative<Length> playrho::d2::EdgeShapeConf::GetDefaultVertexRadius ( )
inlinestaticnoexcept

Gets the default vertex radius.

Definition at line 45 of file EdgeShapeConf.hpp.

◆ GetDefaultConf()

static EdgeShapeConf playrho::d2::EdgeShapeConf::GetDefaultConf ( )
inlinestaticnoexcept

Gets the default configuration.

Definition at line 51 of file EdgeShapeConf.hpp.

◆ Set()

EdgeShapeConf & playrho::d2::EdgeShapeConf::Set ( Length2  vA,
Length2  vB 
)
noexcept

Sets both vertices in one call.

Examples
World.cpp.

Definition at line 33 of file EdgeShapeConf.cpp.

◆ UseVertexRadius()

EdgeShapeConf & playrho::d2::EdgeShapeConf::UseVertexRadius ( NonNegative< Length value)
inlinenoexcept

Uses the given vertex radius.

Examples
World.cpp.

Definition at line 107 of file EdgeShapeConf.hpp.

◆ Transform()

EdgeShapeConf & playrho::d2::EdgeShapeConf::Transform ( const Mat22 m)
noexcept

Transforms both vertices by the given transformation matrix.

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

Definition at line 43 of file EdgeShapeConf.cpp.

◆ GetVertexA()

Length2 playrho::d2::EdgeShapeConf::GetVertexA ( ) const
inlinenoexcept

Gets vertex A.

Definition at line 72 of file EdgeShapeConf.hpp.

◆ GetVertexB()

Length2 playrho::d2::EdgeShapeConf::GetVertexB ( ) const
inlinenoexcept

Gets vertex B.

Definition at line 78 of file EdgeShapeConf.hpp.

◆ GetChild()

DistanceProxy playrho::d2::EdgeShapeConf::GetChild ( ) const
inlinenoexcept

Gets the "child" shape.

Definition at line 84 of file EdgeShapeConf.hpp.

Member Data Documentation

◆ vertexRadius

NonNegative<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.

Note
This should be a non-negative value.

Definition at line 100 of file EdgeShapeConf.hpp.


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