implement getJointInfo for objects loaded through SDF

This commit is contained in:
Erwin Coumans
2016-06-15 18:01:41 -07:00
parent 456c844a6b
commit 95a09bec99
10 changed files with 122 additions and 20 deletions

View File

@@ -393,14 +393,19 @@ int PhysicsDirect::getNumJoints(int bodyIndex) const
return 0;
}
void PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const
bool PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointInfo& info) const
{
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap[bodyIndex];
if (bodyJointsPtr && *bodyJointsPtr)
{
BodyJointInfoCache2* bodyJoints = *bodyJointsPtr;
info = bodyJoints->m_jointInfo[jointIndex];
if (jointIndex < bodyJoints->m_jointInfo.size())
{
info = bodyJoints->m_jointInfo[jointIndex];
return true;
}
}
return false;
}
///todo: move this out of the