fix indexing issue removing graphics shape in tinyrenderer plugin (use getUserIndex3 instead of broadphase uid)

This commit is contained in:
Erwin Coumans
2020-01-08 13:49:41 -08:00
parent 02d48d743f
commit 6fde189735

View File

@@ -10544,7 +10544,7 @@ bool PhysicsServerCommandProcessor::processRemoveBodyCommand(const struct Shared
{ {
if (m_data->m_pluginManager.getRenderInterface()) if (m_data->m_pluginManager.getRenderInterface())
{ {
m_data->m_pluginManager.getRenderInterface()->removeVisualShape(bodyHandle->m_multiBody->getBaseCollider()->getBroadphaseHandle()->getUid()); m_data->m_pluginManager.getRenderInterface()->removeVisualShape(bodyHandle->m_multiBody->getBaseCollider()->getUserIndex3());
} }
m_data->m_dynamicsWorld->removeCollisionObject(bodyHandle->m_multiBody->getBaseCollider()); m_data->m_dynamicsWorld->removeCollisionObject(bodyHandle->m_multiBody->getBaseCollider());
int graphicsIndex = bodyHandle->m_multiBody->getBaseCollider()->getUserIndex(); int graphicsIndex = bodyHandle->m_multiBody->getBaseCollider()->getUserIndex();
@@ -10558,7 +10558,7 @@ bool PhysicsServerCommandProcessor::processRemoveBodyCommand(const struct Shared
{ {
if (m_data->m_pluginManager.getRenderInterface()) if (m_data->m_pluginManager.getRenderInterface())
{ {
m_data->m_pluginManager.getRenderInterface()->removeVisualShape(bodyHandle->m_multiBody->getLink(link).m_collider->getBroadphaseHandle()->getUid()); m_data->m_pluginManager.getRenderInterface()->removeVisualShape(bodyHandle->m_multiBody->getLink(link).m_collider->getUserIndex3());
} }
m_data->m_dynamicsWorld->removeCollisionObject(bodyHandle->m_multiBody->getLink(link).m_collider); m_data->m_dynamicsWorld->removeCollisionObject(bodyHandle->m_multiBody->getLink(link).m_collider);
int graphicsIndex = bodyHandle->m_multiBody->getLink(link).m_collider->getUserIndex(); int graphicsIndex = bodyHandle->m_multiBody->getLink(link).m_collider->getUserIndex();