Merge remote-tracking branch 'bp/master'

This commit is contained in:
Erwin Coumans
2018-05-31 18:03:56 -07:00
2 changed files with 70 additions and 2 deletions

View File

@@ -1270,6 +1270,7 @@ bool b3RobotSimulatorClientAPI_NoGUI::getDynamicsInfo(int bodyUniqueId, int link
status_handle = b3SubmitClientCommandAndWaitStatus(m_data->m_physicsClientHandle, cmd_handle);
status_type = b3GetStatusType(status_handle);
if (status_type == CMD_GET_DYNAMICS_INFO_COMPLETED) {
b3GetDynamicsInfo(status_handle, dynamicsInfo);
return true;
} else {
b3Warning("getDynamicsInfo did not complete");
@@ -1626,6 +1627,10 @@ bool b3RobotSimulatorClientAPI_NoGUI::setPhysicsEngineParameter(struct b3RobotSi
b3PhysicsParamSetDefaultFrictionERP(command,args.m_frictionERP);
}
if (args.m_solverResidualThreshold >= 0) {
b3PhysicsParamSetSolverResidualThreshold(command, args.m_solverResidualThreshold);
}
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command);
return true;
}
@@ -2061,3 +2066,53 @@ struct GUIHelperInterface* b3RobotSimulatorClientAPI_NoGUI::getGuiHelper()
{
return m_data->m_guiHelper;
}
bool b3RobotSimulatorClientAPI_NoGUI::getCollisionShapeData(int bodyUniqueId, int linkIndex,
b3CollisionShapeInformation &collisionShapeInfo)
{
b3PhysicsClientHandle sm = m_data->m_physicsClientHandle;
if (sm == 0) {
b3Warning("Not connected");
return false;
}
b3SharedMemoryCommandHandle command;
b3SharedMemoryStatusHandle statusHandle;
int statusType;
{
command = b3InitRequestCollisionShapeInformation(sm, bodyUniqueId, linkIndex);
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, command);
statusType = b3GetStatusType(statusHandle);
}
btAssert(statusType == CMD_COLLISION_SHAPE_INFO_COMPLETED);
if (statusType == CMD_COLLISION_SHAPE_INFO_COMPLETED) {
b3GetCollisionShapeInformation(sm, &collisionShapeInfo);
}
return true;
}
bool b3RobotSimulatorClientAPI_NoGUI::getVisualShapeData(int bodyUniqueId, b3VisualShapeInformation &visualShapeInfo)
{
b3PhysicsClientHandle sm = m_data->m_physicsClientHandle;
if (sm == 0) {
b3Warning("Not connected");
return false;
}
b3SharedMemoryCommandHandle commandHandle;
b3SharedMemoryStatusHandle statusHandle;
int statusType;
{
commandHandle = b3InitRequestVisualShapeInformation(sm, bodyUniqueId);
statusHandle = b3SubmitClientCommandAndWaitStatus(sm, commandHandle);
statusType = b3GetStatusType(statusHandle);
btAssert(statusType == CMD_VISUAL_SHAPE_INFO_COMPLETED);
if (statusType == CMD_VISUAL_SHAPE_INFO_COMPLETED) {
b3GetVisualShapeInformation(sm, &visualShapeInfo);
}
return true;
}
}