Skip to content

Commit

Permalink
check empty nested model
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Jul 22, 2020
1 parent 4297947 commit 7740d5c
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/systems/physics/Physics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,15 @@ void PhysicsPrivate::CreatePhysicsEntities(const EntityComponentManager &_ecm)
{
auto parentPtrPhys = parentIt->second;
auto modelPtrPhys = parentPtrPhys->ConstructModel(model);
this->entityModelMap.insert(std::make_pair(_entity, modelPtrPhys));
if (modelPtrPhys)
{
this->entityModelMap.insert(std::make_pair(_entity, modelPtrPhys));
}
else
{
ignerr << "Model: '" << _name->Data() << "' not loaded. "
<< "Nested model not supported by physics engine. " << std::endl;
}
}
else
{
Expand Down Expand Up @@ -1387,9 +1395,6 @@ void PhysicsPrivate::UpdatePhysics(EntityComponentManager &_ecm)
if (linkEntityIt == this->linkEntityMap.end())
return true;

auto canonicalPoseComp =
_ecm.Component<components::Pose>(linkEntityIt->second);

// set world pose of canonical link in freegroup
math::Pose3d linkPose =
this->RelativePose(_entity, linkEntityIt->second, _ecm);
Expand Down Expand Up @@ -1647,7 +1652,7 @@ void PhysicsPrivate::UpdateSim(EntityComponentManager &_ecm)
if (canonicalLink)
{
// This is the canonical link, update the top level model.
// The pose this link w.r.t its top level model never changes
// The pose of this link w.r.t its top level model never changes
// because it's "fixed" to the model. Instead, we change
// the top level model's pose here. The physics engine gives us the
// pose of this link relative to world so to set the top level
Expand Down Expand Up @@ -1821,10 +1826,6 @@ void PhysicsPrivate::UpdateSim(EntityComponentManager &_ecm)
state);
}
}
else
{
ignwarn << "Unknown link with id " << _entity << " found\n";
}
return true;
});

Expand Down

0 comments on commit 7740d5c

Please sign in to comment.