Added fix for deleting debug points with life time.

This commit is contained in:
yo
2022-12-13 18:39:21 +01:00
parent 2c204c49e5
commit 8549f00502
2 changed files with 15 additions and 1 deletions

View File

@@ -2799,6 +2799,20 @@ void PhysicsServerExample::stepSimulation(float deltaTime)
}
}
}
for (int i = m_multiThreadedHelper->m_userDebugPoints.size() - 1; i >= 0; i--)
{
if (m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime)
{
m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime -= deltaTime;
if (m_multiThreadedHelper->m_userDebugPoints[i].m_lifeTime <= 0)
{
m_multiThreadedHelper->m_userDebugPoints.swap(i, m_multiThreadedHelper->m_userDebugPoints.size() - 1);
m_multiThreadedHelper->m_userDebugPoints.pop_back();
}
}
}
updateGraphics();