Skip to content

Commit

Permalink
Be more specific when looking for physics plugins (#965)
Browse files Browse the repository at this point in the history
Signed-off-by: Louise Poubel <[email protected]>
  • Loading branch information
chapulina authored Aug 11, 2021
1 parent b7346a4 commit 0f58670
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/systems/physics/Physics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -498,10 +498,13 @@ void Physics::Configure(const Entity &_entity,
return;
}

auto classNames = pluginLoader.AllPlugins();
auto classNames = pluginLoader.PluginsImplementing<
physics::ForwardStep::Implementation<
physics::FeaturePolicy3d>>();
if (classNames.empty())
{
ignerr << "No plugins found in library [" << pathToLib << "]." << std::endl;
ignerr << "No physics plugins found in library [" << pathToLib << "]."
<< std::endl;
return;
}

Expand All @@ -511,7 +514,11 @@ void Physics::Configure(const Entity &_entity,
auto plugin = pluginLoader.Instantiate(className);

if (!plugin)
{
ignwarn << "Failed to instantiate [" << className << "] from ["
<< pathToLib << "]" << std::endl;
continue;
}

this->dataPtr->engine = ignition::physics::RequestEngine<
ignition::physics::FeaturePolicy3d,
Expand Down

0 comments on commit 0f58670

Please sign in to comment.