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::string > | MissingFeatureNames (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 gz::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
-
ToFeatureList The list of features being requested.
Member Typedef Documentation
◆ Features
using Features = typename ToFeatureList::Features |
Member Function Documentation
◆ From()
|
static |
Cast an entity to another entity pointer, with the requested set of features.
- Template Parameters
-
PolicyT The feature policy, such as FeaturePolicy3d
.FromFeatureList The list of features from the original entity. ToFeatureList The list of features of the resulting entity.
- Parameters
-
[in] _from Entity to cast from.
- Returns
- The casted entity. It will be null if the physics engine doesn't support all requested features.
◆ MissingFeatureNames()
|
static |
Check which features from the requested list are missing from the entity's plugin.
- Template Parameters
-
PolicyT The feature policy, such as FeaturePolicy3d
.FromFeatureList The current list of features from the entity.
- Parameters
-
[in] _entity Entity 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: