PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::MultiShapeConf Struct Reference

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

#include <MultiShapeConf.hpp>

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

Public Member Functions

MultiShapeConfAddConvexHull (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]. More...
 
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 >
constexpr ShapeBuilder ()=default
 Default constructor.
 
constexpr ShapeBuilder (const BaseShapeConf &value) noexcept
 Initializing constructor.
 
constexpr MultiShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr MultiShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 
constexpr MultiShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 

Static Public Member Functions

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

Public Attributes

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

Member Function Documentation

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

◆ 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

Referenced by playrho::d2::Transform().


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