Merge pull request #1776 from YunfeiBai/master

Remove the pdController when maxForce = 0
This commit is contained in:
erwincoumans
2018-06-26 08:54:40 -07:00
committed by GitHub
2 changed files with 5 additions and 2 deletions

View File

@@ -5189,7 +5189,6 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
}
b3PluginArguments args;
args.m_ints[0] = eSetPDControl;
args.m_ints[1] = bodyUniqueId;
//find the joint motors and apply the desired velocity and maximum force/torque
{
@@ -5242,6 +5241,11 @@ bool PhysicsServerCommandProcessor::processSendDesiredStateCommand(const struct
args.m_ints[2] = link;
args.m_numInts = 3;
args.m_numFloats = 5;
args.m_ints[0] = eSetPDControl;
if (args.m_floats[4] < B3_EPSILON) {
args.m_ints[0] = eRemovePDControl;
}
m_data->m_pluginManager.executePluginCommand(m_data->m_pdControlPlugin, &args);
}
}

View File

@@ -107,7 +107,6 @@ B3_SHARED_API int executePluginCommand_pdControlPlugin(struct b3PluginContext* c
if (arguments->m_numInts != 3)
return -1;
switch (arguments->m_ints[0])
{
case eSetPDControl: