PlayRho  1.1.0
An Interactive Real-Time-Oriented C++ Physics Engine & Library
playrho::d2::Shape::Model< T > Struct Template Referencefinal

Internal model configuration concept. More...

Inheritance diagram for playrho::d2::Shape::Model< T >:
[legend]
Collaboration diagram for playrho::d2::Shape::Model< T >:
[legend]

Public Types

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

Public Member Functions

 Model (T arg)
 Initializing constructor.
 
std::unique_ptr< ConceptClone_ () const override
 Clones this concept and returns a pointer to a mutable copy. More...
 
ChildCounter GetChildCount_ () const noexcept override
 Gets the "child" count.
 
DistanceProxy GetChild_ (ChildCounter index) const override
 Gets the "child" specified by the given index.
 
MassData GetMassData_ () const noexcept override
 Gets the mass data.
 
NonNegative< LengthGetVertexRadius_ (ChildCounter idx) const override
 Gets the vertex radius. More...
 
NonNegative< AreaDensityGetDensity_ () const noexcept override
 Gets the density.
 
Real GetFriction_ () const noexcept override
 Gets the friction.
 
Real GetRestitution_ () const noexcept override
 Gets the restitution.
 
void Transform_ (const Mat22 &m) override
 Transforms all of the shape's vertices by the given transformation matrix. More...
 
bool IsEqual_ (const Concept &other) const noexcept override
 Equality checking method.
 
TypeID GetType_ () const noexcept override
 Gets the use type information. More...
 
const void * GetData_ () const noexcept override
 Gets the data for the underlying configuration.
 

Public Attributes

data_type data
 Data.
 

Detailed Description

template<typename T>
struct playrho::d2::Shape::Model< 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<Concept> playrho::d2::Shape::Model< 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::Shape::Concept.

◆ GetType_()

template<typename T >
TypeID playrho::d2::Shape::Model< T >::GetType_ ( ) const
inlineoverridevirtualnoexcept

Gets the use type information.

Returns
Type info of the underlying value's type.

Implements playrho::d2::Shape::Concept.

Referenced by playrho::d2::Shape::Model< T >::IsEqual_().

◆ GetVertexRadius_()

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

Gets the vertex radius.

Parameters
idxChild index to get vertex radius for.

Implements playrho::d2::Shape::Concept.

◆ Transform_()

template<typename T >
void playrho::d2::Shape::Model< T >::Transform_ ( const Mat22 m)
inlineoverridevirtual

Transforms all of the shape's vertices by the given transformation matrix.

See also
https://en.wikipedia.org/wiki/Transformation_matrix

Implements playrho::d2::Shape::Concept.


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