mirror of
https://github.com/bulletphysics/bullet3.git
synced 2026-07-24 23:19:19 +00:00
Added fix for deleting debug points with life time.
This commit is contained in:
@@ -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();
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user