PlayRho  2.0.0
An interactive physics engine & library.
playrho::d2::detail::ShapeModel< T > Struct Template Referencefinal

Internal model configuration concept. More...

#include <playrho/d2/detail/ShapeModel.hpp>

Inheritance diagram for playrho::d2::detail::ShapeModel< T >:
[legend]
Collaboration diagram for playrho::d2::detail::ShapeModel< T >:
[legend]

Public Types

using data_type = T
 Type alias for the type of the data held.
 

Public Member Functions

template<typename U , std::enable_if_t<!std::is_same_v< U, ShapeModel >, int > = 0>
 ShapeModel (U &&arg) noexcept(std::is_nothrow_constructible_v< T, U >)
 Initializing constructor.
 
std::unique_ptr< ShapeConceptClone_ () const override
 Clones this concept and returns a pointer to a mutable copy. More...
 
DistanceProxy GetChild_ (ChildCounter index) const override
 Gets the "child" specified by the given index.
 
ChildCounter GetChildCount_ () const noexcept override
 Gets the "child" count.
 
const void * GetData_ () const noexcept override
 Gets the data for the underlying configuration.
 
NonNegative< AreaDensityGetDensity_ () const noexcept override
 Gets the density.
 
Filter GetFilter_ () const noexcept override
 Gets the filter. More...
 
NonNegativeFF< RealGetFriction_ () const noexcept override
 Gets the friction.
 
MassData GetMassData_ () const override
 Gets the mass data.
 
Real GetRestitution_ () const noexcept override
 Gets the restitution.
 
TypeID GetType_ () const noexcept override
 Gets the use type information. More...
 
NonNegative< LengthGetVertexRadius_ (ChildCounter idx) const override
 Gets the vertex radius. More...
 
bool IsEqual_ (const ShapeConcept &other) const noexcept override
 Equality checking function.
 
bool IsSensor_ () const noexcept override
 Gets whether or not this shape is a sensor. More...
 
void Rotate_ (const UnitVec &value) override
 Rotates all of the shape's vertices by the given amount.
 
void Scale_ (const Vec2 &value) override
 Scales all of the shape's vertices by the given amount.
 
void SetDensity_ (NonNegative< AreaDensity > value) noexcept override
 Sets the density.
 
void SetFilter_ (Filter value) override
 Sets the filter. More...
 
void SetFriction_ (NonNegative< Real > value) override
 Sets the friction.
 
void SetRestitution_ (Real value) override
 Sets the restitution.
 
void SetSensor_ (bool value) override
 Sets whether or not this shape is a sensor. More...
 
void SetVertexRadius_ (ChildCounter idx, NonNegative< Length > value) override
 Sets the vertex radius. More...
 
void Translate_ (const Length2 &value) override
 Translates all of the shape's vertices by the given amount.
 

Public Attributes

data_type data
 Data.
 

Detailed Description

template<typename T>
struct playrho::d2::detail::ShapeModel< T >

Internal model configuration concept.

Note
Provides an implementation for runtime polymorphism for shape configuration.

Member Function Documentation

◆ Clone_()

template<typename T >
std::unique_ptr<ShapeConcept> playrho::d2::detail::ShapeModel< T >::Clone_ ( ) const
inlineoverridevirtual

Clones this concept and returns a pointer to a mutable copy.

Note
This may throw std::bad_alloc or any exception that's thrown by the constructor for the model's underlying data type.
Exceptions
std::bad_allocif there's a failure allocating storage.

Implements playrho::d2::detail::ShapeConcept.

◆ GetFilter_()

template<typename T >
Filter playrho::d2::detail::ShapeModel< T >::GetFilter_ ( ) const
inlineoverridevirtualnoexcept

Gets the filter.

See also
SetFilter_.

Implements playrho::d2::detail::ShapeConcept.

◆ GetType_()

template<typename T >
TypeID playrho::d2::detail::ShapeModel< T >::GetType_ ( ) const
inlineoverridevirtualnoexcept

Gets the use type information.

Returns
Type info of the underlying value's type.

Implements playrho::d2::detail::ShapeConcept.

Referenced by playrho::d2::detail::ShapeModel< T >::IsEqual_().

◆ GetVertexRadius_()

template<typename T >
NonNegative<Length> playrho::d2::detail::ShapeModel< T >::GetVertexRadius_ ( ChildCounter  idx) const
inlineoverridevirtual

Gets the vertex radius.

Parameters
idxChild index to get vertex radius for.

Implements playrho::d2::detail::ShapeConcept.

◆ IsSensor_()

template<typename T >
bool playrho::d2::detail::ShapeModel< T >::IsSensor_ ( ) const
inlineoverridevirtualnoexcept

Gets whether or not this shape is a sensor.

See also
SetSensor_.

Implements playrho::d2::detail::ShapeConcept.

◆ SetFilter_()

template<typename T >
void playrho::d2::detail::ShapeModel< T >::SetFilter_ ( Filter  value)
inlineoverridevirtual

Sets the filter.

See also
GetFilter_.

Implements playrho::d2::detail::ShapeConcept.

◆ SetSensor_()

template<typename T >
void playrho::d2::detail::ShapeModel< T >::SetSensor_ ( bool  value)
inlineoverridevirtual

Sets whether or not this shape is a sensor.

See also
IsSensor_.

Implements playrho::d2::detail::ShapeConcept.

◆ SetVertexRadius_()

template<typename T >
void playrho::d2::detail::ShapeModel< T >::SetVertexRadius_ ( ChildCounter  idx,
NonNegative< Length value 
)
inlineoverridevirtual

Sets the vertex radius.

Parameters
idxChild index to set vertex radius for.
valueValue to set the vertex radius to.

Implements playrho::d2::detail::ShapeConcept.


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