PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::ShapeBuilder< ConcreteConf > Struct Template Reference

Builder configuration structure. More...

#include <ShapeConf.hpp>

Inheritance diagram for playrho::d2::ShapeBuilder< ConcreteConf >:
[legend]
Collaboration diagram for playrho::d2::ShapeBuilder< ConcreteConf >:
[legend]

Public Member Functions

constexpr ShapeBuilder ()=default
 Default constructor.
 
constexpr ShapeBuilder (const BaseShapeConf &value) noexcept
 Initializing constructor.
 
constexpr ConcreteConf & UseFriction (NonNegative< Real > value) noexcept
 Uses the given friction.
 
constexpr ConcreteConf & UseRestitution (Finite< Real > value) noexcept
 Uses the given restitution.
 
constexpr ConcreteConf & UseDensity (NonNegative< AreaDensity > value) noexcept
 Uses the given density.
 

Additional Inherited Members

- 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

template<typename ConcreteConf>
struct playrho::d2::ShapeBuilder< ConcreteConf >

Builder configuration structure.

This is a builder structure of chainable methods for building a shape configuration.

Note
This is a templated nested value class for initializing shapes that uses the Curiously Recurring Template Pattern (CRTP) to provide method chaining via static polymorphism.
See also
https://en.wikipedia.org/wiki/Curiously_recurring_template_pattern

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