playrho::d2::ShapeBuilder< ConcreteConf > Struct Template Reference

Builder configuration structure. More...

#include <ShapeConf.hpp>

Public Member Functions

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

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

Definition at line 69 of file ShapeConf.hpp.

Constructor & Destructor Documentation

◆ ShapeBuilder() [1/2]

template<typename ConcreteConf >
PLAYRHO_CONSTEXPR playrho::d2::ShapeBuilder< ConcreteConf >::ShapeBuilder ( )
inlinedefault

Default constructor.

◆ ShapeBuilder() [2/2]

template<typename ConcreteConf >
PLAYRHO_CONSTEXPR playrho::d2::ShapeBuilder< ConcreteConf >::ShapeBuilder ( const BaseShapeConf value)
inlineexplicitnoexcept

Initializing constructor.

Definition at line 77 of file ShapeConf.hpp.

Member Function Documentation

◆ UseFriction()

template<typename ConcreteConf >
PLAYRHO_CONSTEXPR ConcreteConf & playrho::d2::ShapeBuilder< ConcreteConf >::UseFriction ( NonNegative< Real value)
inlinenoexcept

Uses the given friction.

Definition at line 95 of file ShapeConf.hpp.

◆ UseRestitution()

template<typename ConcreteConf >
PLAYRHO_CONSTEXPR ConcreteConf & playrho::d2::ShapeBuilder< ConcreteConf >::UseRestitution ( Finite< Real value)
inlinenoexcept

Uses the given restitution.

Definition at line 103 of file ShapeConf.hpp.

◆ UseDensity()

template<typename ConcreteConf >
PLAYRHO_CONSTEXPR ConcreteConf & playrho::d2::ShapeBuilder< ConcreteConf >::UseDensity ( NonNegative< AreaDensity value)
inlinenoexcept

Uses the given density.

Definition at line 111 of file ShapeConf.hpp.


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