add user data to deformable urdf

This commit is contained in:
Chuyuan Fu 2021-10-29 17:46:03 -07:00
parent a62fb187a5
commit a2aada62ae

View File

@ -3616,7 +3616,20 @@ bool PhysicsServerCommandProcessor::loadUrdf(const char* fileName, const btVecto
{ {
bool use_self_collision = false; bool use_self_collision = false;
use_self_collision = (flags & CUF_USE_SELF_COLLISION); use_self_collision = (flags & CUF_USE_SELF_COLLISION);
return processDeformable(u2b.getDeformableModel(), pos, orn, bodyUniqueIdPtr, bufferServerToClient, bufferSizeInBytes, globalScaling, use_self_collision); bool ok = processDeformable(u2b.getDeformableModel(), pos, orn, bodyUniqueIdPtr, bufferServerToClient, bufferSizeInBytes, globalScaling, use_self_collision);
if (ok)
{
const UrdfModel* urdfModel = u2b.getUrdfModel();
if (urdfModel)
{
addUserData(urdfModel->m_userData, *bodyUniqueIdPtr);
}
return true;
}
else
{
return false;
}
} }
bool ok = processImportedObjects(fileName, bufferServerToClient, bufferSizeInBytes, useMultiBody, flags, u2b); bool ok = processImportedObjects(fileName, bufferServerToClient, bufferSizeInBytes, useMultiBody, flags, u2b);
if (ok) if (ok)