Ignition Physics

API Reference

2.0.0
RequestFeatures< ToFeatureList > Struct Template Reference

This class can be used to request features from an entity, or identify what features are missing from an entity. More...

#include <Entity.hh>

Public Types

using Features = typename ToFeatureList::Features
 

Static Public Member Functions

template<typename PolicyT , typename FromFeatureList , template< typename, typename > class EntityT>
static EntityPtr< EntityT< PolicyT, ToFeatureList > > From (const EntityPtr< EntityT< PolicyT, FromFeatureList >> &_from)
 Cast an entity to another entity pointer, with the requested set of features. More...
 
template<typename PolicyT , typename FromFeatureList , template< typename, typename > class EntityT>
static std::set< std::stringMissingFeatureNames (const EntityPtr< EntityT< PolicyT, FromFeatureList >> &_entity)
 Check which features from the requested list are missing from the entity's plugin. More...
 

Detailed Description

template<typename ToFeatureList>
struct ignition::physics::RequestFeatures< ToFeatureList >

This class can be used to request features from an entity, or identify what features are missing from an entity.

Template Parameters
ToFeatureListThe list of features being requested.

Member Typedef Documentation

◆ Features

using Features = typename ToFeatureList::Features

Member Function Documentation

◆ From()

static EntityPtr<EntityT<PolicyT, ToFeatureList> > From ( const EntityPtr< EntityT< PolicyT, FromFeatureList >> &  _from)
static

Cast an entity to another entity pointer, with the requested set of features.

Template Parameters
PolicyTThe feature policy, such as FeaturePolicy3d.
FromFeatureListThe list of features from the original entity.
ToFeatureListThe list of features of the resulting entity.
Parameters
[in]_fromEntity to cast from.
Returns
The casted entity. It will be null if the physics engine doesn't support all requested features.

◆ MissingFeatureNames()

static std::set<std::string> MissingFeatureNames ( const EntityPtr< EntityT< PolicyT, FromFeatureList >> &  _entity)
static

Check which features from the requested list are missing from the entity's plugin.

Template Parameters
PolicyTThe feature policy, such as FeaturePolicy3d.
FromFeatureListThe current list of features from the entity.
Parameters
[in]_entityEntity to cast from.
Returns
The names of all missing features. Will be empty if no features are missing. If an invalid entity is given, the list will contain all features being requested.

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