Skip to content

Commit

Permalink
Added fix for deleting debug points with life time.
Browse files Browse the repository at this point in the history
  • Loading branch information
ManuCorrea committed Dec 13, 2022
1 parent 2c204c4 commit 8549f00
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ p.connect(p.SHARED_MEMORY) #or (p.TCP, "localhost", 6667) or (p.UDP, "192.168.86

**Linux and Mac OSX gnu make**

Make sure cmake is installed (sudo apt-get install cmake, brew install cmake, or https://cmake.org)
Make sure gcc and cmake is installed (`sudo apt-get install build-essential` and `sudo apt-get install cmake` for Linux, `brew install cmake` for Mac, or https://cmake.org)

In a terminal type:
```
Expand Down
14 changes: 14 additions & 0 deletions examples/SharedMemory/PhysicsServerExample.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();


Expand Down

0 comments on commit 8549f00

Please sign in to comment.