Merge pull request #1177 from YunfeiBai/master

Bug fix. Only return friction coefficient when there is a valid link …
This commit is contained in:
erwincoumans
2017-06-14 08:11:57 -07:00
committed by GitHub

View File

@@ -4543,7 +4543,15 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
else
{
serverCmd.m_dynamicsInfo.m_mass = mb->getLinkMass(linkIndex);
serverCmd.m_dynamicsInfo.m_lateralFrictionCoeff = mb->getLinkCollider(linkIndex)->getFriction();
if (mb->getLinkCollider(linkIndex))
{
serverCmd.m_dynamicsInfo.m_lateralFrictionCoeff = mb->getLinkCollider(linkIndex)->getFriction();
}
else
{
b3Warning("The dynamic info requested is not available");
serverCmd.m_type = CMD_GET_DYNAMICS_INFO_FAILED;
}
}
hasStatus = true;
}