Merge pull request #4021 from fuchuyuan/userData

add user data to deformable urdf
This commit is contained in:
erwincoumans 2021-11-03 19:23:09 +00:00 committed by GitHub
commit 98254b51a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3616,7 +3616,20 @@ bool PhysicsServerCommandProcessor::loadUrdf(const char* fileName, const btVecto
{
bool use_self_collision = false;
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);
if (ok)