summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChuyuan Fu <fuchuyuan.kelly@gmail.com>2021-10-29 17:46:03 -0700
committerChuyuan Fu <fuchuyuan.kelly@gmail.com>2021-10-29 17:46:03 -0700
commita2aada62aeed1217453ead26933ad8a90a1d9a85 (patch)
treeaf1b4952d0ac338442d21c18a24b7535f734a071
parenta62fb187a5c83a2e1e3e0376565ab3ae47870465 (diff)
downloadbullet3-a2aada62aeed1217453ead26933ad8a90a1d9a85.tar.gz
add user data to deformable urdf
-rw-r--r--examples/SharedMemory/PhysicsServerCommandProcessor.cpp15
1 files changed, 14 insertions, 1 deletions
diff --git a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
index 708ea7463..ff6ad05ee 100644
--- a/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
+++ b/examples/SharedMemory/PhysicsServerCommandProcessor.cpp
@@ -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)