Merge pull request #3198 from erwincoumans/master

fix changeDynamics for to set lower/upper joint limits
This commit is contained in:
erwincoumans 2020-12-22 17:18:09 -08:00 committed by GitHub
commit bbb6f86d12
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 5 deletions

View File

@ -347,6 +347,11 @@ void TCPThreadFunc(void* userPtr, void* lsMemory)
case GFX_CMD_SET_VISUALIZER_FLAG:
{
//disable single step rendering for GraphicsServer
if (args->m_cmdPtr->m_visualizerFlagCommand.m_visualizerFlag == COV_ENABLE_SINGLE_STEP_RENDERING)
{
args->m_cmdPtr->m_visualizerFlagCommand.m_visualizerFlag = 0;
}
args->submitCommand();
while (args->isCommandOutstanding())
{
@ -740,7 +745,8 @@ public:
}
case GFX_CMD_SET_VISUALIZER_FLAG:
{
if (clientCmd.m_visualizerFlagCommand.m_visualizerFlag != COV_ENABLE_RENDERING)
if ((clientCmd.m_visualizerFlagCommand.m_visualizerFlag != COV_ENABLE_RENDERING) &&
(clientCmd.m_visualizerFlagCommand.m_visualizerFlag != COV_ENABLE_SINGLE_STEP_RENDERING))
{
//printf("clientCmd.m_visualizerFlag.m_visualizerFlag: %d, clientCmd.m_visualizerFlag.m_enable %d\n",
// clientCmd.m_visualizerFlagCommand.m_visualizerFlag, clientCmd.m_visualizerFlagCommand.m_enable);

View File

@ -9735,10 +9735,7 @@ bool PhysicsServerCommandProcessor::processChangeDynamicsInfoCommand(const struc
btMultiBodyConstraint* mbc = m_data->m_dynamicsWorld->getMultiBodyConstraint(c);
if (mbc->getConstraintType() == MULTIBODY_CONSTRAINT_LIMIT)
{
if (((mbc->getMultiBodyA() == mb) && (mbc->getLinkA() == linkIndex))
||
((mbc->getMultiBodyB() == mb) && ((mbc->getLinkB() == linkIndex)))
)
if ((mbc->getMultiBodyA() == mb) && (mbc->getLinkA() == linkIndex))
{
limC = (btMultiBodyJointLimitConstraint*)mbc;
}