summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerwincoumans <erwincoumans@google.com>2021-11-03 19:23:09 +0000
committerGitHub <noreply@github.com>2021-11-03 19:23:09 +0000
commit98254b51a934371e6c6bab6e42d98784c79b3598 (patch)
treeaf1b4952d0ac338442d21c18a24b7535f734a071
parenta62fb187a5c83a2e1e3e0376565ab3ae47870465 (diff)
parenta2aada62aeed1217453ead26933ad8a90a1d9a85 (diff)
downloadbullet3-98254b51a934371e6c6bab6e42d98784c79b3598.tar.gz
Merge pull request #4021 from fuchuyuan/userData
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)