make setJointPosMultiDof and setJointVelMultiDof argument const.

add PyBullet.resetJointStateMultiDof / getJointStateMultiDof, for preliminary support for spherical and planar joints
This commit is contained in:
erwincoumans
2018-11-10 14:26:31 -08:00
parent 642c6a71d2
commit 17219f84c6
14 changed files with 512 additions and 36 deletions

View File

@@ -1291,6 +1291,37 @@ bool PhysicsDirect::getJointInfo(int bodyIndex, int jointIndex, struct b3JointIn
if ((jointIndex >= 0) && (jointIndex < bodyJoints->m_jointInfo.size()))
{
info = bodyJoints->m_jointInfo[jointIndex];
info.m_qSize = 0;
info.m_uSize = 0;
switch (info.m_jointType)
{
case eSphericalType:
{
info.m_qSize = 4;//quaterion x,y,z,w
info.m_uSize = 3;
break;
}
case ePlanarType:
{
info.m_qSize = 2;
info.m_uSize = 2;
break;
}
case ePrismaticType:
case eRevoluteType:
{
info.m_qSize = 1;
info.m_uSize = 1;
break;
}
default:
{
}
}
return true;
}
}