The "multi-shape" shape configuration. More...

#include <MultiShapeConf.hpp>

Public Member Functions

 MultiShapeConf ()
 
MultiShapeConfAddConvexHull (const VertexSet &pointSet, NonNegative< Length > vertexRadius=GetDefaultVertexRadius()) noexcept
 
MultiShapeConfTransform (const Mat22 &m) noexcept
 Transforms the vertices of all the children by the given transformation matrix. More...
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< MultiShapeConf >
PLAYRHO_CONSTEXPR ShapeBuilder ()=default
 Default constructor. More...
 
PLAYRHO_CONSTEXPR ShapeBuilder (const BaseShapeConf &value) noexcept
 Initializing constructor. More...
 
PLAYRHO_CONSTEXPR MultiShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction. More...
 
PLAYRHO_CONSTEXPR MultiShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution. More...
 
PLAYRHO_CONSTEXPR MultiShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density. More...
 

Static Public Member Functions

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

Public Attributes

std::vector< ConvexHullchildren
 Children. 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

The "multi-shape" shape configuration.

Composes zero or more convex shapes into what can be a concave shape.

Definition at line 111 of file MultiShapeConf.hpp.

Constructor & Destructor Documentation

◆ MultiShapeConf()

playrho::d2::MultiShapeConf::MultiShapeConf ( )
inline

Definition at line 125 of file MultiShapeConf.hpp.

Member Function Documentation

◆ GetDefaultVertexRadius()

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

Gets the default vertex radius for the MultiShapeConf.

Definition at line 114 of file MultiShapeConf.hpp.

◆ GetDefaultConf()

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

Gets the default configuration for a MultiShapeConf.

Definition at line 120 of file MultiShapeConf.hpp.

◆ AddConvexHull()

MultiShapeConf & playrho::d2::MultiShapeConf::AddConvexHull ( const VertexSet pointSet,
NonNegative< Length vertexRadius = GetDefaultVertexRadius() 
)
noexcept

Creates a convex hull from the given set of local points. The size of the set must be in the range [1, MaxShapeVertices].

Warning
the points may be re-ordered, even if they form a convex polygon
collinear points are handled but not removed. Collinear points may lead to poor stacking behavior.

Definition at line 92 of file MultiShapeConf.cpp.

◆ Transform()

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

Transforms the vertices of all the children by the given transformation matrix.

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

Definition at line 99 of file MultiShapeConf.cpp.

Member Data Documentation

◆ children

std::vector<ConvexHull> playrho::d2::MultiShapeConf::children

Children.

Definition at line 143 of file MultiShapeConf.hpp.


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