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

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

#include <playrho/d2/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())
 
MultiShapeConfRotate (const UnitVec &value)
 Rotates all the vertices by the given amount.
 
MultiShapeConfScale (const Vec2 &value)
 Scales all the vertices by the given amount.
 
MultiShapeConfTranslate (const Length2 &value)
 Translates all the vertices by the given amount.
 
- Public Member Functions inherited from playrho::d2::ShapeBuilder< MultiShapeConf >
constexpr MultiShapeConfUseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 
constexpr MultiShapeConfUseFilter (Filter value) noexcept
 Uses the given filter.
 
constexpr MultiShapeConfUseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr MultiShapeConfUseIsSensor (bool value) noexcept
 Uses the given is-sensor value.
 
constexpr MultiShapeConfUseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 

Static Public Member Functions

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

Public Attributes

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

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() 
)

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.

◆ GetDefaultVertexRadius()

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

Gets the default vertex radius for the MultiShapeConf.

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

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