Merge pull request #2551 from erwincoumans/master

enable programmatic creation of spherical joint
This commit is contained in:
erwincoumans
2019-12-19 21:04:03 -08:00
committed by GitHub
2 changed files with 9 additions and 6 deletions

View File

@@ -5481,18 +5481,16 @@ B3_SHARED_API b3SharedMemoryCommandHandle b3ProfileTimingCommandInit(b3PhysicsCl
b3Assert(command); b3Assert(command);
int len = name ? strlen(name) : 0; int len = name ? strlen(name) : 0;
command->m_type = CMD_PROFILE_TIMING;
if (len > 0 && len < (MAX_FILENAME_LENGTH + 1)) if (len > 0 && len < (MAX_FILENAME_LENGTH + 1))
{ {
command->m_type = CMD_PROFILE_TIMING;
strcpy(command->m_profile.m_name, name); strcpy(command->m_profile.m_name, name);
command->m_profile.m_name[len] = 0; command->m_profile.m_name[len] = 0;
} }
else else
{ {
const char* invalid = "InvalidProfileTimingName"; command->m_profile.m_name[0] = 0;
int len = strlen(invalid);
strcpy(command->m_profile.m_name, invalid);
command->m_profile.m_name[len] = 0;
} }
command->m_profile.m_type = -1; command->m_profile.m_type = -1;
command->m_profile.m_durationInMicroSeconds = 0; command->m_profile.m_durationInMicroSeconds = 0;

View File

@@ -2363,7 +2363,12 @@ struct ProgrammaticUrdfInterface : public URDFImporterInterface
jointType = URDFFixedJoint; jointType = URDFFixedJoint;
break; break;
} }
//case eSphericalType: case eSphericalType:
{
isValid = true;
jointType = URDFSphericalJoint;
break;
}
//case ePlanarType: //case ePlanarType:
//case eFixedType: //case eFixedType:
//case ePoint2PointType: //case ePoint2PointType: