mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-14 22:00:05 +00:00
fix issue when re-connecting to physics server, after removeBody.
This commit is contained in:
parent
433d11d8cf
commit
ea10c6d335
@ -2181,7 +2181,7 @@ int PhysicsServerCommandProcessor::createBodyInfoStream(int bodyUniqueId, char*
|
||||
//serialize the btMultiBody and send the data to the client. This is one way to get the link/joint names across the (shared memory) wire
|
||||
|
||||
InternalBodyHandle* bodyHandle = m_data->m_bodyHandles.getHandle(bodyUniqueId);
|
||||
btMultiBody* mb = bodyHandle->m_multiBody;
|
||||
btMultiBody* mb = bodyHandle? bodyHandle->m_multiBody:0;
|
||||
if (mb)
|
||||
{
|
||||
UrdfLinkNameMapUtil* util = new UrdfLinkNameMapUtil;
|
||||
@ -2837,10 +2837,11 @@ bool PhysicsServerCommandProcessor::processCommand(const struct SharedMemoryComm
|
||||
int actualNumBodies = 0;
|
||||
for (int i=0;i<usedHandles.size();i++)
|
||||
{
|
||||
InteralBodyData* body = m_data->m_bodyHandles.getHandle(usedHandles[i]);
|
||||
int usedHandle = usedHandles[i];
|
||||
InteralBodyData* body = m_data->m_bodyHandles.getHandle(usedHandle);
|
||||
if (body && (body->m_multiBody || body->m_rigidBody))
|
||||
{
|
||||
serverStatusOut.m_sdfLoadedArgs.m_bodyUniqueIds[actualNumBodies++] = i;
|
||||
serverStatusOut.m_sdfLoadedArgs.m_bodyUniqueIds[actualNumBodies++] = usedHandle;
|
||||
}
|
||||
}
|
||||
serverStatusOut.m_sdfLoadedArgs.m_numBodies = actualNumBodies;
|
||||
|
Loading…
Reference in New Issue
Block a user