mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-11-01 13:35:33 +00:00
Only clear the user data cache when a full user data sync is requested.
This commit is contained in:
@@ -1244,15 +1244,17 @@ void PhysicsDirect::postProcessStatus(const struct SharedMemoryStatus& serverCmd
|
||||
case CMD_SYNC_USER_DATA_COMPLETED:
|
||||
{
|
||||
B3_PROFILE("CMD_SYNC_USER_DATA_COMPLETED");
|
||||
// Remove all cached user data entries.
|
||||
m_data->m_userDataMap.clear();
|
||||
m_data->m_userDataHandleLookup.clear();
|
||||
for (int i = 0; i < m_data->m_bodyJointMap.size(); i++)
|
||||
{
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap.getAtIndex(i);
|
||||
if (bodyJointsPtr && *bodyJointsPtr)
|
||||
if (serverCmd.m_syncUserDataArgs.m_clearCachedUserDataEntries) {
|
||||
// Remove all cached user data entries.
|
||||
m_data->m_userDataMap.clear();
|
||||
m_data->m_userDataHandleLookup.clear();
|
||||
for (int i = 0; i < m_data->m_bodyJointMap.size(); i++)
|
||||
{
|
||||
(*bodyJointsPtr)->m_userDataIds.clear();
|
||||
BodyJointInfoCache2** bodyJointsPtr = m_data->m_bodyJointMap.getAtIndex(i);
|
||||
if (bodyJointsPtr && *bodyJointsPtr)
|
||||
{
|
||||
(*bodyJointsPtr)->m_userDataIds.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
const int numIdentifiers = serverCmd.m_syncUserDataArgs.m_numUserDataIdentifiers;
|
||||
|
||||
Reference in New Issue
Block a user